diff -x .svn -aruN 0.7.11.src/banner.php 0.7.12.src/banner.php
--- 0.7.11.src/banner.php	2006-06-02 08:59:40.000000000 -0500
+++ 0.7.12.src/banner.php	2008-05-03 14:40:14.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/banner.php,v $
-|     $Revision: 1.14 $
-|     $Date: 2006/06/02 13:59:40 $
-|     $Author: lisa_ $
+|     $Revision: 1.16 $
+|     $Date: 2008/05/03 19:40:14 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("class2.php");
@@ -68,30 +68,33 @@
 			$BANNER_TABLE_STARTDATE = BANNERLAN_37." ".$start_date;
 			$BANNER_TABLE_ENDDATE = BANNERLAN_34." ".$end_date;
 			
-			if ($row['banner_ip']) {
+			if ($row['banner_ip']) 
+			{
 				$tmp = explode("^", $row['banner_ip']);
-				$BANNER_TABLE_IP_LAN = BANNERLAN_35.": ".(count($tmp)-1);
+				$BANNER_TABLE_IP_LAN = (count($tmp)-1);
 				for($a = 0; $a <= (count($tmp)-2); $a++) {
 					$BANNER_TABLE_IP .= $tmp[$a]."<br />";
 				}
 			}
 			 
-			if (!$BANNER_TABLE) {
+			if (!$BANNER_TABLE) 
+			{
 				if (file_exists(THEME."banner_template.php")) {
-					require_once(THEME."banner_template.php");
+					require(THEME."banner_template.php");
 				} else {
-					require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
+					require(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
 				}
 			}
 			$textstring .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE);
 		}
 	}
 	 
-	if (!$BANNER_TABLE) {
+	if (!$BANNER_TABLE) 
+	{
 		if (file_exists(THEME."banner_template.php")) {
-			require_once(THEME."banner_template.php");
+			require(THEME."banner_template.php");
 		} else {
-			require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
+			require(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
 		}
 	}
 	$textstart = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE_START);
diff -x .svn -aruN 0.7.11.src/class2.php 0.7.12.src/class2.php
--- 0.7.11.src/class2.php	2007-12-29 13:01:24.000000000 -0600
+++ 0.7.12.src/class2.php	2008-08-03 03:00:19.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/class2.php,v $
-|     $Revision: 1.355 $
-|     $Date: 2007/12/29 19:01:24 $
+|     $Revision: 1.364 $
+|     $Date: 2008/08/03 08:00:19 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -76,7 +76,8 @@
 {
 	$new_url = substr($_SERVER['PHP_SELF'], 0, $pos+4);
 	$new_loc = ($_SERVER['QUERY_STRING']) ? $new_url."?".$_SERVER['QUERY_STRING'] : $new_url;
-	Header("Location: ".$new_loc);
+	header("Location: ".$new_loc);
+	exit();
 }
 // If url contains a .php in it, PHP_SELF is set wrong (imho), affecting all paths.  We need to 'fix' it if it does.
 $_SERVER['PHP_SELF'] = (($pos = strpos($_SERVER['PHP_SELF'], ".php")) !== false ? substr($_SERVER['PHP_SELF'], 0, $pos+4) : $_SERVER['PHP_SELF']);
@@ -115,7 +116,7 @@
 if(is_numeric(str_replace(".","",$_SERVER['HTTP_HOST']))){
 	$srvtmp = "";  // Host is an IP address.
 }else{
-	$srvtmp = explode(".",$_SERVER['HTTP_HOST']);
+	$srvtmp = explode(".",str_replace("www.","",$_SERVER['HTTP_HOST']));
 }
 
 define("e_SUBDOMAIN", (count($srvtmp)>2 && $srvtmp[2] ? $srvtmp[0] : FALSE)); // needs to be available to e107_config.
@@ -143,9 +144,11 @@
 // F: Grab e107_config, get directory paths and create $e107 object
 //
 @include_once(realpath(dirname(__FILE__).'/e107_config.php'));
-if(!isset($ADMIN_DIRECTORY)){
-	// e107_config.php is either empty, not valid or doesn't exist so redirect to installer..
-  	header("Location: install.php");
+if(!isset($ADMIN_DIRECTORY))
+{
+  // e107_config.php is either empty, not valid or doesn't exist so redirect to installer..
+  header("Location: install.php");
+  exit();
 }
 
 //
@@ -375,7 +378,7 @@
 			e107_ini_set("session.cookie_domain",".".e_DOMAIN);
 			require_once(e_HANDLER."language_class.php");
 			$lng = new language;
-	        if(e_SUBDOMAIN == "www" || e_SUBDOMAIN === FALSE)
+	        if(!e_SUBDOMAIN)
 			{
 	        	$GLOBALS['elan'] = $pref['sitelanguage'];
 			}
@@ -403,33 +406,49 @@
 // Now matches RFC 2616 (sec 3.2): case insensitive, https/:443 and http/:80 are equivalent.
 // And, this is robust against hack attacks. Malignant users can put **anything** in HTTP_HOST!
 if($pref['redirectsiteurl'] && $pref['siteurl']) {
-	// Find domain and port from user and from pref
-	list($urlbase,$urlport) = explode(':',$_SERVER['HTTP_HOST'].':');
-	if (!$urlport) { $urlport = $_SERVER['SERVER_PORT']; }
-	if (!$urlport) { $urlport = 80; }
-	$aPrefURL = explode('/',$pref['siteurl'],4);
-	if (count($aPrefURL) > 2) { // we can do this -- there's at least http[s]://dom.ain/whatever
-		$PrefRoot = $aPrefURL[2];
-		list($PrefSiteBase,$PrefSitePort) = explode(':',$PrefRoot.':');
-		if (!$PrefSitePort) {
-			$PrefSitePort = ( $aPrefURL[0] == "https:" ) ? 443 : 80;	// no port so set port based on 'scheme'
-		}
-
-		// Redirect only if
-		// -- ports do not match (http <==> https)
-		// -- base domain does not match (case-insensitive)
-		// -- NOT admin area
-		if (($urlport != $PrefSitePort || stripos($PrefSiteBase, $urlbase) === FALSE) && strpos(e_SELF, ADMINDIR) === FALSE) 		{
-			$aeSELF = explode('/',e_SELF,4);
-			$aeSELF[0] = $aPrefURL[0];	// Swap in correct type of query (http, https)
-			$aeSELF[1] = '';						// Defensive code: ensure http:// not http:/<garbage>/
-			$aeSELF[2] = $aPrefURL[2];  // Swap in correct domain and possibly port
-			$location = implode('/',$aeSELF).(e_QUERY ? "?".e_QUERY : "");
 
-		header("Location: {$location}", true, 301); // send 301 header, not 302
-		exit();
+	if(isset($pref['multilanguage_subdomain']) && $pref['multilanguage_subdomain'])
+	{
+   		if(substr(e_SELF,7,4)=="www." || substr(e_SELF,8,4)=="www.")
+		{
+			$self = e_SELF;
+			if(e_QUERY){ $self .= "?".e_QUERY; }
+			$location = str_replace("://www.","://",$self);
+			header("Location: {$location}", true, 301); // send 301 header, not 302
+			exit();
+		}
+	}
+    else
+	{
+		// Find domain and port from user and from pref
+		list($urlbase,$urlport) = explode(':',$_SERVER['HTTP_HOST'].':');
+		if (!$urlport) { $urlport = $_SERVER['SERVER_PORT']; }
+		if (!$urlport) { $urlport = 80; }
+		$aPrefURL = explode('/',$pref['siteurl'],4);
+		if (count($aPrefURL) > 2) { // we can do this -- there's at least http[s]://dom.ain/whatever
+			$PrefRoot = $aPrefURL[2];
+			list($PrefSiteBase,$PrefSitePort) = explode(':',$PrefRoot.':');
+			if (!$PrefSitePort) {
+				$PrefSitePort = ( $aPrefURL[0] == "https:" ) ? 443 : 80;	// no port so set port based on 'scheme'
+			}
+
+			// Redirect only if
+			// -- ports do not match (http <==> https)
+			// -- base domain does not match (case-insensitive)
+			// -- NOT admin area
+			if (($urlport != $PrefSitePort || stripos($PrefSiteBase, $urlbase) === FALSE) && strpos(e_SELF, ADMINDIR) === FALSE) 		{
+				$aeSELF = explode('/',e_SELF,4);
+				$aeSELF[0] = $aPrefURL[0];	// Swap in correct type of query (http, https)
+				$aeSELF[1] = '';						// Defensive code: ensure http:// not http:/<garbage>/
+				$aeSELF[2] = $aPrefURL[2];  // Swap in correct domain and possibly port
+				$location = implode('/',$aeSELF).(e_QUERY ? "?".e_QUERY : "");
+
+			header("Location: {$location}", true, 301); // send 301 header, not 302
+			exit();
+		}
+
+		}
 	}
-}
 }
 
 $page = substr(strrchr($_SERVER['PHP_SELF'], "/"), 1);
@@ -454,9 +473,11 @@
 	} else {
 		setcookie('e107language_'.$pref['cookie_name'], $_POST['sitelanguage'], time() + 86400, "/");
 		$_COOKIE['e107language_'.$pref['cookie_name']] = $_POST['sitelanguage'];
-		if (strpos(e_SELF, ADMINDIR) === FALSE) {
-			$locat = ((!$_GET['elan'] && e_QUERY) || (e_QUERY && e_LANCODE)) ? e_SELF."?".e_QUERY : e_SELF;
-		  	 	header("Location:".$locat);
+		if (strpos(e_SELF, ADMINDIR) === FALSE) 
+		{
+		  $locat = ((!$_GET['elan'] && e_QUERY) || (e_QUERY && e_LANCODE)) ? e_SELF."?".e_QUERY : e_SELF;
+		  header("Location:".$locat);
+		  exit();
 		}
 	}
 }
@@ -583,12 +604,15 @@
 $sql->db_Mark_Time('Start: Load Theme');
 
 //###########  Module redefinable functions ###############
-if (!function_exists('checkvalidtheme')) {
-	function checkvalidtheme($theme_check) {
-		// arg1 = theme to check
-		global $ADMIN_DIRECTORY, $tp, $e107;
+if (!function_exists('checkvalidtheme')) 
+{
+	// arg1 = theme to check
+	function checkvalidtheme($theme_check) 
+	{
+	  global $ADMIN_DIRECTORY, $tp, $e107;
 
-		if (ADMIN && strpos(e_QUERY, "themepreview") !== FALSE) {
+	  if (ADMIN && strpos(e_QUERY, "themepreview") !== FALSE) 
+	  {	// Theme preview
 			list($action, $id) = explode('.', e_QUERY);
 			require_once(e_HANDLER."theme_handler.php");
 			$themeArray = themeHandler :: getThemes("id");
@@ -597,34 +621,42 @@
 			define("THEME", e_THEME.$themeArray[$id]."/");
 			define("THEME_ABS", e_THEME_ABS.$themeArray[$id]."/");
 			return;
+	  }
+	  if (@fopen(e_THEME.$theme_check."/theme.php", "r")) 
+	  {  // 'normal' theme load
+		define("THEME", e_THEME.$theme_check."/");
+		define("THEME_ABS", e_THEME_ABS.$theme_check."/");
+		$e107->site_theme = $theme_check;
+	  } 
+	  else 
+	  {
+		function search_validtheme() 
+		{
+		  global $e107;
+		  $th=substr(e_THEME, 0, -1);
+		  $handle=opendir($th);
+		  while ($file = readdir($handle)) 
+		  {
+			if (is_dir(e_THEME.$file) && is_readable(e_THEME.$file.'/theme.php')) 
+			{
+			  closedir($handle);
+			  $e107->site_theme = $file;
+			  return $file;
+			}
+		  }
+		  closedir($handle);
 		}
-		if (@fopen(e_THEME.$theme_check."/theme.php", "r")) {
-			define("THEME", e_THEME.$theme_check."/");
-			define("THEME_ABS", e_THEME_ABS.$theme_check."/");
-			$e107->site_theme = $theme_check;
-		} else {
-			function search_validtheme() {
-				global $e107;
-				$th=substr(e_THEME, 0, -1);
-				$handle=opendir($th);
-				while ($file = readdir($handle)) {
-					if (is_dir(e_THEME.$file) && is_readable(e_THEME.$file.'/theme.php')) {
-						closedir($handle);
-						$e107->site_theme = $file;
-						return $file;
-					}
-				}
-				closedir($handle);
-			}
-			$e107tmp_theme = search_validtheme();
-			define("THEME", e_THEME.$e107tmp_theme."/");
-			define("THEME_ABS", e_THEME_ABS.$e107tmp_theme."/");
-			if (ADMIN && strpos(e_SELF, $ADMIN_DIRECTORY) === FALSE) {
-				echo '<script>alert("'.$tp->toJS(CORE_LAN1).'")</script>';
-			}
+
+		$e107tmp_theme = search_validtheme();
+		define("THEME", e_THEME.$e107tmp_theme."/");
+		define("THEME_ABS", e_THEME_ABS.$e107tmp_theme."/");
+		if (ADMIN && strpos(e_SELF, $ADMIN_DIRECTORY) === FALSE) 
+		{
+		  echo '<script>alert("'.$tp->toJS(CORE_LAN1).'")</script>';
 		}
-		$themes_dir = $e107->e107_dirs["THEMES_DIRECTORY"];
-		$e107->http_theme_dir = "{$e107->server_path}{$themes_dir}{$e107->site_theme}/";
+	  }
+	  $themes_dir = $e107->e107_dirs["THEMES_DIRECTORY"];
+	  $e107->http_theme_dir = "{$e107->server_path}{$themes_dir}{$e107->site_theme}/";
 	}
 }
 
@@ -673,10 +705,13 @@
 
 $e107->ban();
 
-if(varset($pref['force_userupdate']) && USER) {
-	if(force_userupdate()) {
-		header("Location: ".e_BASE."usersettings.php?update");
-	}
+if(varset($pref['force_userupdate']) && USER) 
+{
+  if(force_userupdate()) 
+  {
+	header("Location: ".e_BASE."usersettings.php?update");
+	exit();
+  }
 }
 
 $sql->db_Mark_Time('Start: Signup/splash/admin');
@@ -686,7 +721,7 @@
 
 if ($pref['membersonly_enabled'] && !USER && e_SELF != SITEURL.e_SIGNUP && e_SELF != SITEURL."index.php" && e_SELF != SITEURL."fpw.php" && e_SELF != SITEURL.e_LOGIN && strpos(e_PAGE, "admin") === FALSE && e_SELF != SITEURL.'membersonly.php' && e_SELF != SITEURL.'sitedown.php') {
 	header("Location: ".e_HTTP."membersonly.php");
-	exit;
+	exit();
 }
 
 $sql->db_Delete("tmp", "tmp_time < ".(time() - 300)." AND tmp_ip!='data' AND tmp_ip!='submitted_link'");
@@ -695,7 +730,7 @@
 
 if ($pref['maintainance_flag'] && ADMIN == FALSE && strpos(e_SELF, "admin.php") === FALSE && strpos(e_SELF, "sitedown.php") === FALSE) {
 	header("Location: ".SITEURL."sitedown.php");
-	exit;
+	exit();
 }
 
 $sql->db_Mark_Time('(Start: Login/logout/ban/tz)');
@@ -775,64 +810,89 @@
 
 $sql->db_Mark_Time('(Start: Find/Load Theme)');
 
-if(!defined("THEME")){
-	// any plugin file starting with 'admin_' is assumed to use admin theme
-	// any plugin file in a folder called admin/ is assumed to use admin theme.
-	// any file that specifies $eplug_admin = TRUE;
-	// this test: (strpos(e_SELF,'/'.$PLUGINS_DIRECTORY) !== FALSE && strpos(e_PAGE,"admin_") === 0)
-	// alternate test: match ANY file starting with 'admin_'...
-	//   strpos(e_PAGE, "admin_") === 0
-	//
-	// here we TEST the theme (see below for deciding what theme to USE)
-	//
-
-	if((strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE || (strpos(e_SELF,'/'.$PLUGINS_DIRECTORY) !== FALSE && (strpos(e_PAGE,"admin_") === 0 || strpos(str_replace($e107->base_path, "", e_SELF), "admin/") !== FALSE)) || (isset($eplug_admin) && $eplug_admin == TRUE)) && $pref['admintheme']) {
-
-		if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') !== FALSE) {
-			checkvalidtheme($pref['sitetheme']);
-		} else if (strpos(e_SELF, "newspost.php") !== FALSE) {
-			define("MAINTHEME", e_THEME.$pref['sitetheme']."/");
-			checkvalidtheme($pref['admintheme']);
-		}
-		else {
-			checkvalidtheme($pref['admintheme']);
-		}
-	} else {
-		if (USERTHEME !== FALSE && USERTHEME != "USERTHEME") {
-			checkvalidtheme(USERTHEME);
-		} else {
-			checkvalidtheme($pref['sitetheme']);
-		}
-	}
+
+// Work out which theme to use
+//----------------------------
+// The following files are assumed to use admin theme:
+//	  1. Any file in the admin directory (check for non-plugin added to avoid mismatches)
+// 	  2. any plugin file starting with 'admin_' 
+// 	  3. any plugin file in a folder called admin/ 
+// 	  4. any file that specifies $eplug_admin = TRUE;
+//
+// e_SELF has the full HTML path
+$inAdminDir = FALSE;
+$isPluginDir = strpos(e_SELF,'/'.$PLUGINS_DIRECTORY) !== FALSE;		// True if we're in a plugin
+$e107Path = str_replace($e107->base_path, "", e_SELF);				// Knock off the initial bits
+if	( 
+		 (!$isPluginDir && strpos($e107Path, $ADMIN_DIRECTORY) === 0 ) 								// Core admin directory
+	  || ($isPluginDir && (strpos(e_PAGE,"admin_") === 0 || strpos($e107Path, "admin/") !== FALSE)) // Plugin admin file or directory
+	  || (varsettrue($eplug_admin))																	// Admin forced
+	)
+{
+  $inAdminDir = TRUE;
 }
 
 
+if(!defined("THEME"))
+{
+	if ($inAdminDir && varsettrue($pref['admintheme'])&& (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE))
+	{
+/*	  if (strpos(e_SELF, "newspost.php") !== FALSE) 
+	  {
+		define("MAINTHEME", e_THEME.$pref['sitetheme']."/");		MAINTHEME no longer used in core distribution
+	  }  */
+	  checkvalidtheme($pref['admintheme']);
+	} 
+	elseif (USERTHEME !== FALSE && USERTHEME != "USERTHEME") 
+	{
+	  checkvalidtheme(USERTHEME);
+	} 
+	else 
+	{
+	  checkvalidtheme($pref['sitetheme']);
+	}
+}
+
 
 // --------------------------------------------------------------
 
-	// here we USE the theme
-	if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE && (strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE || (strpos(e_SELF,'/'.$PLUGINS_DIRECTORY) !== FALSE && strpos(e_PAGE,"admin_") === 0) || (isset($eplug_admin) && $eplug_admin == TRUE))) {
-	if (file_exists(THEME.'admin_theme.php')) {
-		require_once(THEME.'admin_theme.php');
-	} else {
-		require_once(THEME."theme.php");
-	}
-} else {
+
+// here we USE the theme
+if ($inAdminDir)
+{
+  if (file_exists(THEME.'admin_theme.php')) 
+  {
+	require_once(THEME.'admin_theme.php');
+  } 
+  else 
+  {
 	require_once(THEME."theme.php");
+  }
+} 
+else 
+{
+  require_once(THEME."theme.php");
 }
 
+
+
+
 $exclude_lan = array("lan_signup.php");  // required for multi-language.
 
-if (strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE || strpos(e_SELF, "admin.php") !== FALSE) {
-	e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_".e_PAGE);
-	e107_include_once(e_LANGUAGEDIR."English/admin/lan_".e_PAGE);
-} else if (!in_array("lan_".e_PAGE,$exclude_lan) && strpos(e_SELF, $PLUGINS_DIRECTORY) === FALSE) {
-	e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_".e_PAGE);
-	e107_include_once(e_LANGUAGEDIR."English/lan_".e_PAGE);
+if ($inAdminDir)
+{
+  e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_".e_PAGE);
+  e107_include_once(e_LANGUAGEDIR."English/admin/lan_".e_PAGE);
+} 
+elseif (!in_array("lan_".e_PAGE,$exclude_lan) && !$isPluginDir) 
+{
+  e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_".e_PAGE);
+  e107_include_once(e_LANGUAGEDIR."English/lan_".e_PAGE);
 }
 
 
 
+
 if(!defined("IMODE")) define("IMODE", "lite");
 
 if ($pref['anon_post'] ? define("ANON", TRUE) : define("ANON", FALSE));
@@ -1301,22 +1361,28 @@
 	global $sql, $pref, $user_pref, $tp, $currentUser, $e107;
 
 	define('USERIP', $e107->getip());
-	if (!isset($_COOKIE[$pref['cookie_name']]) && !isset($_SESSION[$pref['cookie_name']])) {
+	if (!isset($_COOKIE[$pref['cookie_name']]) && !isset($_SESSION[$pref['cookie_name']])) 
+	{
 		define("USER", FALSE);
+		define('USERID', 0);
 		define("USERTHEME", FALSE);
 		define("ADMIN", FALSE);
 		define("GUEST", TRUE);
 		define('USERCLASS', '');
 		define('USEREMAIL', '');
-	} else {
+	} 
+	else 
+	{
 		list($uid, $upw)=(isset($_COOKIE[$pref['cookie_name']]) && $_COOKIE[$pref['cookie_name']] ? explode(".", $_COOKIE[$pref['cookie_name']]) : explode(".", $_SESSION[$pref['cookie_name']]));
 
-		if (empty($uid) || empty($upw)) {
+		if (empty($uid) || empty($upw)) 
+		{
 			cookie($pref['cookie_name'], "", (time() - 2592000));
 			$_SESSION[$pref['cookie_name']] = "";
 			session_destroy();
 			define("ADMIN", FALSE);
 			define("USER", FALSE);
+			define('USERID', 0);
 			define("USERCLASS", "");
 			define("LOGINMESSAGE",CORE_LAN10."<br /><br />");
 			return (FALSE);
@@ -1376,8 +1442,11 @@
 			} else {
 				define("ADMIN", FALSE);
 			}
-		} else {
+		} 
+		else 
+		{
 			define("USER", FALSE);
+			define('USERID', 0);
 			define("USERTHEME", FALSE);
 			define("ADMIN", FALSE);
 			define("CORRUPT_COOKIE", TRUE);
@@ -1394,7 +1463,7 @@
 	$e_online->online($pref['track_online'], $pref['flood_protect']);
 }
 
-function cookie($name, $value, $expire, $path = "/", $domain = "", $secure = 0) {
+function cookie($name, $value, $expire=0, $path = "/", $domain = "", $secure = 0) {
 	setcookie($name, $value, $expire, $path, $domain, $secure);
 }
 
@@ -1520,19 +1589,25 @@
 	return (isset($ret)) ? $ret : "";
 }
 
-if(!function_exists("print_a")) {
+if(!function_exists("print_a")) 
+{
+  function print_a($var, $return = false) 
+  {
 	$charset = "utf-8";
-	if(defined("CHARSET")) {
-		$charset = CHARSET;
+	if(defined("CHARSET")) 
+	{
+	  $charset = CHARSET;
 	}
-	function print_a($var, $return = false) {
-		if(!$return){
-			echo '<pre>'.htmlspecialchars(print_r($var, true), ENT_QUOTES, $charset).'</pre>';
-			return true;
-		} else {
-			return '<pre>'.htmlspecialchars(print_r($var, true), ENT_QUOTES, $charset).'</pre>';
-		}
+	if(!$return)
+	{
+	  echo '<pre>'.htmlspecialchars(print_r($var, true), ENT_QUOTES, $charset).'</pre>';
+	  return true;
+	} 
+	else 
+	{
+	  return '<pre>'.htmlspecialchars(print_r($var, true), ENT_QUOTES, $charset).'</pre>';
 	}
+  }
 }
 
 
@@ -1559,19 +1634,17 @@
 
 	if (!varset($pref['disable_emailcheck'],TRUE) && !trim($currentUser['user_email'])) return TRUE;
 
-	if($sql -> db_Select("user_extended_struct", "user_extended_struct_name", "user_extended_struct_required = '1'"))
+	if($sql -> db_Select("user_extended_struct", "user_extended_struct_name, user_extended_struct_type", "user_extended_struct_required = '1'"))
 	{
-		while($row = $sql -> db_Fetch())
+	  while($row = $sql -> db_Fetch())
+	  {
+		$user_extended_struct_name = "user_{$row['user_extended_struct_name']}";
+		if ((!$currentUser[$user_extended_struct_name]) || (($row['user_extended_struct_type'] == 7) && ($currentUser[$user_extended_struct_name] == '0000-00-00')))
 		{
-			$user_extended_struct_name = "user_{$row['user_extended_struct_name']}";
-
-			if(!$currentUser[$user_extended_struct_name])
-			{
-				return TRUE;
-			}
+		  return TRUE;
 		}
+	  }
 	}
-
 	return FALSE;
 }
 
diff -x .svn -aruN 0.7.11.src/comment.php 0.7.12.src/comment.php
--- 0.7.11.src/comment.php	2007-12-08 08:49:56.000000000 -0600
+++ 0.7.12.src/comment.php	2008-06-03 16:31:19.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/comment.php,v $
-|     $Revision: 1.55 $
-|     $Date: 2007/12/08 14:49:56 $
+|     $Revision: 1.57 $
+|     $Date: 2008/06/03 21:31:19 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -36,40 +36,38 @@
 $nid = intval(varset($temp_query[3], ""));	// Action - e.g. 'edit'. Or news ID for reply with nested comments
 $xid = intval(varset($temp_query[4], ""));	// ID of target comment
 global $comment_edit_query;
-//$comment_edit_query = '';
-//if ($temp_query[3] == 'edit') $comment_edit_query = $temp_query[0].".".$temp_query[1].".".$temp_query[2];
 $comment_edit_query = $temp_query[0].".".$temp_query[1].".".$temp_query[2];
 unset($temp_query);
 
+$redirectFlag = 0;
 if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit'])) 
-{
+{	// New comment, or edited comment, being posted.
 	if(!ANON && !USER)
 	{
-		header("location: ".e_BASE."index.php");
-		exit;
+	  header("location: ".e_BASE."index.php");
+	  exit;
 	}
 
 	if($table == "poll") 
 	{
-		if (!$sql->db_Select("polls", "poll_title", "`poll_id` = '{$id}' AND `poll_comment` = 1")) 
-		{
-			header("location: ".e_BASE."index.php");
-			exit;
-		}
-	} else if($table == "news") 
+	  if (!$sql->db_Select("polls", "poll_title", "`poll_id` = '{$id}' AND `poll_comment` = 1")) 
+	  {
+		header("location: ".e_BASE."index.php");
+		exit;
+	  }
+	} 
+	elseif($table == "news") 
 	{
-		if (!$sql->db_Select("news", "news_allow_comments", "`news_id` = '{$id}' AND `news_allow_comments` = 0")) 
-		{
-			header("location: ".e_BASE."index.php");
-			exit;
-		}
+	  if (!$sql->db_Select("news", "news_allow_comments", "`news_id` = '{$id}' AND `news_allow_comments` = 0")) 
+	  {
+		header("location: ".e_BASE."index.php");
+		exit;
+	  }
 	}
 
-//	$pid = (isset($_POST['pid']) ? $_POST['pid'] : 0);
-//	$pid = intval($pid);
-	$pid = intval(varset($_POST['pid'], 0));
+	$pid = intval(varset($_POST['pid'], 0));				// ID of the specific comment being edited (nested comments - replies)
 
-	$editpid = intval(varset($_POST['editpid'], 0));		// ID of the specific comment being edited
+	$editpid = intval(varset($_POST['editpid'], 0));		// ID of the specific comment being edited (in-line comments)
 
 	$clean_authorname = $_POST['author_name'];
 	$clean_comment = $_POST['comment'];
@@ -87,72 +85,76 @@
 
 	if($editpid) 
 	{
-		$redir = preg_replace("#\.edit.*#si", "", e_QUERY);
+	  $redirectFlag = $id;
+/*		$redir = preg_replace("#\.edit.*#si", "", e_QUERY);
 		header("Location: ".e_SELF."?{$redir}");
-		exit;
+		exit;  */
 	}
 }
 
 
 if (isset($_POST['replysubmit']))
-{
+{	// Reply to nested comment being posted
 	if ($table == "news" && !$sql->db_Select("news", "news_allow_comments", "news_id='{$nid}' ")) 
 	{
-		header("location:".e_BASE."index.php");
-		exit;
+	  header("location:".e_BASE."index.php");
+	  exit;
 	} 
 	else 
 	{
-		$row = $sql->db_Fetch();
-		if (!$row['news_id']) {
-			$pid = (isset($_POST['pid']) ? $_POST['pid'] : 0);
-			$pid = intval($pid);
-
-			$clean_authorname = $_POST['author_name'];
-			$clean_comment = $_POST['comment'];
-			$clean_subject = $_POST['subject'];
+	  $row = $sql->db_Fetch();
+	  if (!$row['news_id']) 
+	  {
+		$pid = (isset($_POST['pid']) ? $_POST['pid'] : 0);
+		$pid = intval($pid);
 
-			$cobj->enter_comment($clean_authorname, $clean_comment, $table, $nid, $pid, $clean_subject);
-			$e107cache->clear("comment.php?{$table}.{$id}");
-		}
-		//plugin e_comment.php files
-		$plugin_redir = false;
-		$e_comment = $cobj->get_e_comment();
-		if ($table == $e_comment[$table]['eplug_comment_ids']){
-			$plugin_redir = TRUE;
-			$reply_location = str_replace("{NID}", $nid, $e_comment[$table]['reply_location']);
-		}
+		$clean_authorname = $_POST['author_name'];
+		$clean_comment = $_POST['comment'];
+		$clean_subject = $_POST['subject'];
 
-		if ($plugin_redir)
-		{
-			echo "<script type='text/javascript'>document.location.href='{$reply_location}'</script>\n";
-			exit;
-		} elseif ($table == "news" || $table == "poll")
-		{
-			echo "<script type='text/javascript'>document.location.href='".e_BASE."comment.php?comment.{$table}.{$nid}'</script>\n";
-			exit;
-		} elseif($table == "bugtrack")
-		{
-			echo "<script type='text/javascript'>document.location.href='".e_PLUGIN."bugtracker/bugtracker.php?show.{$nid}'</script>\n";
-			exit;
-		} elseif($table == "faq")
-		{
-			echo "<script type='text/javascript'>document.location.href='".e_PLUGIN."faq/faq.php?cat.{$xid}.{$nid}'</script>\n";
-			exit;
-		} elseif ($table == "content")
-		{
-			echo "<script type='text/javascript'>document.location.href='".e_BASE."content.php?{$_POST['content_type']}.{$nid}'</script>\n";
-			exit;
-		} elseif ($table == "download")
-		{
-			echo "<script type='text/javascript'>document.location.href='".e_BASE."download.php?view.{$nid}'</script>\n";
-			exit;
-		} elseif ($table == "page")
-		{
-			echo "<script type='text/javascript'>document.location.href='".e_BASE."page.php?{$nid}'</script>\n";
-			exit;
-		}
+		$cobj->enter_comment($clean_authorname, $clean_comment, $table, $nid, $pid, $clean_subject);
+		$e107cache->clear("comment.php?{$table}.{$id}");
+	  }
+	  $redirectFlag = $nid;
+	}
+}
+
+if ($redirectFlag)
+{	// Need to go back to original page
+
+// Check plugin e_comment.php files
+  $plugin_redir = false;
+  $e_comment = $cobj->get_e_comment();
+  if ($table == $e_comment[$table]['eplug_comment_ids'])
+  {
+	$plugin_redir = TRUE;
+	$reply_location = str_replace("{NID}", $redirectFlag, $e_comment[$table]['reply_location']);
+  }
+
+  if ($plugin_redir)
+  {
+	echo "<script type='text/javascript'>document.location.href='{$reply_location}'</script>\n";
+	exit;
+  } 
+  else
+  {
+	switch ($table)
+	{
+	  case "news" :
+	  case "poll" :
+		echo "<script type='text/javascript'>document.location.href='".e_BASE."comment.php?comment.{$table}.{$redirectFlag}'</script>\n";
+		exit;
+		break;
+	  case "download" :
+		echo "<script type='text/javascript'>document.location.href='".e_BASE."download.php?view.{$redirectFlag}'</script>\n";
+		exit;
+		break;
+	  case "page" :
+		echo "<script type='text/javascript'>document.location.href='".e_BASE."page.php?{$redirectFlag}'</script>\n";
+		exit;
+		break;
 	}
+  }
 }
 
 $comment_ob_start = FALSE;
@@ -174,83 +176,70 @@
 	
 	if ($subject == "") 
 	{
-	  if ($table == "news") 
-	  {
-		if (!$sql->db_Select("news", "news_title", "news_id='{$nid}' ")) 
-		{
-		  header("location: ".e_BASE."index.php");
-		  exit;
-		} 
-		else 
-		{
-		  list($news['news_title']) = $sql->db_Fetch();
-		  $subject = $news['news_title'];
-		  $title = COMLAN_100;
-		}
-	  } 
-	  elseif ($table == "poll") 
+	  switch ($table)
 	  {
-			if (!$sql->db_Select("polls", "poll_title", "poll_id='{$nid}' ")) {
-				header("location:".e_BASE."index.php");
-				exit;
-			} else {
-				list($poll['poll_title']) = $sql->db_Fetch();
-				$subject = $poll['poll_title'];
-				$title = COMLAN_101;
-			}
-	  } 
-	  elseif ($table == "content") 
-	  {
-			$sql->db_Select("content", "content_heading", "content_id='{$nid}'");
-			$subject = $content['content_heading'];
-	  } 
-	  elseif ($table == "bugtracker") 
-	  {
-			$sql->db_Select("bugtrack", "bugtrack_summary", "bugtrack_id='{$nid}'");
-			$subject = $content['content_heading'];
+		case "news" :
+		  if (!$sql->db_Select("news", "news_title", "news_id='{$nid}' ")) 
+		  {
+			header("location: ".e_BASE."index.php");
+			exit;
+		  } 
+		  else 
+		  {
+			list($news['news_title']) = $sql->db_Fetch();
+			$subject = $news['news_title'];
+			$title = COMLAN_100;
+		  }
+		case "poll" :
+		  if (!$sql->db_Select("polls", "poll_title", "poll_id='{$nid}' ")) 
+		  {
+			header("location:".e_BASE."index.php");
+			exit;
+		  } 
+		  else 
+		  {
+			list($poll['poll_title']) = $sql->db_Fetch();
+			$subject = $poll['poll_title'];
+			$title = COMLAN_101;
+		  }
+		  break;
+		case 'download' :
+		  if ($sql->db_Select('download','download_name',"download_id={$nid} "))
+		  {
+			$row = $sql->db_Fetch();
+			$subject = $row['download_name'];
+			$title = COMLAN_106;
+		  }
+		  else
+		  {
+			header("location:".e_BASE."index.php");
+			exit;
+		  }
+		  break;
 	  }
 	}
-
-	if ($table == "content") 
-	{
-		$sql->db_Select("content", "content_type", "content_id='{$nid}'");
-		list($content['content_type']) = $sql->db_Fetch();
-		if ($content['content_type'] == "0") {
-			$content_type = "article";
-			$title = COMLAN_103;
-		} elseif ($content['content_type'] == "3") {
-			$content_type = "review";
-			$title = COMLAN_104;
-		} elseif ($content['content_type'] == "1") {
-			$content_type = "content";
-			$title = COMLAN_105;
-		}
-	}
-
 	define('e_PAGETITLE', $title." / ".COMLAN_99." / ".COMLAN_102.$subject."");
 	require_once(HEADERF);
 } 
 else 
-{
+{  //  Default code if not reply
+
+	// Check cache
 	if ($cache = $e107cache->retrieve("comment.php?{$table}.{$id}")) 
 	{
-		require_once(HEADERF);
-		echo $cache;
-		require_once(FOOTERF);
-		exit;
+	  require_once(HEADERF);
+	  echo $cache;
+	  require_once(FOOTERF);
+	  exit;
 	} 
 	else 
 	{
-		if ($table == "news") 
-		{
-			/*
-			changes by jalist 19/01/05:
-			updated db query removed one call
-			*/
-
-			if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled']) 
-			{
-				$query = "SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+	  switch ($table)
+	  {
+		case "news" :
+		  if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled']) 
+		  {
+			$query = "SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
 				LEFT JOIN #user AS u ON n.news_author = u.user_id
 				LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
 				LEFT JOIN #trackback AS tb ON tb.trackback_pid  = n.news_id
@@ -258,76 +247,116 @@
 				AND n.news_id={$id}
 				AND n.news_allow_comments=0
 				GROUP by n.news_id";
-			} 
-			else 
-			{
-				$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+		  } 
+		  else 
+		  {
+			$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
 				LEFT JOIN #user AS u ON n.news_author = u.user_id
 				LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
 				WHERE n.news_class REGEXP '".e_CLASS_REGEXP."'
 				AND n.news_id={$id}
 				AND n.news_allow_comments=0";
-			}
+		  }
 
-			if (!$sql->db_Select_gen($query)) 
-			{
-				header("location:".e_BASE."index.php");
-				exit;
-			} 
-			else 
+		  if (!$sql->db_Select_gen($query)) 
+		  {
+			header("location:".e_BASE."index.php");
+			exit;
+		  } 
+		  else 
+		  {
+			$news = $sql->db_Fetch();
+			$subject = $tp->toForm($news['news_title']);
+			define("e_PAGETITLE", COMLAN_100." / ".COMLAN_99." / {$subject}");
+			require_once(HEADERF);
+			ob_start();
+			$comment_ob_start = TRUE;
+			$ix = new news;
+			$ix->render_newsitem($news, "extend"); // extend so that news-title-only news text is displayed in full when viewing comments.
+			$field = $news['news_id'];
+		  }
+		  break;
+		case "poll" :
+		  if (!$sql->db_Select("polls", "*", "poll_id='{$id}'")) 
+		  {
+			header("location:".e_BASE."index.php");
+			exit;
+		  } 
+		  else 
+		  {
+			$row = $sql->db_Fetch();
+			$comments_poll = $row['poll_comment'];
+			$subject = $row['poll_title'];
+			define("e_PAGETITLE", COMLAN_101." / ".COMLAN_99." / ".$subject."");
+			$poll_to_show = $id;				// Need to pass poll number through to display routine
+			require_once(HEADERF);
+			require(e_PLUGIN."poll/poll_menu.php");
+			$field = $row['poll_id'];
+			if(!$comments_poll)
 			{
-				$news = $sql->db_Fetch();
-				$subject = $tp->toForm($news['news_title']);
-				define("e_PAGETITLE", COMLAN_100." / ".COMLAN_99." / {$subject}");
-				require_once(HEADERF);
-				ob_start();
-				$comment_ob_start = TRUE;
-				$ix = new news;
-				$ix->render_newsitem($news, "extend"); // extend so that news-title-only news text is displayed in full when viewing comments.
-				$field = $news['news_id'];
-				$comtype = 0;
+			  require_once(FOOTERF);
+			  exit;
 			}
-		}
-		else if($table == "poll") 
-		{
-			if (!$sql->db_Select("polls", "*", "poll_id='{$id}'")) 
+		  }
+		  break;
+		case 'download' :
+		  if ($sql->db_Select('download','download_name',"download_id={$id} "))
+		  {
+			$row = $sql->db_Fetch();
+			$subject = $row['download_name'];
+			$title = COMLAN_106;
+			$field = $id;
+			require_once(HEADERF);
+		  }
+		  else
+		  {
+			header("location:".e_BASE."index.php");
+			exit;
+		  }
+		  break;
+		default :		// Hope its a plugin table
+		  $e_comment = $cobj->get_e_comment();
+		  if ($table == $e_comment[$table]['eplug_comment_ids'])
+		  {
+			if ($sql->db_Select($table,$e_comment[$table]['db_title'],$e_comment[$table]['db_id']."={$id} "))
 			{
-				header("location:".e_BASE."index.php");
-				exit;
-			} 
-			else 
+			  $row = $sql->db_Fetch();
+			  $subject = $row[$e_comment[$table]['db_title']];
+			  $title = $e_comment[$table]['plugin_name'];
+			  $field = $id;
+			  require_once(HEADERF);
+			}
+			else
 			{
-				$row = $sql->db_Fetch();
-				$comments_poll = $row['poll_comment'];
-				$subject = $row['poll_title'];
-				define("e_PAGETITLE", COMLAN_101." / ".COMLAN_99." / ".$subject."");
-				require_once(HEADERF);
-				require(e_PLUGIN."poll/poll_menu.php");
-				$field = $row['poll_id'];
-				$comtype = 4;
-
-				if(!$comments_poll)
-				{
-					require_once(FOOTERF);
-					exit;
-				}
+			  header("location:".e_BASE."index.php");
+			  exit;
 			}
-		}
-		require_once(HEADERF);
+		  }
+		  else
+		  {	// Error - emit some debug code
+			require_once(HEADERF);
+			echo "Comment error: {$table}  Field: {$e_comment['db_id']}  ID {$id}   Title: {$e_comment['db_title']}<br />";
+			echo "<pre>";
+			var_dump($e_comment);
+			echo "</pre>"; 
+		  }
+	  }
 	}
 }
 
 if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news")
 {
-	echo "<span class='smalltext'><b>".$pref['trackbackString']."</b> ".$e107->http_path.e_PLUGIN."trackback/trackback.php?pid={$id}</span>";
+  echo "<span class='smalltext'><b>".$pref['trackbackString']."</b> ".$e107->http_path.e_PLUGIN."trackback/trackback.php?pid={$id}</span>";
 }
-$field = ($field ? $field : ($id ? $id : ""));
+
+$field = ($field ? $field : ($id ? $id : ""));			// ID of associated source item
 $width = (isset($width) && $width ? $width : "");
 $cobj->compose_comment($table, $action, $field, $width, $subject, $rate=FALSE);
 
 
 
-if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news"){
+if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news")
+{
 	if($sql->db_Select("trackback", "*", "trackback_pid={$id}"))
 	{
 		$tbArray = $sql -> db_getList();
diff -x .svn -aruN 0.7.11.src/contact.php 0.7.12.src/contact.php
--- 0.7.11.src/contact.php	2007-09-06 02:25:25.000000000 -0500
+++ 0.7.12.src/contact.php	2008-06-27 16:22:19.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/contact.php,v $
-|     $Revision: 1.13 $
-|     $Date: 2007/09/06 07:25:25 $
-|     $Author: e107coders $
+|     $Revision: 1.14 $
+|     $Date: 2008/06/27 21:22:19 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("class2.php");
@@ -90,7 +90,7 @@
     if(!$error)
 	{
 		$body .= "\n\nIP:\t".USERIP."\n";
-		if(USERID !== FALSE)
+		if(USER)
 		{
 			$body .= "User:\t#".USERID." ".USERNAME."\n";
 		}
diff -x .svn -aruN 0.7.11.src/download.php 0.7.12.src/download.php
--- 0.7.11.src/download.php	2007-11-21 16:52:26.000000000 -0600
+++ 0.7.12.src/download.php	2008-08-04 15:31:30.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/download.php,v $
-|     $Revision: 1.94 $ 
-|     $Date: 2007/11/21 22:52:26 $
+|     $Revision: 1.96 $ 
+|     $Date: 2008/08/04 20:31:30 $
 |     $Author: e107steved $
 |
 +----------------------------------------------------------------------------+
@@ -55,6 +55,9 @@
   }
 ';
 
+$order_options = array('download_id','download_datestamp','download_requested','download_name','download_author');
+$sort_options = array('ASC', 'DESC');
+
 
 if (!e_QUERY || $_GET['elan'])
 {
@@ -83,7 +86,12 @@
   switch ($action)
   {
     case 'list' :	// Category-based listing
-	  if (isset($_POST['view'])) extract($_POST);
+	  if (isset($_POST['view'])) 
+	  {
+		$view = intval($_POST['view']);
+		$sort = varset($_POST['sort'],'DESC');
+		$order = varset($_POST['order'],'download_datestamp');
+	  }
 	  if (!isset($dl_from)) $dl_from = 0;
 
 	  // Get category type, page title
@@ -135,6 +143,9 @@
   }
 }
 
+if (isset($order) && !in_array($order,$order_options)) unset($order);
+if (isset($sort)  && !in_array($sort,$sort_options)) unset($sort);
+
 if (!isset($order))	$order = varset($pref['download_order'],"download_datestamp");
 if (!isset($sort))	$sort =  varset($pref['download_sort'], "DESC");
 if (!isset($view))	$view =  varset($pref['download_view'], "10");
@@ -399,6 +410,8 @@
 
 	$dl = $sql -> db_Fetch();
 
+$comment_edit_query = 'comment.download.'.$id;
+
 	$load_template = 'download_template';
 	if (!isset($DOWNLOAD_VIEW_TABLE)) eval($template_load_core);
 	if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:0px");}
@@ -547,8 +560,10 @@
 		extract($row);
 		$array = explode(chr(1), $download_mirror);
 
-		$c = (count($array)-1);
-		for ($i=1; $i<$c; $i++) {
+		// Shuffle the mirror list into a random order
+		$c = count($array) -1;		// Will always be an empty entry at the end
+		for ($i=1; $i<$c; $i++) 
+		{
 			$d = mt_rand(0, $i);
 			$tmp = $array[$i];
 			$array[$i] = $array[$d];
diff -x .svn -aruN 0.7.11.src/e107_admin/admin.php 0.7.12.src/e107_admin/admin.php
--- 0.7.11.src/e107_admin/admin.php	2007-06-11 14:27:34.000000000 -0500
+++ 0.7.12.src/e107_admin/admin.php	2008-07-18 14:50:52.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/admin.php,v $
-|     $Revision: 1.40 $
-|     $Date: 2007/06/11 19:27:34 $
-|     $Author: e107steved $
+|     $Revision: 1.41 $
+|     $Date: 2008/07/18 19:50:52 $
+|     $Author: e107coders $
 +----------------------------------------------------------------------------+
 */
 require_once('../class2.php');
@@ -183,12 +183,12 @@
 					onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">".$icon." ".$tp->toHTML($title,FALSE,"defs,emotes_off")."</td>";
 			}
 			else if ($mode == 'classis') {
-				$text .= "<td style='text-align:center; vertical-align:top; width:20%'><a href='".$link."' title='$description'>".$icon."</a><br />
-					<a href='".$link."' title='$description'><b>".$tp->toHTML($title,FALSE,"defs,emotes_off")."</b></a><br /><br /></td>";
+				$text .= "<td style='text-align:center; vertical-align:top; width:20%'><a href='".$link."' title=\"".$description."\">".$icon."</a><br />
+					<a href='".$link."' title=\"".$description."\"><b>".$tp->toHTML($title,FALSE,"defs,emotes_off")."</b></a><br /><br /></td>";
 			}elseif ($mode == 'beginner'){
                 $text .= "<td style='text-align:center; vertical-align:top; width:20%' ><a href='".$link."' >".$icon."</a>
 					<div style='padding:5px'>
-					<a href='".$link."' title='".$description."' style='text-decoration:none'><b>".$tp->toHTML($title,FALSE,"defs,emotes_off")."</b></a></div><br /><br /><br /></td>";
+					<a href='".$link."' title=\"".$description."\" style='text-decoration:none'><b>".$tp->toHTML($title,FALSE,"defs,emotes_off")."</b></a></div><br /><br /><br /></td>";
 			}
 			$td++;
 		}
diff -x .svn -aruN 0.7.11.src/e107_admin/administrator.php 0.7.12.src/e107_admin/administrator.php
--- 0.7.11.src/e107_admin/administrator.php	2007-10-05 00:31:14.000000000 -0500
+++ 0.7.12.src/e107_admin/administrator.php	2008-06-27 15:16:11.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/administrator.php,v $
-|     $Revision: 1.34 $
-|     $Date: 2007/10/05 05:31:14 $
-|     $Author: e107coders $
+|     $Revision: 1.36 $
+|     $Date: 2008/06/27 20:16:11 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once('../class2.php');
@@ -197,10 +197,10 @@
 	$text .= checkb("W", $a_perms).ADMSLAN_65."<br /><br />";	// Configure mail settings and mailout
 
 	$text .= checkb("D", $a_perms).ADMSLAN_29."<br />";			// Manage banners
-	$text .= checkb("E", $a_perms).ADMSLAN_30."<br />";			// Configure news feed headlines
+//	$text .= checkb("E", $a_perms).ADMSLAN_30."<br />";			// Configure news feed headlines - now plugin
 	$text .= checkb("F", $a_perms).ADMSLAN_31."<br />";			// Configure emoticons
 	$text .= checkb("G", $a_perms).ADMSLAN_32."<br />";			// Configure front page content
-	$text .= checkb("S", $a_perms).ADMSLAN_33."<br />";			// Configure log/stats
+//	$text .= checkb("S", $a_perms).ADMSLAN_33."<br />";			// Configure log/stats - now plugin (used for system logs in 0.8)
 	$text .= checkb("T", $a_perms).ADMSLAN_34."<br />";			// Configure meta tags
 	$text .= checkb("V", $a_perms).ADMSLAN_35."<br />";			// Configure public file uploads
 	$text .= checkb("X", $a_perms).ADMSLAN_66."<br />";			// Configure Search
@@ -222,7 +222,7 @@
 	$sql->db_Select("plugin", "*", "plugin_installflag='1'");
 	while ($row = $sql->db_Fetch())
 	{
-		$text .= checkb("P".$row['plugin_id'], $a_perms).LAN_PLUGIN." - ".$row['plugin_name']."<br />";
+		$text .= checkb("P".$row['plugin_id'], $a_perms).LAN_PLUGIN." - ".$tp->toHTML($row['plugin_name'],FALSE,'RAWTEXT,defs')."<br />";
 	}
 
 // Language Rights.. --------------
diff -x .svn -aruN 0.7.11.src/e107_admin/auth.php 0.7.12.src/e107_admin/auth.php
--- 0.7.11.src/e107_admin/auth.php	2007-08-15 19:00:26.000000000 -0500
+++ 0.7.12.src/e107_admin/auth.php	2008-07-17 16:53:44.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/auth.php,v $
-|     $Revision: 1.15 $
-|     $Date: 2007/08/16 00:00:26 $
-|     $Author: e107coders $
+|     $Revision: 1.16 $
+|     $Date: 2008/07/17 21:53:44 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -117,7 +117,7 @@
             <tr>
             <td style='width:35%' class='forumheader3'>".ADLAN_152."</td>
             <td style='text-align:center'>
-            <input type='hidden' name='rand_num' value='".$sec_img->random_number."'>".
+            <input type='hidden' name='rand_num' value='".$sec_img->random_number."' />".
             $sec_img->r_image().
             "<br /><input class='tbox' type='text' name='code_verify' size='15' maxlength='20' /></td>
             </tr>
diff -x .svn -aruN 0.7.11.src/e107_admin/banner.php 0.7.12.src/e107_admin/banner.php
--- 0.7.11.src/e107_admin/banner.php	2007-10-30 17:47:04.000000000 -0500
+++ 0.7.12.src/e107_admin/banner.php	2008-07-20 13:05:49.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/banner.php,v $
-|     $Revision: 1.30 $
-|     $Date: 2007/10/30 22:47:04 $
+|     $Revision: 1.32 $
+|     $Date: 2008/07/20 18:05:49 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -365,7 +365,7 @@
 		}
 
 		if ($fileext1 == swf) {
-			$text .= " /> <br><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='468' height='60'>
+			$text .= " /> <br /><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='468' height='60'>
 				<param name='movie' value='".e_IMAGE."banners/".$images[$c]['fname']."'>
 				<param name='quality' value='high'><param name='SCALE' value='noborder'>
 				<embed src='".e_IMAGE."banners/".$images[$c]['fname']."' width='468' height='60' scale='noborder' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed></object>
@@ -451,6 +451,8 @@
 
 if ($action == "menu")
 {
+  $in_catname = array();		// Notice removal
+  $out_catname = array();
 
 	$array_cat_in = explode("|", $menu_pref['banner_campaign']);
 	if (!$menu_pref['banner_caption'])
@@ -493,7 +495,7 @@
 
 	foreach($out_catname as $name)
 	{
-		$text .= "<option value='$name'>$name</option>\n";
+		$text .= "<option value='{$name}'>{$name}</option>\n";
 	}
 
 	$text .= "</select>
@@ -504,7 +506,7 @@
 	$catidvalues = "";
 	foreach($in_catname as $name)
 	{
-		$text .= "<option value='$name'>$name</option>\n";
+		$text .= "<option value='{$name}'>{$name}</option>\n";
 		$catidvalues .= $name."-";
 	}
 
diff -x .svn -aruN 0.7.11.src/e107_admin/core_image.php 0.7.12.src/e107_admin/core_image.php
--- 0.7.11.src/e107_admin/core_image.php	2008-01-01 09:50:31.000000000 -0600
+++ 0.7.12.src/e107_admin/core_image.php	2008-08-25 18:41:14.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/core_image.php,v $
-|     $Revision: 1.48 $
-|     $Date: 2008/01/01 15:50:31 $
+|     $Revision: 1.49 $
+|     $Date: 2008/08/25 23:41:14 $
 |     $Author: mcfly_e107 $
 +----------------------------------------------------------------------------+
 */
@@ -42,17 +42,17 @@
       'extended_country.php' => '9d6cf4a6e013a60c58d4687076bd187e',
     ),
     'ad_links.php' => 'bc9520a672754b6b283f734f9cbca86c',
-    'admin.php' => '0aa618a93b1e78e0887cc1ec82de36eb',
+    'admin.php' => '4302912d9f523e63f65f2b81bec237da',
     'admin_classis.php' => 'ed861d18477db9ce0bc3620a69443723',
     'admin_combo.php' => '8958300a2a42fd2aa68977d566c1edb9',
     'admin_etalkers.php' => '9d684ef56c54bbf919e3346927cf4509',
     'admin_log.php' => '4ee20cbf87c1a2dbabb7d75631146736',
     'adminb.php' => '1e31b2ad3907c7cba29dca04342cee1d',
-    'administrator.php' => '84ec839970d100c68448de2b63ba552e',
+    'administrator.php' => '196c98e43136789512b1436b881921b5',
     'article.php' => '7b21dc8ef4bc68ceb9ecf4d1c519a645',
-    'auth.php' => '0489d40c8305057ac8c2ff8cc74603c6',
+    'auth.php' => 'ff049badda2e090168f61849a496e4bb',
     'banlist.php' => '6ff4252414f390d5080d778e59198a12',
-    'banner.php' => 'bb6d203021939774c49c9788a2e7f62a',
+    'banner.php' => '0b9f1a9510a6cd82c0fc89819ee68dca',
     'cache.php' => '62fc17d1f4c6db977c66642c5a76127a',
     'cascade.php' => '3d70a650778f09e6c85efd91b6ab5e4a',
     'categories.php' => 'cbbed37d26ab602700d46a0cb1955205',
@@ -61,37 +61,37 @@
     'comment.php' => '96f04e71003de6b6a6ea3a0f2ede285d',
     'compact.php' => '20bccea2ef81cc86a86782fa4841e45f',
     'content.php' => 'bf2239404990afed185913002429e682',
-    'core_image.php' => 'e392369f7fa5962e9b233e76f1d8b37e',
-    'cpage.php' => '8b80b073be56d598ab8f443d3ef690e7',
-    'credits.php' => 'b4f6bcab2c92096560e768538abf46f1',
+    'core_image.php' => '1e24d83e0779ad02d8d854bd75a24303',
+    'cpage.php' => '249109943f5bb394b70065596e556ff5',
+    'credits.php' => '273cb301d908936a58a8d38b4e92ba5a',
     'db.php' => '74e4d75fbafe9a8493fbba384ae6f97f',
     'db_verify.php' => '0699ccfd73686113023ee99cf406e6ce',
     'docs.php' => 'e5ebdd8fd30362636cfe1a3878b3fb18',
-    'download.php' => '399896dc9d2e26630684b0aaad4469de',
+    'download.php' => 'c78709b384c8ea21798dea81a72a7e92',
     'e107_update.php' => 'c23624862e7dc50fab29aa1890c7872a',
     'emoticon.php' => '9403ce6e8c4dc4ab34d32b3d74a1d699',
     'fileinspector.php' => 'e1d831bfb0ca6a9244a4ced5b0d85fc3',
-    'filemanager.php' => '413763a3c6aac1f79fcb3f9e737bce27',
+    'filemanager.php' => '7b05edc097aa543f1a29941600134ed3',
     'filetypes_.php' => 'f951037335e993337792606cc1475cec',
     'fla.php' => 'c44c289dcdbe2bcf53305103275ce899',
-    'footer.php' => '920ba235b135867f519bcb91a84d7dcb',
-    'frontpage.php' => 'c61f2a921f92152fc504fdfe01eed44a',
-    'header.php' => '75bff92e3637acfdf7721b7cf6bfc528',
+    'footer.php' => '1195647fdeaa996c43c3e58bf9bb86cc',
+    'frontpage.php' => '18cdca6033109f4609ce69cf8f0dafb6',
+    'header.php' => '24eed26f8a60cafaefe629d9928472aa',
     'image.php' => '4aa59015397245198d883c6a66d3ae41',
     'index.php' => 'e4e143ee2d34d4ce1f17b3f043cc6cd6',
-    'lancheck.php' => 'f5d4236d741882e9e67767ca27d5e186',
-    'language.php' => '4c98b96069996d7a98830b8e44a04592',
-    'links.php' => 'b56bca703d01637c39e2d811d6ceb796',
-    'mailout.php' => '12834d6d1c8adfb001b9670faae7c8c0',
+    'lancheck.php' => '486475f13c553f7337ca5242f7aa27fd',
+    'language.php' => 'ebae973cbea51afd9c5a9cc62d39f95a',
+    'links.php' => '5201430aa2d47e2b0ba0b59bbb1bfe31',
+    'mailout.php' => '3d2a68cb77ceac276bc493dc6d297cca',
     'menus.php' => '816ba85a06f966b9bbc59c53d31c1bc6',
     'message.php' => 'a598b5e493298500d81b815f1455280b',
     'meta.php' => 'bf6ed9bf9d938f9618fb1c4e53632323',
     'modcomment.php' => '623f402310e3c19651b92fc071cd6e42',
-    'newspost.php' => 'e24dcfb893be1a994942c6f5a7d74b07',
-    'notify.php' => 'a988fd7416b4595e72975b22ccc6362b',
+    'newspost.php' => '1bbc94250137d4bb23dc529e7a3718c6',
+    'notify.php' => 'ddd3d41f0c25db4528c9100c664f8e98',
     'phpinfo.php' => '994ea857810fe5f47ac8612f570aadb1',
-    'plugin.php' => 'a46b431f57fbe4cc2c17ccd46d676c69',
-    'prefs.php' => '2912441ff848a15cfb7c4e9612bf8cbe',
+    'plugin.php' => '1132f33453629797febe9dd575a6b55a',
+    'prefs.php' => '18ab0fc931048f841a3dd8018a04293d',
     'review.php' => '1919d31943803a66cb2d12828bd92db2',
     'search.php' => 'b1239e5af6795205648d8965ec3a1ec9',
     'theme.php' => 'b05f7265501a3e1c5e7c47cb3f891831',
@@ -99,13 +99,13 @@
     'update_routines.php' => '698d8846651f790d25d6fac3d620992c',
     'updateadmin.php' => '770fff43134883ea4d502498b28d70d2',
     'upload.php' => '26cedc21eaee3f3719e7a8aa591de10c',
-    'userclass.php' => 'b7fd96c785b6f3eead88fd5acd5760ad',
-    'userclass2.php' => 'e6feec2b3767627cd6dfbdab15bfe681',
+    'userclass.php' => 'cbc4006fb0664fca537a910d2f54d59c',
+    'userclass2.php' => 'cdf66f5a605f42b7ca51d63a1102f7b4',
     'userinfo.php' => 'fcbb4c620a0a9ed430588ee7539fb2d7',
-    'users.php' => 'df9ed7837559fb17f80f541898b2a292',
-    'users_extended.php' => '9ebda71ed00ed212b96f07ff0e4ebf2e',
+    'users.php' => '79deb7b129bf8aeab58ab688184f1c8f',
+    'users_extended.php' => '1d7db886d11bdff41a33cf222ee291bb',
     'users_extended_predefined.php' => '51128e45b6620f7b6ead6fbd8521b43e',
-    'ver.php' => 'ca06dc320c478688a436224deb8a2c27',
+    'ver.php' => 'd36c6b0018a3afba3a3cdd203bf91b33',
     'wmessage.php' => '17afb0f8ef07cfd675cd92e9f7e606a3',
   ),
   $coredir['docs'] => 
@@ -159,11 +159,11 @@
       'hide.bb' => 'cf30f78c78855565b0bf868a01142fb8',
       'html.bb' => '9938499c3ef8c80a2598b9c3aed7e371',
       'i.bb' => 'ec842cfda8a6f33d53f8232763b56719',
-      'img.bb' => 'deb454995839ad49939500d5d93d718b',
+      'img.bb' => '47f67bd6067a9b5ba0d732068ee6453c',
       'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
       'justify.bb' => '016500f910beb0f820dd58c4915f2489',
       'left.bb' => '990ddba32b14bea648745cc373035bde',
-      'link.bb' => 'f845e7f940da691975fee559ebfc775b',
+      'link.bb' => '15b39b3c32f239b7a896ae3ff1f95133',
       'list.bb' => 'b8a3e5c98d6ebc1f1ca1a122bd7ced0e',
       'php.bb' => 'e4ec86c0947ef2544f19d260c05d74ac',
       'quote.bb' => '12bfbba32661e309a33972e388b0e912',
@@ -206,9 +206,9 @@
       'import_mapper.php' => '78a98bfedbe66b043e8562bcd6449125',
       'import_readme.txt' => 'a76f8a52208d648e1c9e3afe71929755',
       'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
-      'mambo.php' => '650c4fa28067b0d8b71d371f130db894',
-      'phpbb2.php' => '80bdbe33731a881d122d68003096c4ad',
-      'phpnuke.php' => '732653b3f39cf02364be2dcb0f065f3a',
+      'mambo.php' => '60c61122c4984adbd94c2be0062c2a29',
+      'phpbb2.php' => '6dc2cdde92fa97a27d1f5def8c380501',
+      'phpnuke.php' => '35203270b9de7506f63b011ac85ab905',
     ),
     'misc' => 
     array (
@@ -233,16 +233,16 @@
     array (
       'batch' => 
       array (
-        'bbcode_shortcodes.php' => '284b0c6a768247d73db4a1ab90a0fd8c',
-        'comment_shortcodes.php' => '454799a0dbcdb22ef8b68855563afe23',
+        'bbcode_shortcodes.php' => '979de9d7330c0e547d952f1c547d76e1',
+        'comment_shortcodes.php' => '97e52cf2411985c27833bbe5010b9e94',
         'contact_shortcodes.php' => 'd593f9dadff312c61eb27e32457d7f95',
-        'download_shortcodes.php' => '32538901c6422a55ffd8e0f14083ce7c',
+        'download_shortcodes.php' => '7dd3e10bd9d2a2c4f44ce19acc366911',
         'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
         'news_archives.php' => '1115fe90b0de9f170fce31c94680dabf',
-        'news_shortcodes.php' => 'df540d57991039798244a506754735ee',
+        'news_shortcodes.php' => 'c1741e24763f64883faa1730e55b115b',
         'signup_shortcodes.php' => 'fbaad5179aa055dcd04f5bfdc6614782',
         'sitedown_shortcodes.php' => '3ae9199cbae645d23869d517a5f6cef4',
-        'user_shortcodes.php' => '314d01ff5be91f80629db329b2b61d4a',
+        'user_shortcodes.php' => 'a3b47064debd03115dfb95cb82927438',
         'usersettings_shortcodes.php' => '21d6fd90f2efd6e7229fcf37d6ec689e',
       ),
       'admin_alt_nav.sc' => '412e8fb7acac7746ea48b17854decfc4',
@@ -268,7 +268,7 @@
       'admin_userlan.sc' => 'cbaf3dda959b6a36f6b3f4cf0a6f7536',
       'banner.sc' => 'b5d2407d670146f95bb3c36edc2ca42d',
       'breadcrumb.sc' => '0591ee7dc26ded7ac9a359dea4b8fdf6',
-      'custom.sc' => 'cf3f40d5afdff518cb98bfab464ca170',
+      'custom.sc' => 'ea36528652b9aa0bff9bef4e6658c139',
       'e_image.sc' => '3819fdf5b9dfc7b189fb4073d33ae0d5',
       'email.sc' => 'e363b6b54037a8c80b373b76994c8db9',
       'email_item.sc' => 'a23b3abbb722bbf5bc58be9d23906583',
@@ -282,7 +282,7 @@
       'languagelinks.sc' => '9a233913b41de783edaa68c46abadf65',
       'linkstyle.sc' => '5ed64d972bc892a798f80179878f1266',
       'logo.sc' => '7989dac8bea9ec4c0da489fb942ae507',
-      'menu.sc' => 'cb91e43756bf3ab6e2dd7d5e1241fec2',
+      'menu.sc' => 'b327142ca67222cde1a7c3a4f9e142ac',
       'news_alt.sc' => '25596ffed2cf4bed831b80397c77e295',
       'news_categories.sc' => 'b2ae6f1ca052c9e858d4c2c860e8a5bf',
       'news_category.sc' => '25596ffed2cf4bed831b80397c77e295',
@@ -306,12 +306,12 @@
       'theme_disclaimer.sc' => '606d98f47c1a64b179d9baf6e6930dbc',
       'uploadfile.sc' => '85ea5b2a10cde7c2267a40c359694aed',
       'user_avatar.sc' => '1501550f2414900d47edee2621b2e624',
-      'user_extended.sc' => '2b22b0b1c7b64321973b5d6589e94958',
+      'user_extended.sc' => '6f88944ae59ef9b56ad31632e70ddd69',
       'wmessage.sc' => 'c24f80349ceafd36f6cf0d6ec6875fa7',
     ),
-    'def_e107_prefs.php' => 'fab29e04144174fe0689010680cedab0',
+    'def_e107_prefs.php' => '60132274af17ba102249ef9e8be76f69',
     'e107.css' => 'e5cfa4047831f19def7df032ef8bc830',
-    'e107.js' => 'd4eb3815432359319aaa37608815f85f',
+    'e107.js' => 'f0dd03e4e44db72d75af81d8a42a7acb',
     'e_ajax.js' => 'b583773e72852158e27af8a9bba7c97f',
     'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
     'nav_menu.css' => '58ca165986f7428fb05e8b7b82c2ee13',
@@ -371,7 +371,7 @@
       'search_download.php' => 'ad2776a005adc703798e0f543d36bd92',
       'search_event.php' => '17c68ea4f5728e87e7009b96b978006c',
       'search_news.php' => 'bc0321e07ae69c925ac83a72ae67c136',
-      'search_pages.php' => 'd88764c2463c3a9a3776252ae0642d88',
+      'search_pages.php' => '8d64a81740abb06374191891604f63aa',
       'search_user.php' => '09d6c3a85872a9b894d1afccf94bf31d',
     ),
     'tiny_mce' => 
@@ -650,33 +650,33 @@
       'tiny_mce_gzip.php' => '846511eed428312feca1f0e5fec6cd91',
       'tiny_mce_popup.js' => '0a5ce4187f9d2f58e36302d7d40bf3d2',
       'tiny_mce_src.js' => '1a99b9dcd773d76df1fee42e072cb1a4',
-      'wysiwyg.php' => '031aadf6f50c2ff354bd2ec4c1425e9c',
+      'wysiwyg.php' => '4f59c0626c7e2030b7c5bdd7004d8cc3',
     ),
     'admin_handler.php' => '2d593943e40bf02d5d46cf6b6af6b7e7',
-    'admin_log_class.php' => 'df69d03d7e9b3c28ad48573aa7ce50bf',
+    'admin_log_class.php' => '3cc96f21bcc7399e29c2b75d17fb2171',
     'arraystorage_class.php' => '4862b38926c8f68029c95d31990435a4',
     'avatar_handler.php' => '54c9f790d9f17e30f52b8011633d486c',
     'bbcode_handler.php' => '53fae188dcfbc9496927fa4389d90ecc',
     'cache_handler.php' => '87bea235aa6d8e55f1268675b237ae43',
-    'comment_class.php' => '7e95510be7b981212bee432920de0034',
+    'comment_class.php' => 'fbfcc149d8af410b26d4e14626b7923d',
     'date_handler.php' => 'dc0f62d02024e515f5db56230882676f',
-    'db_debug_class.php' => '3ca3cd41bb506223eccad1601194bcaf',
+    'db_debug_class.php' => 'c8536fce0bc77a01d9a97fef8327855b',
     'debug_handler.php' => '9fa1acc69ef4cfc2593345c3866841d3',
     'e107_Compat_handler.php' => 'e76211b3178e4a9724933ecfe85ba8ea',
-    'e107_class.php' => 'f23c42b45c8dd2730f0b1823030c7cbd',
-    'e_parse_class.php' => '23862dc8a96578af4487dcb619fc9c86',
+    'e107_class.php' => 'de0052a652261489b4b9609b3b70af6c',
+    'e_parse_class.php' => '445c3f15becfd23579ca9289963010eb',
     'emailprint_class.php' => 'c7de0da4205693ddb952e9723a7fc226',
     'emote.php' => 'bbda3eafde2bb54c645194bf72dd47e3',
     'emote_filter.php' => '6348bb4a8adf203fccc2b5ecf4bff378',
     'encrypt_handler.php' => 'de4230eb5dc1541306a43f83b6a04671',
     'event_class.php' => 'd14906b7576984e7d9467c097e285b65',
     'file_class.php' => 'f193a200c2717c932e3dd1ae7d378fcb',
-    'form_handler.php' => 'f2776c53505b3d942cd916df0bb44fe1',
+    'form_handler.php' => 'f019b82d549e9cc7669af536abce4145',
     'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
-    'language_class.php' => '09b1ed80a0e4a23b5cad01b6600d7a8b',
+    'language_class.php' => 'c9486b41066040a84dbbe5c221f67b79',
     'level_handler.php' => '8ad6a092a84bef9c29912699b4a6263c',
-    'login.php' => 'c8e1c2e6722129eeb73deb4baadbb5e2',
-    'magpie_rss.php' => '1297fc8132b5ec0a2c04436b38ec6aee',
+    'login.php' => '86cb41838f6e7a2afbcafefa7e7684d3',
+    'magpie_rss.php' => 'a04efb623cda4635cf46d9fe7c327d44',
     'mail.php' => '248bc747f9b99bd66acc3442b5c8d926',
     'mail_validation_class.php' => '75e722bf8c6975349ec402682323314e',
     'message_handler.php' => 'b6adb65802a3b790d7f8d0735a72364b',
@@ -705,17 +705,17 @@
     'secure_img_handler.php' => '2cf9d9bb7616a5cc9d04d782a7bf8611',
     'secure_img_render.php' => '7364c99eec3f7881b7e4c0a10fc75cdf',
     'session_handler.php' => '54f987aa4f0f2a31c646d9e0f81cd061',
-    'shortcode_handler.php' => '28d1ae2afb2413189019407aac4cc61d',
-    'sitelinks_class.php' => '583a8a2d52581ce17a3765b1e75230aa',
+    'shortcode_handler.php' => '845393c5dd91ffd981b076a80ff31e53',
+    'sitelinks_class.php' => 'bb871c65344553d18e4f96a18e2c564e',
     'smtp.php' => '71008c80b0a5e12faef990c0560f8226',
-    'theme_handler.php' => '35399d6f406cb070f874803a1e6352a3',
+    'theme_handler.php' => '3a9a09ee4c47d1998d94ed0213b55020',
     'traffic_class.php' => 'd9939fec7c60e3c8b95111dca22ce918',
-    'traffic_class_display.php' => '4583aae09eb49619d1b302160c27b721',
-    'upload_handler.php' => '2a99ef0d03871f7d4f862c1dcc9ac036',
-    'user_extended_class.php' => 'ed8dcb0d2b05f9fc285937a0939de2ad',
+    'traffic_class_display.php' => 'ab41779353db54ab54c6317f0464bae0',
+    'upload_handler.php' => '7c0f8b9d913d54bbb9f59526dbc0a996',
+    'user_extended_class.php' => '457b2971e01c3149e2c2a59a8b42ebda',
     'user_func.php' => 'bb871abafb6c91109c809afa9514afcc',
     'user_select_class.php' => 'd0ce7bea9522abbea48869734f8953ec',
-    'userclass_class.php' => '6e64e881c71fbc7e87c2f4e9df941e9d',
+    'userclass_class.php' => 'd5af0c983c508edcfe587c7dbcf19210',
     'usersession_class.php' => 'dcd6889bc9e8a11cba08fdd13f629615',
     'xml_class.php' => 'e0ee6f1aec86b5416adc2725f35af285',
   ),
@@ -1185,7 +1185,6 @@
           'banlist.php' => 'c250d64286674097b02906f4d71aa2f7',
           'cache.php' => 'f889aa4a1889a3112699c899eb655744',
           'cpage.php' => '021075ecadbb8683c0f567e91428e112',
-          'custommenu.php' => 'bc2d5fff1395d8495a45b80da77b7665',
           'db.php' => '56210313eb216b42cedde3f548461f70',
           'download.php' => 'dcfce12aec25465d48762456414ca9db',
           'emoticon.php' => '44293ed224e20f90dc81554c1064842a',
@@ -1196,16 +1195,13 @@
           'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
           'language.php' => '514346599719d0abc2f0a947945c77c8',
           'links.php' => 'c9c06673b3d7089ac9a729e1601b82c4',
-          'list_menu_conf.php' => '88bd581ba21987493206e430885cd3f0',
           'mailout.php' => '5050871042ba40b90e0dac92c29dab0b',
           'menus.php' => '9b2d9d2e0610b55965d9b49ecd7a91c1',
-          'menus2.php' => '2249f7d8b325af8945ed1a5a3e9721e2',
           'meta.php' => '6c85ff99c2707a2d6e73ac990971ba83',
           'news_category.php' => '0c0bfcbb20aea2de7508c5cc3c4826f9',
           'newspost.php' => '13fda1563ee88b65ebd855113ec7caef',
           'notify.php' => '96e76c0244bf06754516ced2bbb6a760',
           'phpinfo.php' => '201f61e8c6ba0619083a30143af56625',
-          'poll.php' => '3adef894abf1c1920a311899071ff8ee',
           'prefs.php' => '4cc47a077677b93cdede1ca55e3b354f',
           'search.php' => 'e9b596e5e8855fe87e8905cf0dc9a6bd',
           'theme.php' => '7ac282adfbb1f04fc10a6aa07c11e7bf',
@@ -1217,13 +1213,13 @@
           'users_extended.php' => 'b73f20ff4c7d9f9b9eae883b300b2426',
           'wmessage.php' => '5aa5f420a6b29adad555ef7e55bd932f',
         ),
-        'lan_admin.php' => '80ec3744049875359cc8bef4a61944e6',
+        'lan_admin.php' => '467d023763ab448026b168c1a0a16a1c',
         'lan_admin_log.php' => '0f9dacdf93cb2d6a4145487de304cb87',
         'lan_administrator.php' => '83b1eaead32e6c500d42a74c40b059a5',
         'lan_banlist.php' => 'eab999e2192f8806d3c296a51ff7b304',
         'lan_banner.php' => '11d2439138f74b116de4697e066f7ca5',
         'lan_cache.php' => '0926abdc99274d71157280c9d58749e0',
-        'lan_cpage.php' => 'c95be0bafa672c32d75394f94bb3af02',
+        'lan_cpage.php' => '011e368a1d39d8bd1b95560289b1cb9e',
         'lan_credits.php' => 'aae0c491eb54b8c529013691755044a1',
         'lan_db.php' => '74ecf348cdf654a125c7c9fd42a3aca2',
         'lan_db_verify.php' => 'f354b3a5832e4817bcb2171b2845047d',
@@ -1241,7 +1237,7 @@
         'lan_lancheck.php' => '7615ba9c34ea6b3b5867d27e834acb54',
         'lan_language.php' => 'c5a7d84c75d2434218f2b80367cd1b78',
         'lan_links.php' => '07972ca8826ee35f36ef825ff793a991',
-        'lan_mailout.php' => 'bf59b50787dae47c9db0603ba86e169d',
+        'lan_mailout.php' => '6ca2a74cf8e5e201ff2eb8d83d9f165b',
         'lan_menus.php' => 'aff6368b11b30bea0515de7cbad89dde',
         'lan_message.php' => 'bcfd03068e0ee9d76eb1a3df969bb544',
         'lan_meta.php' => '31801b3e9c137a3b22d58e5d80d291c8',
@@ -1255,29 +1251,27 @@
         'lan_ugflag.php' => '29f0ad8c752be1bf98cc067534994711',
         'lan_updateadmin.php' => 'ae3d2be7d92db3c4dd11f1e73fafeb7b',
         'lan_upload.php' => '2343ae710abf563db9beba208370675e',
-        'lan_userclass.php' => '3eedcbd961e57434d6c64f9321fddb59',
+        'lan_userclass.php' => '4ea892222af2878ae303e6234545107c',
         'lan_userclass2.php' => 'e475c31e99b4867d9517705b584f5a44',
         'lan_userinfo.php' => '241d3c717696a30d97152aec8f5fcdf2',
-        'lan_users.php' => '411653528916798eef8867bb81eb4ed4',
-        'lan_users_extended.php' => '23c942fbd86499777f6c1b862d0cf5a9',
+        'lan_users.php' => 'cf518b91e8fcb326f76305851e4b81e0',
+        'lan_users_extended.php' => '47cde233437a8883572ecf8bedab59bb',
         'lan_wmessage.php' => '27b96105500cdfa56bc27e391a0c2f3b',
       ),
       'English.php' => '737802cb8d3c4cbf03327944272bcf1e',
       'lan_banner.php' => '92308af6029553992ebc4a46e97d4e1d',
-      'lan_comment.php' => '5077890a26c5264752f585bd49dd4965',
+      'lan_comment.php' => '7f872a8de759d8bba242e0c0214e3811',
       'lan_contact.php' => 'f6ec02eb9a5effc567f8483071105e66',
       'lan_date.php' => 'af33dd14b696babe19fd09e386c200c5',
-      'lan_download.php' => '5abdb7ce5e02a3f9f2da4860fce905a7',
+      'lan_download.php' => 'a810798b7f71ba54f23f61fe5f6896eb',
       'lan_email.php' => '499e255fe29b037d49ea7b50fa679c09',
-      'lan_error.php' => 'e63c154a52b72318443b0044d48ef9dd',
+      'lan_error.php' => '9d5d4ac7a6672f0be9c83b06cebc8d16',
       'lan_fpw.php' => 'cb552bb8035414854363a77d844b194b',
-      'lan_installer.php' => '106c6c4936d861a4ea0ab53af7a7e9e6',
-      'lan_links.php' => 'c309a9bc93d06a914bdc735efc9190cb',
+      'lan_installer.php' => 'bd24714ba9298821b041ff1f7e41740a',
       'lan_login.php' => '3bf7ecb7c00be86b54c83370fab6f8c6',
       'lan_mail_handler.php' => '001b336311279c058df01c2ae04aa87d',
       'lan_membersonly.php' => '102bba47b482668bb433a5a607767bae',
       'lan_news.php' => 'c3d990cb42ba5d40c6eaf915f6122448',
-      'lan_newspost.php' => '03cca3bd4c3553accde4fe1b2bb9856a',
       'lan_notify.php' => 'f930fc0c3afd1516e3b63f63f6f51e16',
       'lan_np.php' => '3d6c87e7ffeaa79de1ba06da0175f367',
       'lan_online.php' => 'cf15db263203fc5cca674ac1e03923bd',
@@ -1288,7 +1282,7 @@
       'lan_rate.php' => '02191b8a77011476d4e3e554387c01d5',
       'lan_ren_help.php' => '1ca40febf5f376f3dd7190f46cd26f02',
       'lan_search.php' => '60c1954cd9e67fe0ef3b7176978597cc',
-      'lan_signup.php' => '29a369ad3d821d0511b3015641f3290c',
+      'lan_signup.php' => '54ffcc9cba74b44e767b151e2f164daa',
       'lan_sitedown.php' => '65c55fc812ceff72c4aba3f56dbaf4cc',
       'lan_sitelinks.php' => 'ca292ed1c514df28d693b3e8cdc6baec',
       'lan_submitnews.php' => 'b07d8acc4221fc35ee5f655f2c8e55ce',
@@ -1346,7 +1340,7 @@
       array (
         'English.php' => '34df03d8f502238bd6f3c8102f1fc399',
       ),
-      'banner_menu.php' => 'ba985aea9cf61edb441b9f2e73ad45cf',
+      'banner_menu.php' => '32329ab6e68ec3b1cc6ec89374f3b4d6',
       'config.php' => '91398fb8db5e565e0659790796de8860',
     ),
     'blogcalendar_menu' => 
@@ -1413,7 +1407,7 @@
       'admin_config.php' => '637d77a1f80e4fc40d4772e285e52a82',
       'calendar.php' => 'cd96dede903591eb4e609ae9b1aea129',
       'calendar_menu.php' => '89fa2cc5825235633565c48682940e16',
-      'calendar_shortcodes.php' => '11527ca7c08d741317d6b4c467428067',
+      'calendar_shortcodes.php' => '8caad7046186dc80c386a932cb485ff0',
       'calendar_sql.php' => '39899457df794d8b56c58d3b1c8db88e',
       'calendar_template.php' => 'd852ceef7f6c8c10c5b10db571e16ccb',
       'e_list.php' => 'bc86836aabe7f01b4285d512a3079e9e',
@@ -1454,7 +1448,7 @@
       'admin_chatbox.php' => '6f1214cbae4b9154a4c5e779b307fe44',
       'chat.php' => '9841a76774363747857756af2efa089a',
       'chat_template.php' => 'cf97b7663cd4177f9c7ac299318ef8e5',
-      'chatbox_menu.php' => 'b6b23b0ebdff7d4bccaff45896edabf6',
+      'chatbox_menu.php' => 'ebee41812c0f352176d5fddb640c0f8b',
       'chatbox_sql.php' => 'aeb0d501ff23212e304f7f9a83d6926d',
       'e_list.php' => '11fde3fe8b58bec52bc6220053498509',
       'e_notify.php' => '379fbef832829bc4e9188b9fed62f31f',
@@ -1499,7 +1493,7 @@
       array (
         'English.php' => 'fa122fc7d21d653f3bea9f1a790cb173',
       ),
-      'compliance_menu.php' => '86b24e279294b5fc15099f08e5214fe3',
+      'compliance_menu.php' => 'a7b456e895ef89cd819835238b1482e6',
     ),
     'content' => 
     array (
@@ -1509,7 +1503,7 @@
         'content_convert_class.php' => '2e05d94418f8960eaac431741ce402a1',
         'content_db_class.php' => '7f4bdd8379cff76434631731968c5d8f',
         'content_defines.php' => '784711a6c68dc17c7752fb084400229c',
-        'content_form_class.php' => '3f9f7a0dfc6801dd240b2a47d8f30ff6',
+        'content_form_class.php' => '9893c79f95f8bf116093548faea627c9',
         'content_preset.php' => 'b91ea8f88734c800267bcf9761f2ea94',
       ),
       'images' => 
@@ -1588,7 +1582,7 @@
       array (
         'English' => 
         array (
-          'lan_content.php' => 'd6713020953b1639800b1c465af6a741',
+          'lan_content.php' => '1aabfcb774f17c28c7efadc19595adfa',
           'lan_content_admin.php' => '8f25ada52878c4c2d9107f55a828c468',
           'lan_content_frontpage.php' => '1593838cd7ec925d50576a815bd3c9ee',
           'lan_content_help.php' => 'd7cea6d1b8db2650fce4962ddfcd295d',
@@ -1629,8 +1623,8 @@
       ),
       'admin_content_config.php' => '5eaadc48ca7f9d18cfcbba35937e778e',
       'content.js' => 'd41d8cd98f00b204e9800998ecf8427e',
-      'content.php' => 'f50ddf3a0d5d630357fbb935e40ba149',
-      'content_manager.php' => 'ca564f775f6a34bfe8df6dbf3da3bd91',
+      'content.php' => '880cecd68d540867ed079d1aa7d848d4',
+      'content_manager.php' => 'd58366e560d9c4950170196e6f71c76a',
       'content_shortcodes.php' => '96a10b5cbb7f7f37d7fbcf147f5b2969',
       'content_sql.php' => '2632a603dd04ed62bbb3f011d3c5de41',
       'content_submit.php' => '15c56c828ea76a15aff7f020c0806d8f',
@@ -1639,13 +1633,13 @@
       'e_comment.php' => 'e5a8abcc72deaf2fe9c0a8b5eb4887ea',
       'e_emailprint.php' => '48572a480656347a64798b024168a7f1',
       'e_frontpage.php' => '4fee2ac77b9c66c1d5b760b95e6ea255',
-      'e_latest.php' => 'a2ddba2f8b0e67309960926086a0c985',
+      'e_latest.php' => 'cf27d4380af0461aa5cbf5adf36153b5',
       'e_list.php' => '07f0e1369439b9927ac11d48b6deeb06',
       'e_meta.php' => 'cbb645eebdedb216511c413fe64991a8',
       'e_notify.php' => '66aca77c03a989a7466472266ff76939',
       'e_rss.php' => '76954b881d598f26ecaebb4422f87696',
       'e_search.php' => 'd86c2f562c466bd7200974bd16f07c45',
-      'e_status.php' => '8ff6f7bd53147cbefecaadf3747378b2',
+      'e_status.php' => 'cf12158206b16c94292788fb9771c478',
       'help.php' => '950985bb6c445147d901bb4fb00b0f1d',
       'plugin.php' => 'cfb9004ff38e24cb87370ceb9017867f',
     ),
@@ -1830,7 +1824,7 @@
       'e_latest.php' => 'ba485c38b9ab90c0f572a2397b49c9f5',
       'e_linkgen.php' => '3184982dc3f9321a1d85df7cc41acf70',
       'e_list.php' => '523f01012192923c6901b7c088101ec0',
-      'e_rss.php' => '2d0f0839621d9d4539895e2047a76476',
+      'e_rss.php' => 'cf96fbd5d8ae9f83f6ca2b98ac069970',
       'e_search.php' => '663a93cb1f0d05351ecbb85a3bf721d4',
       'e_status.php' => 'e707e64a960612d443e16906faaf0e22',
       'forum.php' => '0bd4c27751efefb21188c3b483a822a7',
@@ -1838,11 +1832,11 @@
       'forum_class.php' => '4d6d9eabf1659593be329988f58927fc',
       'forum_conf.php' => '6cacab70081de88058215040494143b8',
       'forum_mod.php' => 'edd98521f3e8c94534c72b39bbc131ee',
-      'forum_post.php' => '002ded97314d02b2f07522ac04ea3ac1',
+      'forum_post.php' => '162565c1e4c4d90014a4f600ea73fe1a',
       'forum_post_shortcodes.php' => '58d0390a6fa95d713603a203025eb3f2',
-      'forum_shortcodes.php' => '4ea46b16b799b6c4bbf7e65ebce6ff19',
+      'forum_shortcodes.php' => 'dce37f018fa3be3a2bb67c740fe4725f',
       'forum_sql.php' => '3355b8219c200d8d669ce08e59053465',
-      'forum_stats.php' => '60f85eb68183f58c59696073a463c125',
+      'forum_stats.php' => '066d34a6f39fb18ff4e76e444375ace2',
       'forum_test.php' => 'ed668e3268952cb268b3f4aca0d2e37a',
       'forum_update.php' => '8e1fed1bae66e84eb3ad0235a60f0c69',
       'forum_update_check.php' => '95b6355554098357b5648807c4e95705',
@@ -1850,7 +1844,7 @@
       'forum_viewforum.php' => '2f35f7cafbc651fe80991d4b7c83c1ed',
       'forum_viewtopic.php' => 'ab460e959ba4523374375e92abebb874',
       'index.php' => '1d225ecdb6dfb425fcdd39501ed196c7',
-      'newforumposts_menu.php' => '0f8bc9fdf06e0edc12e08f843b873f8d',
+      'newforumposts_menu.php' => 'd6ac5152213f6c6f4448a10f9a3d5acf',
       'newforumposts_menu_config.php' => '264e2763fdd9f384af958c3d76272a5e',
       'plugin.php' => '871a97116e50c74039db5f2e3c96d040',
     ),
@@ -1907,7 +1901,7 @@
       ),
       'languages' => 
       array (
-        'English.php' => '0e6f9fa458d2a33b91ae81db30d2527e',
+        'English.php' => 'e086ee1c818a248b7da71d373a56afff',
       ),
       'link_images' => 
       array (
@@ -1916,24 +1910,24 @@
       'search' => 
       array (
         'search_advanced.php' => '985406e38223116b67ffe4afa714f176',
-        'search_comments.php' => '6d3c5c4d9d15e0c0adf77b859a4c054b',
+        'search_comments.php' => 'f887861124deb8c3b087359cb9f3210c',
         'search_parser.php' => 'ff43c05ffddd9ce508c98e913f90e167',
       ),
       'admin_linkspage_config.php' => '5576e1a0eee8984ad5909d901e481b30',
       'e_comment.php' => '13b0aa38e21d08a535276a7526cedde2',
       'e_frontpage.php' => '0a352c2a0b559b9d930943f1928f9d45',
-      'e_latest.php' => '6ab452dd2d2d46749d5149c5fd1905fc',
+      'e_latest.php' => '68bacd178e137861748385080b253ee4',
       'e_list.php' => '41486a930bbaf136d0a371c3201aa0e6',
       'e_notify.php' => 'eab13b015f9b5fa679fef28f63d72dde',
       'e_rss.php' => 'd213cc9cc0d5eeed3442b861e565961e',
       'e_search.php' => '7a7416dde4bc42481cf92431f4832b65',
       'e_status.php' => 'e1b28e610e6f89277440430a2f8747d8',
       'help.php' => 'a8495b50a8243ebbb3e37c8bcb169184',
-      'link_class.php' => 'd0fe2ec97894b8b6917db210e4fcdc38',
+      'link_class.php' => 'c875574f710f73ce342b3f93defa010c',
       'link_defines.php' => '1c9c8a4d29cac5f35e2164805bb3eca6',
       'link_menu.php' => '3520965348d79de448646454ddb04565',
-      'link_shortcodes.php' => 'b5a7e82698ff7574d1d777cdf834386d',
-      'links.php' => 'e90962ab7e3c65d29830deb12b5b96ae',
+      'link_shortcodes.php' => 'e7c72490ab6613732109aa5bbff0a8da',
+      'links.php' => 'c5bb9ad93c44ab803196d17b31fe34ea',
       'links_page_sql.php' => 'ebe16a35037a69b93eaa929782ca66ba',
       'links_template.php' => 'b578512e4b94cd623ee3cfcf5d0be178',
       'plugin.php' => 'b05df4d36293f4c2e2b949b3006cc712',
@@ -2094,7 +2088,7 @@
       array (
         'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e',
       ),
-      'admin_config.php' => '67f5b9dd7f192b2dc8ca820a348f9ba7',
+      'admin_config.php' => '13920f4a08dfdffb95074ba6fb96f01c',
       'consolidate.php' => '98cc86b8054e93d3f86f150504f0940b',
       'e_meta.php' => '6f94262ca53688c5466e906f0d2f9dd4',
       'log.php' => '309b0e75cb210dabbfbb17b940576435',
@@ -2103,7 +2097,7 @@
       'log_update_check.php' => 'f4e7f5fb3767e4c19adae8cb5e41e62c',
       'loginfo.php' => '854e51cd364a5f34bbb98559a1d997a5',
       'plugin.php' => 'b15d463132ce97a2f6e06af1a0a976d3',
-      'stats.php' => '07f505dcde9167765847d0419c67aec1',
+      'stats.php' => 'a5e903fba25292d4a5e50e0b1dbe5753',
     ),
     'login_menu' => 
     array (
@@ -2130,7 +2124,7 @@
       ),
       'admin_config.php' => '965609648b5052dad40742d8c76b8bf9',
       'newforumposts.sc' => '92de176e2d3503f91b9389d053d34348',
-      'newforumposts_main.php' => '11236c5ba693d7f86b2349e1a0606a7d',
+      'newforumposts_main.php' => 'e402272915bc7520e4bafa8ee182885c',
       'plugin.php' => '81caf517e35d6fdb13bf56fb6ab5395e',
     ),
     'newsfeed' => 
@@ -2148,13 +2142,13 @@
       'templates' => 
       array (
         'newsfeed_menu_template.php' => 'a26b82efdcad76104273e02e268bcbe2',
-        'newsfeed_template.php' => '5a1b8f38599596ff798b4df30873720f',
+        'newsfeed_template.php' => '5cc2377bbc4251eb511c6f16bde69765',
       ),
-      'admin_config.php' => '67d91a9c29acd1f52b4f12d36b3099e1',
+      'admin_config.php' => 'f91744a0ceedba0fe0e7fe85c2fa0e5a',
       'e_frontpage.php' => '2a8967b05bef4a2eb6b771ca44e6bf01',
       'help.php' => '7942458e34eb69cdad92cc7d9454f626',
-      'newsfeed.php' => 'b822c0fa9ace6409cef05d73eeae3ff5',
-      'newsfeed_functions.php' => 'f2a9d1c7ee7d30c3002bc754614aedb8',
+      'newsfeed.php' => '1c8d283cb9b5abceabf9df4752d96dc6',
+      'newsfeed_functions.php' => '711f0b7e516bb728a64c1aca2cc3e14d',
       'newsfeed_menu.php' => 'c6719765d152055b42afd2e9ae7b55e5',
       'plugin.php' => '9518316c3bbd37326a4c1383ae1d550d',
     ),
@@ -2191,7 +2185,7 @@
       array (
         'English.php' => 'bd66c994b8542abd18b70669d43ecfee',
       ),
-      'online_menu.php' => '0f7f9207ed2831dd50811d22a131a2d3',
+      'online_menu.php' => '762a66ae4b83e3ef3376da81043b9a7e',
     ),
     'other_news_menu' => 
     array (
@@ -2252,7 +2246,7 @@
         'English.php' => 'cdc4aab2e1c8caf5ddf209e32946c623',
       ),
       'admin_pdf_config.php' => 'ab75370cbef1f9e7d32448717071eb82',
-      'e107pdf.php' => '08533fb50ba86d606ab74f993a30fb95',
+      'e107pdf.php' => '3df3ae47abbe73366639b24f708c605c',
       'fpdf.css' => '35c07d5049ac6e55b8ab473c6dc38bf0',
       'fpdf.php' => 'da7385d29345f1c12fe85b6cacf5e905',
       'pdf.php' => '9c05a56fbb296b60cddcfc68ec1ae2c3',
@@ -2285,13 +2279,13 @@
       array (
         'admin' => 
         array (
-          'English.php' => 'f30bf8da455c1573531b2d9ac3397f4f',
+          'English.php' => '61751a3038626ba9be918de75227725d',
         ),
         'English.php' => 'a44c2c8b5b71a6f863ccf89acb9ef5ee',
       ),
       'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
       'plugin.php' => 'c89f4e634476ef16447a5375f39ce495',
-      'pm.php' => 'e0597865c2ef1d9a6ccc80fb1101f685',
+      'pm.php' => '63d47cb5c7d22b9e75b1def66445125c',
       'pm_class.php' => '1e927b58800d229fe53d01c901eb744d',
       'pm_conf.php' => '814f47b30db1aa07075469c0d1bcc4c0',
       'pm_default.php' => '0213fb9bcfe60d37041f44136727649b',
@@ -2299,10 +2293,10 @@
       'pm_notes.txt' => 'df26332907da1f35c4731d8893aea23e',
       'pm_shortcodes.php' => 'd1724a0b4d71996bf47758db99aed5dd',
       'pm_sql.php' => '4608486c1027c6485dc32674fd536dc5',
-      'pm_template.php' => 'cc1bdd12537404e75f9bd6dca8022292',
+      'pm_template.php' => 'd2a1f25ec59536d6f9744f203bda98a7',
       'pm_update.php' => 'e66fc6610e273471a212471e07598710',
       'pm_update_check.php' => 'a5b341b5373844cdfc1f961fb3d3151f',
-      'private_msg_menu.php' => '71c696f7977dacaed9b4005f036c6035',
+      'private_msg_menu.php' => 'c672e6f4be8aa79896f873fdd0eff9f3',
       'sendpm.sc' => '6318c4f90564ce0bbd87a3e16c03c30b',
     ),
     'poll' => 
@@ -2331,8 +2325,8 @@
       'oldpolls.php' => '4a873e55c457ae529acb447b28e06780',
       'plugin.php' => '6dff875dd04ce5d602f4b64b7732610e',
       'poll.php' => 'b51353ac9b1d4f9664b954d528644547',
-      'poll_class.php' => '122e323dd89c832f16bb84418cc2a895',
-      'poll_menu.php' => 'b2e1d5b8d5e8cacf51e2724446b663c1',
+      'poll_class.php' => '4b78af6d41376320b39df4a85e09e71e',
+      'poll_menu.php' => '002a59a4cfa6b2036a0ae0e5abf34051',
       'poll_sql.php' => 'ffe53748dbd1504f7c4204027814064a',
     ),
     'powered_by_menu' => 
@@ -2361,9 +2355,9 @@
       'admin_prefs.php' => '511047205732e1f3a5098052e3a2eb4e',
       'e_meta.php' => 'af7e8b4a56e0d4cbb7a469dea4b86f9c',
       'plugin.php' => '46b1e37c9d18e6872083425afb3115fa',
-      'rss.php' => 'df74feab6752fd849e0e706c38dbea0f',
+      'rss.php' => '27e183fcdad34d922b84522fce7e17c1',
       'rss_menu.php' => '1be0ce84109cbbbcdadf68cc93fb5c20',
-      'rss_shortcodes.php' => '740879dc0f3e68bcb125521d32977601',
+      'rss_shortcodes.php' => '5e842cc4bcb5262055b7bf4d9aa57f55',
       'rss_sql.php' => 'efee18037cab9fbf35cdf81f97efc2a3',
       'rss_template.php' => '023614657d162b0f155fbe50e6e3dce2',
     ),
@@ -2401,7 +2395,7 @@
       ),
       'admin_config.php' => '33cdfe877fe26c13f06e973e23d076d1',
       'e_meta.php' => 'f773d59990b39abd93a8a18f676d5770',
-      'modtrackback.php' => '120f0b85ca303f8ad9b1d9877a0be163',
+      'modtrackback.php' => 'bf17b7ad8dd20905d3188a564c20ac59',
       'plugin.php' => 'faaf0e70297414b7f61db1a8f030a02c',
       'trackback.php' => '68d35830a04bc5283cf0ab718b3ee2f2',
       'trackbackClass.php' => 'd1ea513f324fc8583042f7c16dc5215f',
@@ -2413,7 +2407,7 @@
         'English.php' => 'be4478e772ee1e1189a57284891582d8',
       ),
       'config.php' => 'a78276d858ff5dcaf1980939ea0d9578',
-      'tree_menu.php' => 'be6a4a6eb1a8b545189b4d82b248d4ba',
+      'tree_menu.php' => 'd900170e1e56cf3b74933bd4b9486c8a',
     ),
     'userlanguage_menu' => 
     array (
@@ -2523,7 +2517,7 @@
       'newforumpost.php' => '6a9cd60b76c00cd41384f21ce1265860',
       'preview.jpg' => '37766edab6519ba0d82d89d0fad9b9df',
       'style.css' => '98b43a380766349d489c4bdc3ea69eff',
-      'theme.php' => 'e7f8584099975bafbd28c2f8683de37b',
+      'theme.php' => 'a17c960a480eaee833aa500e819d6072',
     ),
     'interfectus' => 
     array (
@@ -2654,7 +2648,7 @@
       'pepper.css' => 'bcd1ac74e7cacb3ace1396355f238cc8',
       'preview.jpg' => '1d775846dbe1b7ea66065fc0eac72eaa',
       'style.css' => 'c406d47937f253e08d655b1d1008a6c2',
-      'theme.php' => 'db2c61ffe769dd7f6a5aa50951d1e3f3',
+      'theme.php' => '2ab0c01dfde85ba51ee39f30c59815b7',
     ),
     'khatru' => 
     array (
@@ -2702,7 +2696,7 @@
       'poll_template.php' => 'c01388206c3cf373ff04e01c38485d99',
       'preview.png' => 'b164565b63d086a6a5a28fd76097487c',
       'style.css' => 'be699284eb74ccbd6543eac6f60754ea',
-      'theme.php' => 'ba435e387dabd2ca94d7124d46693fd0',
+      'theme.php' => '97855abc56b4772669264f233c9611d9',
     ),
     'kubrick' => 
     array (
@@ -2770,7 +2764,7 @@
       'forum_preview_template.php' => '2391640ab5380b18ac17e54a99feb29f',
       'forum_template.php' => 'bc95ea3fe78fc262a1560ffaa0ea7c39',
       'forum_viewforum_template.php' => 'e7a90d1f598d3335428e3c5bc7ecf6d4',
-      'forum_viewtopic_template.php' => '86e8fb0953c7a9815ad03288ebac71c0',
+      'forum_viewtopic_template.php' => 'ad728c2b5211c74cf83f6d58f81ed8c5',
       'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
       'newforumpost.php' => '7ec9f0bb87045e10862dc2b7dcc9757d',
       'news_template.php' => '0f5b689c4ad3d212934707f44b959b11',
@@ -2923,12 +2917,12 @@
     'templates' => 
     array (
       'admin_template.php' => 'aedfda791297d2d2301ca3c2d14b9d7c',
-      'banner_template.php' => '7dce0864e00519643d986c18dfe79bc9',
+      'banner_template.php' => '58c9cb82186cc85b7a1af8398c6b888b',
       'bbcode_template.php' => '884969ebee7a4a328a88f308f04c7822',
       'comment_template.php' => 'be07b00f84a5fbbeeef3ad557294700d',
       'contact_template.php' => 'beee7004f0235889e55c69d2472d7779',
       'download_template.php' => '5681bcd3468ce80571394a0a68fb0926',
-      'email_template.php' => '4ca383970db88c07d7e6162fd016fe43',
+      'email_template.php' => 'cc12dc6238aa47bf50f915a1a114a858',
       'footer_default.php' => '633f17fe5dbb3865de99b9e65eecc190',
       'fpw_template.php' => '326abf6c01f19246a9ebe07e64d07ead',
       'header_default.php' => 'e7b5cb81653ecdd8d7bfc8e9916a3e80',
@@ -2937,7 +2931,7 @@
       'membersonly_template.php' => '14635660ab8f2daed92f4260ed0f3fa1',
       'online_template.php' => '97ff2933cef883a08756aed1527a3349',
       'search_template.php' => '100782de2e0ac37b7286bc2a1f65a2c2',
-      'signup_template.php' => 'f85131cd59fd0d19bd071adeabdcb7ef',
+      'signup_template.php' => '2168fa51ff1cfcfb3b8f2aaf87287d99',
       'sitedown_template.php' => '5e7c7db5ff15ed4a866d3fb46377c247',
       'trackback_template.php' => 'fd54d8c26c75f9d380e8ec90860b0107',
       'user_template.php' => '6338b0faa7ad36c8ecd89cfd0f933d90',
@@ -2976,16 +2970,16 @@
   ),
   'article.php' => 'ee3b7df97cb467d35263bedf589abf98',
   'backend.php' => '312552577f67c7965a76bda84b949a64',
-  'banner.php' => '6328a170fd3ee6f75ebdd2472f3fb397',
-  'class2.php' => 'a9c116a36a957e2d5a3560b0870529e4',
-  'comment.php' => 'a3eac4d5b478d7c46ed1399f8d6984b7',
-  'contact.php' => '80a5445731a44a4a27df0819a5b31e97',
+  'banner.php' => 'e028fd2fa6fac77863505acb501b6632',
+  'class2.php' => 'f0b9fecb1230bca885d545a6572e68fc',
+  'comment.php' => '0b4676b8c5873e7ef54be536927bbcce',
+  'contact.php' => 'be3feefdfb6c086b112ef037989fcbd1',
   'content.php' => '0eaa8d6a20548b6842ade24b9a0bf4ae',
-  'download.php' => 'efd6d9ef9f48e15d3416b7c6273a4ed4',
+  'download.php' => '110185761e87d967f9bb1fcf84cfb458',
   'e107.htaccess' => 'c5e1ad68b41f947be285926c0f81d914',
   'e107_config.php' => 'd41d8cd98f00b204e9800998ecf8427e',
   'email.php' => '6f5a6b9bd588d7f774f4e1a731efa937',
-  'error.php' => 'bc5af0f64bf07c2cacf7e7dcbf681ccd',
+  'error.php' => 'cefbba8e1639ecf9c35502cf646c5cda',
   'favicon.ico' => '5fceb78b9124ddae4027396d7cfcd328',
   'forum.php' => '3c10184d52685d7c9a6906a967b7e3d8',
   'forum_viewforum.php' => '4b9fcc3a820ed2f93b4dc707c3ebe3b4',
@@ -2994,25 +2988,25 @@
   'gsitemap.php' => '5a3d81b0d9ca3f41c6a8c46155c41cc7',
   'index.php' => '960de1b196ffa6e7887fe99ae65fa682',
   'links.php' => 'bed206fc2abe8f1307ef4db3b7fee63e',
-  'login.php' => '266af1e60ea470873db56085d72d065e',
+  'login.php' => '4483bb69d947c6150c22c7a22dc8def9',
   'membersonly.php' => '0903a2ef48312a12ce81b2fa17fe0233',
   'news.php' => '8ced9468ea4fd7b6e9257461e4db2e45',
-  'online.php' => 'bac185f5a2f38560c8944663380d612b',
-  'page.php' => '79775867711338d023f54f7bff43c82c',
+  'online.php' => '3006f49d522026442e744a71631db632',
+  'page.php' => '8a20cbd55e6ab1f627bdcd62af8fa2f0',
   'print.php' => '82e7c7267881349a4ef5e11f3efb6de8',
   'rate.php' => '4730b1d1cf3ace6af2179fb52a521366',
-  'request.php' => '3e2514a378f5ceab71d4a31f81109bb0',
+  'request.php' => '3891299e7754fae7fcf92d9ec65d8a3e',
   'robots.txt' => '118aadbc5395ee3d4c6fade187097e5a',
-  'search.php' => 'bab96f6885d0ca153ed52be19876de32',
-  'signup.php' => '1a14bd2bb9d552edb98746dba7e5de93',
+  'search.php' => '1d24fcf7464762584979aa78cf0d6b7c',
+  'signup.php' => 'bc2fa04b7e17112614cb2df905e7b4e2',
   'sitedown.php' => '7a2d95fb0976ce5ab287a403b118acfa',
   'subcontent.php' => '5a534e399228320e38056244e944357d',
-  'submitnews.php' => '347abdf2aacaa48522c99d7a873cfbc8',
+  'submitnews.php' => '4615a023d5c16cd745bd03cc4fb980ad',
   'top.php' => '9d7f39ec5411241994a7bd2777f592aa',
-  'upload.php' => 'b3a9d21c82ccf91dd49935323334766f',
-  'user.php' => 'a3db994bcbe384c003b4eb144d161482',
-  'userposts.php' => '519d09a0b5f38a31d280f50eff92a19a',
-  'usersettings.php' => '569e7574019bc919aed2cc1b83c36c07',
+  'upload.php' => '793d03ad26b98f1675a3331fb390210f',
+  'user.php' => '04be88f587ad8a00cbf42eacbef75598',
+  'userposts.php' => '973300cda186f7eda50879bd6b161ab7',
+  'usersettings.php' => '4b6a3607cd92e9a8aca2726be1d0b1de',
 );
 
 $deprecated_image = array (
@@ -4339,10 +4333,14 @@
           'article.php' => '3c7df3956134df9dfc86a4a67b73d78b',
           'chatbox.php' => 'df26b116189f5c3b615311ee4fc2fdc6',
           'content.php' => 'dcf60ff22635488c42b4a99243bdf9f2',
+          'custommenu.php' => 'bc2d5fff1395d8495a45b80da77b7665',
           'forum.php' => '161249fcb72351dee1b5b56fda1a15be',
           'link_category.php' => '5352ce360022a7fc0882fb77603405cb',
+          'list_menu_conf.php' => '88bd581ba21987493206e430885cd3f0',
           'log.php' => '553fd4414b98f4aa5f0f6e1f8f7b0ad6',
+          'menus2.php' => '2249f7d8b325af8945ed1a5a3e9721e2',
           'newsfeed.php' => '93f7ef1481d3fc59ecde4d40ad6b6c84',
+          'poll.php' => '3adef894abf1c1920a311899071ff8ee',
           'review.php' => '6997e7c8d919246f698837c0ba3693b3',
         ),
         'lan_admin.php.bak' => 'c8bd5eb16d7834de1975b2ac3cd301e3',
@@ -4373,6 +4371,8 @@
       'lan_forum_viewforum.php' => 'ae655efbf1d88f64a6f9436894767a64',
       'lan_forum_viewtopic.php' => 'dc93aa81babfe0ee610d559d70f8681a',
       'lan_install.php' => '6182909e4053d2da395298e4ca73323a',
+      'lan_links.php' => 'c309a9bc93d06a914bdc735efc9190cb',
+      'lan_newspost.php' => '03cca3bd4c3553accde4fe1b2bb9856a',
       'lan_oldpolls.php' => '64379ca9ff42aaf1873b93bc41627fa7',
       'lan_request.php' => '023a40948ec32b3359e9a5bae2b04f71',
       'lan_sitemap.php' => '7d926f3eb3c81ed747a6682d4a9048a5',
diff -x .svn -aruN 0.7.11.src/e107_admin/cpage.php 0.7.12.src/e107_admin/cpage.php
--- 0.7.11.src/e107_admin/cpage.php	2007-10-08 15:18:19.000000000 -0500
+++ 0.7.12.src/e107_admin/cpage.php	2008-07-09 15:07:54.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/cpage.php,v $
-|     $Revision: 1.41 $
-|     $Date: 2007/10/08 20:18:19 $
+|     $Revision: 1.42 $
+|     $Date: 2008/07/09 20:07:54 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -125,10 +125,11 @@
 
 			foreach($pages as $pge)
 			{
-				$text .= "
+			  $title_text = $pge['page_title'] ? $pge['page_title'] : ($pge['page_theme'] ? CUSLAN_43.$pge['page_theme'] : CUSLAN_44);
+			  $text .= "
 				<tr>
 				<td style='width:5%; text-align: center;' class='forumheader3'>{$pge['page_id']}</td>
-				<td style='width:60%' class='forumheader3'><a href='".($pge['page_theme'] ? e_ADMIN."menus.php" : e_BASE."page.php?{$pge['page_id']}" )."'>{$pge['page_title']}</a></td>
+				<td style='width:60%' class='forumheader3'><a href='".($pge['page_theme'] ? e_ADMIN."menus.php" : e_BASE."page.php?{$pge['page_id']}" )."'>{$title_text}</a></td>
 				<td style='width:15%; text-align: center;' class='forumheader3'>".($pge['page_theme'] ? "menu" : "page")."</td>
 				<td style='width:20%; text-align: center;' class='forumheader3'>
 				<a href='".e_SELF."?".($pge['page_theme'] ? "createm": "create").".edit.{$pge['page_id']}'>".ADMIN_EDIT_ICON."</a>
diff -x .svn -aruN 0.7.11.src/e107_admin/credits.php 0.7.12.src/e107_admin/credits.php
--- 0.7.11.src/e107_admin/credits.php	2007-04-12 14:40:43.000000000 -0500
+++ 0.7.12.src/e107_admin/credits.php	2008-04-01 15:08:45.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/credits.php,v $
-|     $Revision: 1.17 $
-|     $Date: 2007/04/12 19:40:43 $
+|     $Revision: 1.18 $
+|     $Date: 2008/04/01 20:08:45 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -109,7 +109,7 @@
 <body style='padding: 0; margin: 0; background-color: #e8e8e8; color: #8E8E8E'>
 
 <div><img src='".e_IMAGE."generic/cred.png' alt='' />
-<div class='smalltext' style='position: absolute; top: 120px; left: 118px;'><b>".CRELAN_7." ".$e107info['e107_version'].", build ".($e107info['e107_build'] ? $e107info['e107_build'] : "zero")."</b><br />&copy; 2002-2006, ".CRELAN_3."</div>
+<div class='smalltext' style='position: absolute; top: 120px; left: 118px;'><b>".CRELAN_7." ".$e107info['e107_version'].", build ".($e107info['e107_build'] ? $e107info['e107_build'] : "zero")."</b><br />&copy; 2002-2008, ".CRELAN_3."</div>
 
 ";
 
diff -x .svn -aruN 0.7.11.src/e107_admin/download.php 0.7.12.src/e107_admin/download.php
--- 0.7.11.src/e107_admin/download.php	2007-12-22 08:03:15.000000000 -0600
+++ 0.7.12.src/e107_admin/download.php	2008-06-06 14:14:14.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/download.php,v $
-|     $Revision: 1.101 $
-|     $Date: 2007/12/22 14:03:15 $
+|     $Revision: 1.103 $
+|     $Date: 2008/06/06 19:14:14 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -58,12 +58,14 @@
 */
 
 $rs = new form;
-if (e_QUERY) {
+$sub_action = '';
+if (e_QUERY) 
+{
 	$tmp = explode(".", e_QUERY);
 	$action = $tmp[0];
-	$sub_action = $tmp[1];
-	$id = $tmp[2];
-	$from = ($tmp[3] ? $tmp[3] : 0);
+  $sub_action = varset($tmp[1],'');
+  $id = varset($tmp[2],'');
+  $from = varset($tmp[3], 0);
 	unset($tmp);
 }
 
@@ -78,20 +80,26 @@
 $amount = 50;
 
 
-if($file_array = $fl->get_files(e_DOWNLOAD, "","standard",5)){
+if($file_array = $fl->get_files(e_DOWNLOAD, "","standard",5))
+{
 		sort($file_array);
 }
 
-if($public_array = $fl->get_files(e_FILE."public/")){
-	foreach($public_array as $key=>$val){
+
+if($public_array = $fl->get_files(e_FILE."public/"))
+{
+  foreach($public_array as $key=>$val)
+  {
     	$file_array[] = str_replace(e_FILE."public/","",$val);
 	}
 }
 
 
 
-if ($sql->db_Select("rbinary")){
-	while ($row = $sql->db_Fetch())	{
+if ($sql->db_Select("rbinary"))
+{
+  while ($row = $sql->db_Fetch())	
+  {
 		extract($row);
 		$file_array[] = "Binary ".$binary_id."/".$binary_name;
 	}
@@ -107,15 +115,20 @@
 	sort($thumb_array);
 }
 
-if(isset($_POST)){
+
+
+if(isset($_POST))
+{
 	$e107cache->clear("download_cat");
 }
 
-if (isset($_POST['add_category'])) {
+if (isset($_POST['add_category'])) 
+{
 	$download->create_category($sub_action, $id);
 }
 
-if (isset($_POST['submit_download'])) {
+if (isset($_POST['submit_download'])) 
+{
 	$download->submit_download($sub_action, $id);
 	$action = "main";
 	unset($sub_action, $id);
@@ -152,6 +165,7 @@
 	$message = DOWLAN_65;
 }
 
+
 if(isset($_POST['addlimit']))
 {
 	if($sql->db_Select('generic','gen_id',"gen_type = 'download_limit' AND gen_datestamp = {$_POST['newlimit_class']}"))
@@ -171,6 +185,7 @@
 	}
 }
 
+
 if(isset($_POST['updatelimits']))
 {
 
@@ -202,11 +217,13 @@
 	}
 }
 
+
 if(isset($_POST['submit_mirror']))
 {
 	$download->submit_mirror($sub_action, $id);
 }
 
+
 if($action == "mirror")
 {
 	$download -> show_existing_mirrors();
@@ -220,22 +237,30 @@
 	$sub_action = "dlm";
 }
 
-if ($action == "create") {
+
+if ($action == "create") 
+{
 	$download->create_download($sub_action, $id);
 }
 
-if ($delete == 'category') {
-	if (admin_update($sql->db_Delete("download_category", "download_category_id='$del_id' "), 'delete', DOWLAN_49." #".$del_id." ".DOWLAN_36)) {
+
+if ($delete == 'category') 
+{
+  if (admin_update($sql->db_Delete("download_category", "download_category_id='$del_id' "), 'delete', DOWLAN_49." #".$del_id." ".DOWLAN_36)) 
+  {
 		$sql->db_Delete("download_category", "download_category_parent='{$del_id}' ");
 	}
 }
 
-if ($action == "cat") {
+
+if ($action == "cat") 
+{
 	$download->show_categories($sub_action, $id);
 }
 
-if ($delete == 'main') {
 
+if ($delete == 'main') 
+{
 	$result = admin_update($sql->db_Delete("download", "download_id='$del_id' "), 'delete', DOWLAN_27." #".$del_id." ".DOWLAN_36);
 	if($result)
 	{
@@ -246,11 +271,15 @@
 }
 
 
-if (isset($message)) {
+if (isset($message)) 
+{
 	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
 }
 
-if (!e_QUERY || $action == "main") {
+
+
+if (!e_QUERY || $action == "main") 
+{
 	$download->show_existing_items($action, $sub_action, $id, $from, $amount);
 }
 
@@ -458,39 +487,50 @@
 	exit;
 }
 
-//$download->show_options($action);
-
 require_once("footer.php");
 exit;
 
-class download {
 
-	function show_existing_items($action, $sub_action, $id, $from, $amount) {
-		global $sql, $rs, $ns, $tp, $mySQLdefaultdb,$pref;
+
+
+class download 
+{
+	function show_existing_items($action, $sub_action, $id, $from, $amount) 
+	{
+	global $sql, $rs, $ns, $tp, $mySQLdefaultdb, $pref;
 		$text = "<div style='text-align:center'><div style='padding : 1px; ".ADMIN_WIDTH."; margin-left: auto; margin-right: auto;'>";
         $sortorder = ($pref['download_order']) ? $pref['download_order'] : "download_datestamp";
-		if(isset($_POST['searchdisp'])){
+    $sortdirection = ($pref['download_sort']) ? strtolower($pref['download_sort']) : "desc";
+	if ($sortdirection != 'desc') $sortdirection = 'asc';
+	if(isset($_POST['searchdisp']))
+	{
 			$pref['admin_download_disp'] = implode("|",$_POST['searchdisp']);
 			save_prefs();
 		}
 
-		if(!$pref['admin_download_disp']){
+	if(!$pref['admin_download_disp'])
+	{
 			$search_display = array("download_name","download_class");
-		}else{
+	}
+	else
+	{
             $search_display = explode("|",$pref['admin_download_disp']);
 		}
 
-//         $query = "SELECT d.*, dc.* FROM #download AS d	LEFT JOIN #download_category AS dc ON dc. download_category_id  = d.download_category";
          $query = "SELECT d.*, dc.* FROM `#download` AS d	LEFT JOIN `#download_category` AS dc ON dc. download_category_id  = d.download_category";
 
-		if (isset($_POST['searchquery']) && $_POST['searchquery'] != "") {
+		if (isset($_POST['searchquery']) && $_POST['searchquery'] != "") 
+		{
 			$query .= " WHERE  download_url REGEXP('".$_POST['searchquery']."') OR download_author REGEXP('".$_POST['searchquery']."') OR download_description  REGEXP('".$_POST['searchquery']."') ";
-            foreach($search_display as $disp){
+          foreach($search_display as $disp)
+		  {
 		  		$query .= " OR $disp REGEXP('".$_POST['searchquery']."') ";
 			}
-            $query .= " ORDER BY ".$sortorder." DESC";
-		} else {
-			$query .= " ORDER BY ".($sub_action ? $sub_action : $sortorder)." ".($id ? $id : "DESC")."  LIMIT $from, $amount";
+          $query .= " ORDER BY {$sortorder} {$sortdirection}";
+		} 
+		else 
+		{
+		  $query .= " ORDER BY ".($sub_action ? $sub_action : $sortorder)." ".($id ? $id : $sortdirection)."  LIMIT $from, $amount";
 		}
 
       	if ($dl_count = $sql->db_Select_gen($query)) 
@@ -505,13 +545,13 @@
 		  foreach($search_display as $disp)
 		  {
 			if($disp == "download_name")
-			{
+			{  // Toggle direction
 			  $text .= "<td class='fcaption'><a href='".e_SELF."?main.download_name.".($id == "desc" ? "asc" : "desc").".$from'>".DOWLAN_27."</a></td>";
 			}
 			else
 			{
 			  $repl = array("download_","_");
-			  $text .= "<td class='fcaption'><a href='".e_SELF."?main.$disp.".($id == "desc" ? "asc" : "desc").".$from'>".ucwords(str_replace($repl," ",$disp))."</a></td>";
+			  $text .= "<td class='fcaption'><a href='".e_SELF."?main.{$disp}.".($id == "desc" ? "asc" : "desc").".$from'>".ucwords(str_replace($repl," ",$disp))."</a></td>";
 			}
 		  }
 
@@ -596,7 +636,7 @@
 		$downloads = $sql->db_Count("download");
 		if ($downloads > $amount && !$_POST['searchquery']) 
 		{
-			$parms = "{$downloads},{$amount},{$from},".e_SELF."?".(e_QUERY ? "$action.$sub_action.$id." : "main.download_id.desc.")."[FROM]";
+		  $parms = "{$downloads},{$amount},{$from},".e_SELF."?".(e_QUERY ? "$action.$sub_action.$id." : "main.{$sortorder}.{$sortdirection}.")."[FROM]";
 			$text .= "<br />".$tp->parseTemplate("{NEXTPREV={$parms}}");
 		}
 
@@ -614,12 +654,14 @@
 		}
         $m = 0;
 		$replacechar = array("download_","_");
-		foreach($fname as $fcol){
+	foreach($fname as $fcol)
+	{
         $checked = (in_array($fcol,$search_display)) ? "checked='checked'" : "";
 			$text .= "<td style='text-align:left; padding:0px'>";
 			$text .= "<input type='checkbox' name='searchdisp[]' value='".$fcol."' $checked />".str_replace($replacechar," ",$fcol) . "</td>\n";
 			$m++;
-			if($m == 5){
+	  if($m == 5)
+	  {
 				$text .= "</tr><tr>";
 				$m = 0;
 			 }
@@ -628,7 +670,7 @@
 		$text .= "</table></div>
 		</form>\n
 		</div>";
-// ======================
+
 
 		$ns->tablerender(DOWLAN_7, $text);
 	}
@@ -665,9 +707,8 @@
 // ---------------------------------------------------------------------------
 
 
-	function create_download($sub_action, $id) {
-
-
+	function create_download($sub_action, $id) 
+	{
 		global $cal,$tp, $sql, $fl, $rs, $ns, $file_array, $image_array, $thumb_array,$pst;
 		require_once(e_FILE."shortcode/batch/download_shortcodes.php");
 
@@ -755,21 +796,26 @@
 			";
 
 		$counter = 0;
-		while (isset($file_array[$counter])) {
+		while (isset($file_array[$counter])) 
+		{
 			$fpath = str_replace(e_DOWNLOAD,"",$file_array[$counter]['path']).$file_array[$counter]['fname'];
-			if (stristr($fpath, $download_url) !== FALSE) {
+		  $selected = '';
+		  if (stristr($fpath, $download_url) !== FALSE) 
+		  {
 				$selected = " selected='selected'";
 				$found = 1;
-			} else {
-				$selected = "";
 			}
 
 			$text .= "<option value='".$fpath."' $selected>".$fpath."</option>\n";
 			$counter++;
 		}
 
-		if (preg_match("/http:|ftp:/", $download_url)) {
+		$dt = 'display:none';
+		if (preg_match("/http:|ftp:/", $download_url)) 
+		{
 			$download_url_external = $download_url;
+		  $download_url = '';
+		  $dt = '';
 		}
 
 		$etext = " - (".DOWLAN_68.")";
@@ -777,18 +823,19 @@
 			$etext = "";
 		}
 
-		if (!$found && $download_url) {
+		if (!$found && $download_url) 
+		{
 			$text .= "<option value='".$download_url."' selected='selected'>".$download_url.$etext."</option>\n";
 		}
 
 		$text .= "</select></div>
             <span style='padding-top:6px;cursor:pointer;text-decoration:underline' onclick='expandit(this)' title='".DOWLAN_14."'>".DOWLAN_149."</span>
-			<div id='use_ext' style='padding-top:6px;display:none'>
+			<div id='use_ext' style='padding-top:6px;{$dt}'>
            URL:&nbsp;
 
-			<input class='tbox' type='text' name='download_url_external' size='40' value='$download_url_external' maxlength='150' />
+			<input class='tbox' type='text' name='download_url_external' size='70' value='{$download_url_external}' maxlength='150' />
 			&nbsp;&nbsp;&nbsp;".DOWLAN_66."
-			<input class='tbox' type='text' name='download_filesize_external' size='8' value='$download_filesize' maxlength='10' />
+			<input class='tbox' type='text' name='download_filesize_external' size='8' value='{$download_filesize}' maxlength='10' />
            </div>
 
 			</td>
@@ -1405,7 +1452,7 @@
 			<input class='tbox' type='text' id='download_category_icon' name='download_category_icon' size='60' value='$download_category_icon' maxlength='100' />
 
 			<br />
-			<input class='button' type ='button' style='cursor:hand' size='30' value='".DOWLAN_42."' onclick='expandit(this)' />
+			<input class='button' type ='button' style='cursor:pointer' size='30' value='".DOWLAN_42."' onclick='expandit(this)' />
 			<div id='cat_icn' style='display:none;{head}' >";
 
 		while (list($key, $icon) = each($iconlist)) {
@@ -1424,7 +1471,7 @@
 			<input class='tbox' type='text' id='download_category_icon_empty' name='download_category_icon_empty' size='60' value='$download_category_icon_empty' maxlength='100' />
 
 			<br />
-			<input class='button' type ='button' style='cursor:hand' size='30' value='".DOWLAN_42."' onclick='expandit(this)' />
+			<input class='button' type ='button' style='cursor:pointer' size='30' value='".DOWLAN_42."' onclick='expandit(this)' />
 			<div id='cat_icn_empty' style='display:none;{head}' >";
 
 		while (list($key, $icon) = each($iconlist)) {
@@ -1465,15 +1512,21 @@
 		$download_category_name = $tp->toDB($_POST['download_category_name']);
 		$download_category_description = $tp->toDB($_POST['download_category_description']);
 	  	$download_category_icon = $tp->toDB($_POST['download_category_icon']);
+		$download_category_class = $tp->toDB($_POST['download_category_class']);
+		$download_categoory_parent = intval($_POST['download_category_parent']);
 
-		if(isset($_POST['download_category_icon_empty']) && $_POST['download_category_icon_empty'] != ""){
-			$download_category_icon .= trim(chr(1).$tp->toDB($_POST['download_category_icon_empty']));
+		if(isset($_POST['download_category_icon_empty']) && $_POST['download_category_icon_empty'] != "")
+		{
+		  $download_category_icon .= trim(chr(1).$tp->toDB($_POST['download_category_icon_empty']));
 		}
 
-		if ($id) {
-			admin_update($sql->db_Update("download_category", "download_category_name='$download_category_name', download_category_description='$download_category_description', download_category_icon ='$download_category_icon', download_category_parent= '".intval($_POST['download_category_parent'])."', download_category_class='".$_POST['download_category_class']."' WHERE download_category_id='$id'"), 'update', DOWLAN_48);
-		} else {
-			admin_update($sql->db_Insert("download_category", "0, '$download_category_name', '$download_category_description', '$download_category_icon', '".intval($_POST['download_category_parent'])."', '".$_POST['download_category_class']."', 0 "), 'insert', DOWLAN_47);
+		if ($id) 
+		{
+		  admin_update($sql->db_Update("download_category", "download_category_name='{$download_category_name}', download_category_description='{$download_category_description}', download_category_icon ='{$download_category_icon}', download_category_parent= '{$download_categoory_parent}', download_category_class='{$download_category_class}' WHERE download_category_id='{$id}'"), 'update', DOWLAN_48);
+		} 
+		else 
+		{
+		  admin_update($sql->db_Insert("download_category", "0, '{$download_category_name}', '{$download_category_description}', '{$download_category_icon}', '{$download_categoory_parent}', '{$download_category_class}', 0 "), 'insert', DOWLAN_47);
 		}
 		if ($sub_action == "sn") {
 			$sql->db_Delete("tmp", "tmp_time='$id' ");
@@ -1577,7 +1630,7 @@
 		<input class='tbox' type='text' id='mirror_image' name='mirror_image' size='60' value='$mirror_image' maxlength='200' />
 
 
-		<br /><input class='button' type ='button' style='cursor:hand' size='30' value='".DOWLAN_42."' onclick='expandit(this)' />
+		<br /><input class='button' type ='button' style='cursor:pointer' size='30' value='".DOWLAN_42."' onclick='expandit(this)' />
 		<div id='imagefile' style='display:none;{head}'>";
 
 		$text .= DOWLAN_140."<br /><br />";
diff -x .svn -aruN 0.7.11.src/e107_admin/filemanager.php 0.7.12.src/e107_admin/filemanager.php
--- 0.7.11.src/e107_admin/filemanager.php	2007-10-25 20:09:07.000000000 -0500
+++ 0.7.12.src/e107_admin/filemanager.php	2008-04-01 15:06:33.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/filemanager.php,v $
-|     $Revision: 1.22 $
-|     $Date: 2007/10/26 01:09:07 $
-|     $Author: mcfly_e107 $
+|     $Revision: 1.23 $
+|     $Date: 2008/04/01 20:06:33 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("../class2.php");
@@ -53,8 +53,10 @@
 
 // ===============================================
 
-
-foreach($_POST['deleteconfirm'] as $key=>$delfile){
+if (isset($_POST['deleteconfirm'])) 
+{
+  foreach($_POST['deleteconfirm'] as $key=>$delfile)
+  {
 	// check for delete.
 	if (isset($_POST['selectedfile'][$key]) && isset($_POST['deletefiles'])) {
 		if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
@@ -85,6 +87,7 @@
 			}
 		}
 	}
+  }
 }
 
 
diff -x .svn -aruN 0.7.11.src/e107_admin/footer.php 0.7.12.src/e107_admin/footer.php
--- 0.7.11.src/e107_admin/footer.php	2007-08-18 08:47:47.000000000 -0500
+++ 0.7.12.src/e107_admin/footer.php	2008-04-06 16:37:41.000000000 -0500
@@ -11,15 +11,15 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/footer.php,v $
-|     $Revision: 1.26 $
-|     $Date: 2007/08/18 13:47:47 $
+|     $Revision: 1.27 $
+|     $Date: 2008/04/06 21:37:41 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 if (!defined('e107_INIT')) { exit; }
 $In_e107_Footer = TRUE;	// For registered shutdown function
 
-global $eTraffic, $error_handler, $db_time, $sql, $mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $ADMIN_FOOTER, $e107;
+global $eTraffic, $error_handler, $db_time, $sql, $mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $ADMIN_FOOTER, $e107, $pref;
 
 //
 // SHUTDOWN SEQUENCE
diff -x .svn -aruN 0.7.11.src/e107_admin/frontpage.php 0.7.12.src/e107_admin/frontpage.php
--- 0.7.11.src/e107_admin/frontpage.php	2007-07-08 16:08:18.000000000 -0500
+++ 0.7.12.src/e107_admin/frontpage.php	2008-04-04 16:40:50.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/frontpage.php,v $
-|     $Revision: 1.24 $
-|     $Date: 2007/07/08 21:08:18 $
+|     $Revision: 1.25 $
+|     $Date: 2008/04/04 21:40:50 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -242,7 +242,7 @@
 		<td class='forumheader3'>".$rs -> form_radio('frontpage', 'other', (!$not_other ? TRUE : FALSE))."</td>
 		<td style='width: 50%' class='forumheader3'>".FRTLAN_15."</td>
 		<td style='width: 50%' class='forumheader3'>
-		".$rs -> form_text('other_page', 50, (!$not_other ? $current_setting : ''))."
+		".$rs -> form_text('other_page', 50, (!$not_other ? $current_setting : ''), 150)."
 		</td>
 		</tr>";
 
diff -x .svn -aruN 0.7.11.src/e107_admin/header.php 0.7.12.src/e107_admin/header.php
--- 0.7.11.src/e107_admin/header.php	2007-05-17 15:14:45.000000000 -0500
+++ 0.7.12.src/e107_admin/header.php	2008-05-23 16:14:30.000000000 -0500
@@ -12,8 +12,8 @@
 |        GNU General Public License (http://gnu.org).
 |
 |   $Source: /cvsroot/e107/e107_0.7/e107_admin/header.php,v $
-|   $Revision: 1.61 $
-|   $Date: 2007/05/17 20:14:45 $
+|   $Revision: 1.62 $
+|   $Date: 2008/05/23 21:14:30 $
 |   $Author: e107steved $
 +---------------------------------------------------------------+
 */
@@ -140,7 +140,7 @@
 	echo "<script type='text/javascript' src='".e_FILE_ABS."e107.js'></script>\n";
 }
 	if (file_exists(THEME.'theme.js')) { echo "<script type='text/javascript' src='".THEME_ABS."theme.js'></script>\n"; }
-	if (filesize(e_FILE.'user.js')) { echo "<script type='text/javascript' src='".e_FILE_ABS."user.js'></script>\n"; }
+	if (is_readable(e_FILE.'user.js') && filesize(e_FILE.'user.js')) { echo "<script type='text/javascript' src='".e_FILE_ABS."user.js'></script>\n"; }
 
 if (isset($eplug_js) && $eplug_js) {
 	echo "\n<!-- eplug_js -->\n";
diff -x .svn -aruN 0.7.11.src/e107_admin/lancheck.php 0.7.12.src/e107_admin/lancheck.php
--- 0.7.11.src/e107_admin/lancheck.php	2007-11-02 17:01:44.000000000 -0500
+++ 0.7.12.src/e107_admin/lancheck.php	2008-01-04 13:57:13.000000000 -0600
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/lancheck.php,v $
-|     $Revision: 1.27 $
-|     $Date: 2007/11/02 22:01:44 $
+|     $Revision: 1.28 $
+|     $Date: 2008/01/04 19:57:13 $
 |     $Author: e107steved $
 |	  With code from Izydor and Lolo.
 +----------------------------------------------------------------------------+
@@ -606,7 +606,7 @@
 				$rep = array(");","\n",'""');
 				$val = str_replace($rep,"",$pos);
 				$retloc[$type]['LC_ALL']= $val;
-				$retloc['orig']['LC_ALL']= "'en'";
+//				$retloc['orig']['LC_ALL']= "'en'";
 			}
 			else
 			{
diff -x .svn -aruN 0.7.11.src/e107_admin/language.php 0.7.12.src/e107_admin/language.php
--- 0.7.11.src/e107_admin/language.php	2007-09-20 16:36:44.000000000 -0500
+++ 0.7.12.src/e107_admin/language.php	2008-04-01 15:03:13.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/language.php,v $
-|     $Revision: 1.40 $
-|     $Date: 2007/09/20 21:36:44 $
-|     $Author: e107coders $
+|     $Revision: 1.41 $
+|     $Date: 2008/04/01 20:03:13 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("../class2.php");
@@ -320,7 +320,7 @@
 
     while (list($temp) = mysql_fetch_array($tables))
     {
-        if((strpos($temp, MPREFIX) === 0) || MPREFIX=='')
+        if ((MPREFIX=='') ||(strpos($temp, MPREFIX) === 0))
         {
             $e107tab = str_replace(MPREFIX, "", $temp);
             if (!in_array($e107tab, $exclude) && stristr($e107tab, "lan_") === FALSE)
diff -x .svn -aruN 0.7.11.src/e107_admin/links.php 0.7.12.src/e107_admin/links.php
--- 0.7.11.src/e107_admin/links.php	2007-10-13 14:08:21.000000000 -0500
+++ 0.7.12.src/e107_admin/links.php	2008-07-10 15:37:03.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/links.php,v $
-|     $Revision: 1.70 $
-|     $Date: 2007/10/13 19:08:21 $
+|     $Revision: 1.72 $
+|     $Date: 2008/07/10 20:37:03 $
 |     $Author: e107steved $
 |
 | links.php?debug shows stored data for each link after name (before constant conversion)
@@ -20,8 +20,10 @@
 */
 
 require_once('../class2.php');
-if (!getperms('I')) {
-	header('location:'.e_BASE.'index.php');
+if (!getperms('I')) 
+{
+  header('location:'.e_BASE.'index.php');
+  exit;
 }
 
 $e_sub_cat = 'links';
@@ -549,12 +551,15 @@
 	}
 
 
-	function submit_link($sub_action, $id) {
+	function submit_link($sub_action, $id) 
+	{
 		global $sql, $e107cache, $tp;
-		if(!is_object($tp)) {
-			$tp=new e_parse;
+		if(!is_object($tp)) 
+		{
+		  $tp=new e_parse;
 		}
 
+		$id = intval($id);
 		$parent_id = ($_POST['link_parent']) ? intval($_POST['link_parent']) : 0;
 
 		$link_name = $tp->toDB($_POST['link_name']);
@@ -563,19 +568,24 @@
 
 		$link_description = $tp->toDB($_POST['link_description']);
 		$link_button = $tp->toDB($_POST['link_button']);
+		$link_render = intval($_POST['linkrender']);
+		$link_open = intval($_POST['linkopentype']);
+		$link_class = $tp->toDB($_POST['link_class']);
 
 		$link_t = $sql->db_Count("links", "(*)");
-		if ($id) {
-			$sql->db_Update("links", "link_parent='$parent_id', link_name='$link_name', link_url='$link_url', link_description='$link_description', link_button= '$link_button', link_category='".$_POST['linkrender']."', link_open='".$_POST['linkopentype']."', link_class='".$_POST['link_class']."' WHERE link_id='$id'");
+		if ($id) 
+		{
+		  $sql->db_Update("links", "link_parent='{$parent_id}', link_name='{$link_name}', link_url='{$link_url}', link_description='{$link_description}', link_button= '{$link_button}', link_category='{$link_render}', link_open='{$link_open}', link_class='{$link_class}' WHERE link_id='{$id}'");
 			//rename all sublinks to eliminate old embedded 'submenu' etc hierarchy.
 		    // this is for upgrade compatibility only. Current hierarchy uses link_parent.
-
-			$e107cache->clear("sitelinks");
-			$this->show_message(LCLAN_3);
-		} else {
-			$sql->db_Insert("links", "0, '$link_name', '$link_url', '$link_description', '$link_button', ".$_POST['linkrender'].", ".($link_t+1).", ".$parent_id.", ".$_POST['linkopentype'].", ".$_POST['link_class']);
-			$e107cache->clear("sitelinks");
-			$this->show_message(LCLAN_2);
+		  $e107cache->clear("sitelinks");
+		  $this->show_message(LCLAN_3);
+		} 
+		else 
+		{
+		  $sql->db_Insert("links", "0, '$link_name', '$link_url', '$link_description', '$link_button', ".$link_render.", ".($link_t+1).", ".$parent_id.", ".$link_open.", ".$link_class);
+		  $e107cache->clear("sitelinks");
+		  $this->show_message(LCLAN_2);
 		}
 	}
 
diff -x .svn -aruN 0.7.11.src/e107_admin/mailout.php 0.7.12.src/e107_admin/mailout.php
--- 0.7.11.src/e107_admin/mailout.php	2007-10-28 08:03:16.000000000 -0500
+++ 0.7.12.src/e107_admin/mailout.php	2008-07-28 16:33:20.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/mailout.php,v $
-|     $Revision: 1.62 $
-|     $Date: 2007/10/28 13:03:16 $
+|     $Revision: 1.64 $
+|     $Date: 2008/07/28 21:33:20 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -41,10 +41,13 @@
 		require_once(e_HANDLER."mail.php");
 		$add = ($pref['mailer']) ? " (".strtoupper($pref['mailer']).")" : " (PHP)";
 		$sendto = trim($_POST['testaddress']);
-		if (!sendemail($sendto, PRFLAN_66." ".SITENAME.$add, PRFLAN_67,USERNAME)) {
-			$message = ($pref['mailer'] == "smtp")  ? PRFLAN_75 : PRFLAN_68;
-		} else {
-			$message = PRFLAN_69. "(".$sendto.")";
+		if (!sendemail($sendto, PRFLAN_66." ".SITENAME.$add, PRFLAN_67,MAILAN_68)) 
+		{
+		  $message = ($pref['mailer'] == "smtp")  ? PRFLAN_75 : PRFLAN_68;
+		} 
+		else 
+		{
+		  $message = PRFLAN_69. "(".$sendto.")";
 		}
 	}
 }
@@ -524,7 +527,7 @@
 	<div id='mail' style='text-align:center;'>
 	<table style='".ADMIN_WIDTH."' class='fborder'>
 	<tr>
-	<td style='width:30%' class='forumheader3'><span title='".PRFLAN_64."' style='cursor:help'>".PRFLAN_63."</span><br /></td>
+	<td style='width:30%' class='forumheader3'>".PRFLAN_63."<br /></td>
 	<td style='width:70%; text-align:right' class='forumheader3'><input class='button' type='submit' name='testemail' value=\"".PRFLAN_65."\" />
 	<input name='testaddress' class='tbox' type='text' value=\"".SITEADMINEMAIL."\" />
 	</td>
diff -x .svn -aruN 0.7.11.src/e107_admin/newspost.php 0.7.12.src/e107_admin/newspost.php
--- 0.7.11.src/e107_admin/newspost.php	2007-10-26 16:50:57.000000000 -0500
+++ 0.7.12.src/e107_admin/newspost.php	2008-06-15 15:20:28.000000000 -0500
@@ -11,8 +11,8 @@
 |        GNU General Public License (http://gnu.org).
 |
 |   $Source: /cvsroot/e107/e107_0.7/e107_admin/newspost.php,v $
-|   $Revision: 1.146 $
-|   $Date: 2007/10/26 21:50:57 $
+|   $Revision: 1.148 $
+|   $Date: 2008/06/15 20:20:28 $
 |   $Author: e107steved $
 +---------------------------------------------------------------+
 
@@ -85,6 +85,7 @@
 	list($delete, $del_id) = explode("_", $tmp[0]);
 }
 
+
 if ($delete == "main" && $del_id)
 {
 	if ($sql->db_Count('news','(*)',"WHERE news_id = '{$del_id}'"))
@@ -103,6 +104,7 @@
 	unset($delete, $del);
 }
 
+
 if ($delete == "category" && $del_id) {
 	if ($sql->db_Delete("news_category", "category_id='$del_id' ")) {
 		$newspost->show_message(NWSLAN_33." #".$del_id." ".NWSLAN_32);
@@ -110,6 +112,7 @@
 	}
 }
 
+
 if($delete == "sn" && $del_id)
 {
 	if ($sql->db_Delete("submitnews", "submitnews_id='$del_id' "))
@@ -122,7 +125,9 @@
 	}
 }
 
-if (isset($_POST['submitupload'])) {
+
+if (isset($_POST['submitupload'])) 
+{
 	$pref['upload_storagetype'] = "1";
 	require_once(e_HANDLER."upload_handler.php");
 
@@ -144,15 +149,18 @@
 	}
 }
 
+
 // required.
-if (isset($_POST['preview'])) {
+if (isset($_POST['preview'])) 
+{
 	$_POST['news_title'] = $tp->toDB($_POST['news_title']);
 	$_POST['news_summary'] = $tp->toDB($_POST['news_summary']);
 	$newspost->preview_item($id);
 }
 
-if (isset($_POST['submit_news'])) {
 
+if (isset($_POST['submit_news'])) 
+{
 	$newspost->submit_item($sub_action, $id);
 	$e107cache->clear("news.php");
 	$e107cache->clear("othernews");
@@ -191,14 +199,11 @@
 	$e107cache->clear("othernews2");
 }
 
-if (isset($_POST['save_prefs'])) {
+if (isset($_POST['save_prefs'])) 
+{
 	$pref['newsposts'] = $_POST['newsposts'];
-
-	// ##### ADDED FOR NEWS ARCHIVE --------------------------------------------------------------------
 	$pref['newsposts_archive'] = $_POST['newsposts_archive'];
 	$pref['newsposts_archive_title'] = $tp->toDB($_POST['newsposts_archive_title']);
-	// ##### END --------------------------------------------------------------------------------------
-
 	$pref['news_cats'] = $_POST['news_cats'];
 	$pref['nbr_cols'] = $_POST['nbr_cols'];
 	$pref['subnews_attach'] = $_POST['subnews_attach'];
@@ -207,10 +212,6 @@
 	$pref['subnews_htmlarea'] = $_POST['subnews_htmlarea'];
 	$pref['subnews_hide_news'] = $_POST['subnews_hide_news'];
 	$pref['news_subheader'] = $tp->toDB($_POST['news_subheader']);
-	/*
-	changes by jalist 22/01/2005:
-	added pref to render new date header
-	*/
 	$pref['news_newdateheader'] = $_POST['news_newdateheader'];
 	$pref['news_unstemplate'] = $_POST['news_unstemplate'];
 
@@ -226,11 +227,14 @@
   $newspost->show_existing_items($action, $sub_action, $sort_order, $from, $amount);
 }
 
-if ($action == "create") {
+if ($action == "create") 
+{
 	$preset = $pst->read_preset("admin_newspost");  //only works here because $_POST is used.
 
-	if ($sub_action == "edit" && !$_POST['preview'] && !$_POST['submit_news']) {
-		if ($sql->db_Select("news", "*", "news_id='$id' ")) {
+  if ($sub_action == "edit" && !$_POST['preview'] && !$_POST['submit_news']) 
+  {
+		if ($sql->db_Select("news", "*", "news_id='$id' "))
+		{
 			$row = $sql->db_Fetch();
 			extract($row);
 			$_POST['news_title'] = $news_title;
@@ -248,24 +252,33 @@
 			$_POST['comment_total'] = $sql->db_Count("comments", "(*)", " WHERE comment_item_id='$news_id' AND comment_type='0' ");
 			$_POST['news_rendertype'] = $news_render_type;
 			$_POST['news_thumbnail'] = $news_thumbnail;
-
 		}
 	}
 	$newspost->create_item($sub_action, $id);
 }
 
-if ($action == "cat") {
+
+
+if ($action == "cat") 
+{
 	$newspost->show_categories($sub_action, $id);
 }
 
-if ($action == "sn") {
+
+
+if ($action == "sn") 
+{
 	$newspost->submitted_news($sub_action, $id);
 }
 
-if ($action == "pref") {
+
+
+if ($action == "pref") 
+{
 	$newspost->show_news_prefs($sub_action, $id);
 }
 
+
 echo "
 <script type=\"text/javascript\">
 function fclear() {
@@ -277,6 +290,10 @@
 require_once("footer.php");
 exit;
 
+
+
+
+
 class newspost 
 {
 
@@ -393,16 +410,19 @@
 	function create_item($sub_action, $id)
 	{
 		global $cal;
-		// ##### Display creation form ---------------------------------------------------------------------------------------------------------
-		/* 08-08-2004 - unknown - fixed `Insert Image' display to use $IMAGES_DIRECTORY */
+	  // ##### Display creation form 
 		global $sql, $rs, $ns, $pref, $tp, $pst, $e107;
 
-		if ($sub_action == "sn" && !$_POST['preview']) {
-			if ($sql->db_Select("submitnews", "*", "submitnews_id=$id", TRUE)) {
+	  if ($sub_action == "sn" && !$_POST['preview']) 
+	  {
+		if ($sql->db_Select("submitnews", "*", "submitnews_id=$id", TRUE)) 
+		{
 				list($id, $submitnews_name, $submitnews_email, $_POST['news_title'], $submitnews_category, $_POST['data'], $submitnews_datestamp, $submitnews_ip, $submitnews_auth, $submitnews_file) = $sql->db_Fetch();
 
 				if (e_WYSIWYG)
 				{
+				  if (substr($_POST['data'],-7,7) == '[/html]') $_POST['data'] = substr($_POST['data'],0,-7);
+				  if (substr($_POST['data'],0,6) == '[html]') $_POST['data'] = substr($_POST['data'],6);
 					$_POST['data'] .= "<br /><b>".NWSLAN_49." ".$submitnews_name."</b>";
 					$_POST['data'] .= ($submitnews_file)? "<br /><br /><img src='{e_IMAGE}newspost_images/".$submitnews_file."' style='float:right; margin-left:5px;margin-right:5px;margin-top:5px;margin-bottom:5px; border:1px solid' />":	"";
 				}
@@ -415,7 +435,8 @@
 			}
 		}
 
-		if ($sub_action == "upload" && !$_POST['preview']) {
+	  if ($sub_action == "upload" && !$_POST['preview']) 
+	  {
 			if ($sql->db_Select("upload", "*", "upload_id=$id")) {
 				$row = $sql->db_Fetch();
 				extract($row);
@@ -455,14 +476,14 @@
 		<tr>
 		<td style='width:20%' class='forumheader3'>".NWSLAN_12.":</td>
 		<td style='width:80%' class='forumheader3'>
-		<input class='tbox' type='text' name='news_title' size='80' value='".$_POST['news_title']."' maxlength='200' style='width:95%'/>
+		<input class='tbox' type='text' name='news_title' size='80' value='".$tp->post_toForm($_POST['news_title'])."' maxlength='200' style='width:95%'/>
 		</td>
 		</tr>
 
 		<tr>
 		<td style='width:20%' class='forumheader3'>".LAN_NEWS_27.":</td>
 		<td style='width:80%' class='forumheader3'>
-		<input class='tbox' type='text' name='news_summary' size='80' value='".$tp->toForm($_POST['news_summary'])."' maxlength='250' style='width:95%'/>
+		<input class='tbox' type='text' name='news_summary' size='80' value='".$tp->post_toForm($_POST['news_summary'])."' maxlength='250' style='width:95%'/>
 		</td>
 		</tr>
 
@@ -1073,40 +1094,46 @@
 
 
 
-	function submitted_news($sub_action, $id) {
+	function submitted_news($sub_action, $id) 
+	{
 		global $rs, $ns, $tp;
 		$sql2 = new db;
 		$text = "<div style='text-align: center'>";
-		if ($category_total = $sql2->db_Select("submitnews", "*", "submitnews_id !='' ORDER BY submitnews_id DESC")) {
-			$text .= "<table class='fborder' style='".ADMIN_WIDTH."'>
+		if ($category_total = $sql2->db_Select("submitnews", "*", "submitnews_id !='' ORDER BY submitnews_id DESC")) 
+		{
+		  $text .= "<table class='fborder' style='".ADMIN_WIDTH."'>
 			<tr>
 			<td style='width:5%' class='fcaption'>ID</td>
 			<td style='width:70%' class='fcaption'>".NWSLAN_57."</td>
 			<td style='width:25%; text-align:center' class='fcaption'>".LAN_OPTIONS."</td>
 			</tr>";
-			while ($row = $sql2->db_Fetch()) {
-				extract($row);
-				$text .= "<tr>
+		  while ($row = $sql2->db_Fetch()) 
+		  {
+			extract($row);
+			if (substr($submitnews_item,-7,7) == '[/html]') $submitnews_item = substr($submitnews_item,0,-7);
+			if (substr($submitnews_item,0,6) == '[html]') $submitnews_item = substr($submitnews_item,6);
+			$text .= "<tr>
 				<td style='width:5%; text-align:center; vertical-align:top' class='forumheader3'>$submitnews_id</td>
 				<td style='width:70%' class='forumheader3'>";
-				$text .= ($submitnews_auth == 0)? "<b>".$tp->toHTML($submitnews_title,FALSE,"emotes_off, no_make_clickable")."</b>": $tp->toHTML($submitnews_title,FALSE,"emotes_off, no_make_clickable");
-				$text .= " [ ".NWSLAN_104." ".$submitnews_name." ".NWSLAN_108." ".date("D dS M y, g:ia", $submitnews_datestamp)."]<br />".$tp->toHTML($submitnews_item)."</td>
+			$text .= ($submitnews_auth == 0)? "<b>".$tp->toHTML($submitnews_title,FALSE,"emotes_off, no_make_clickable")."</b>": $tp->toHTML($submitnews_title,FALSE,"emotes_off, no_make_clickable");
+			$text .= " [ ".NWSLAN_104." ".$submitnews_name." ".NWSLAN_108." ".date("D dS M y, g:ia", $submitnews_datestamp)."]<br />".$tp->toHTML($submitnews_item)."</td>
 				<td style='width:25%; text-align:right; vertical-align:top' class='forumheader3'>";
-				$buttext = ($submitnews_auth == 0)? NWSLAN_58 :	NWSLAN_103;
-				$text .= $rs->form_open("post", e_SELF."?sn", "myform__{$submitnews_id}", "", "", " onsubmit=\"return jsconfirm('".$tp->toJS(NWSLAN_38." [ID: $submitnews_id ]")."')\"   ")
+			$buttext = ($submitnews_auth == 0)? NWSLAN_58 :	NWSLAN_103;
+			$text .= $rs->form_open("post", e_SELF."?sn", "myform__{$submitnews_id}", "", "", " onsubmit=\"return jsconfirm('".$tp->toJS(NWSLAN_38." [ID: $submitnews_id ]")."')\"   ")
 				."<div>".$rs->form_button("button", "category_edit_{$submitnews_id}", $buttext, "onclick=\"document.location='".e_SELF."?create.sn.$submitnews_id'\"")."
 				".$rs->form_button("submit", "delete[sn_{$submitnews_id}]", LAN_DELETE)."
 				</div>".$rs->form_close()."
 				</td>
 				</tr>\n";
-			}
-			$text .= "</table>";
-			} else {
-			$text .= "<div style='text-align:center'>".NWSLAN_59."</div>";
+		  }
+		  $text .= "</table>";
+		}
+		else 
+		{
+		  $text .= "<div style='text-align:center'>".NWSLAN_59."</div>";
 		}
 		$text .= "</div>";
 		$ns->tablerender(NWSLAN_47, $text);
-
 	}
 
 }
diff -x .svn -aruN 0.7.11.src/e107_admin/notify.php 0.7.12.src/e107_admin/notify.php
--- 0.7.11.src/e107_admin/notify.php	2006-09-16 13:18:04.000000000 -0500
+++ 0.7.12.src/e107_admin/notify.php	2008-04-04 16:40:50.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/notify.php,v $
-|     $Revision: 1.13 $
-|     $Date: 2006/09/16 18:18:04 $
-|     $Author: e107coders $
+|     $Revision: 1.14 $
+|     $Date: 2008/04/04 21:40:50 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once('../class2.php');
@@ -145,7 +145,7 @@
 		<input type='radio' name='event[".$id."][type]' value='class' ".($this -> notify_prefs['event'][$id]['type'] == 'class' ? " checked='checked'" : "")." /> ".NT_LAN_5.":
 		".r_userclass('event['.$id.'][class]', $this -> notify_prefs['event'][$id]['class'], 'off', 'member,admin,classes')."
 		<input type='radio' name='event[".$id."][type]' value='email' ".($this -> notify_prefs['event'][$id]['type'] == 'email' ? " checked='checked'" : "")." /> ".NT_LAN_6.":
-		".$rs -> form_text('event['.$id.'][email]', 17, $tp -> toForm($this -> notify_prefs['event'][$id]['email']))."
+		".$rs -> form_text('event['.$id.'][email]', 40, $tp -> toForm($this -> notify_prefs['event'][$id]['email']), 150)."
 		</td>
 		</tr>";
 		return $text;
diff -x .svn -aruN 0.7.11.src/e107_admin/plugin.php 0.7.12.src/e107_admin/plugin.php
--- 0.7.11.src/e107_admin/plugin.php	2007-05-30 15:35:41.000000000 -0500
+++ 0.7.12.src/e107_admin/plugin.php	2008-04-05 02:58:28.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/plugin.php,v $
-|     $Revision: 1.73 $
-|     $Date: 2007/05/30 20:35:41 $
+|     $Revision: 1.74 $
+|     $Date: 2008/04/05 07:58:28 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -429,9 +429,12 @@
 $text .= render_plugs($uninstalled);
 
 
-function render_plugs($pluginList){
+function render_plugs($pluginList)
+{
 	global $tp;
 
+	if (empty($pluginList)) return '';
+
 	foreach($pluginList as $plug) {
 	//Unset any possible eplug_ variables set by last plugin.php
 		$defined_vars = array_keys(get_defined_vars());
diff -x .svn -aruN 0.7.11.src/e107_admin/prefs.php 0.7.12.src/e107_admin/prefs.php
--- 0.7.11.src/e107_admin/prefs.php	2007-11-07 16:34:38.000000000 -0600
+++ 0.7.12.src/e107_admin/prefs.php	2008-06-29 11:40:23.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/prefs.php,v $
-|     $Revision: 1.103 $
-|     $Date: 2007/11/07 22:34:38 $
+|     $Revision: 1.104 $
+|     $Date: 2008/06/29 16:40:23 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -693,7 +693,7 @@
 	<tr>
 	<td class='forumheader3' style='width:50%;'>".PRFLAN_131.":  <div class='smalltext'>".PRFLAN_132."</div></td>
 	<td class='forumheader3' style='width:50%; text-align: right;'>
-	".r_userclass('php_bbcode',$pref['php_bbcode'],'off','nobody,admin,classes')."
+	".r_userclass('php_bbcode',$pref['php_bbcode'],'off','nobody,admin,main,classes')."
 	</td>
 	</tr>\n
 
diff -x .svn -aruN 0.7.11.src/e107_admin/userclass.php 0.7.12.src/e107_admin/userclass.php
--- 0.7.11.src/e107_admin/userclass.php	2006-02-16 08:25:46.000000000 -0600
+++ 0.7.12.src/e107_admin/userclass.php	2008-04-04 16:03:51.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/userclass.php,v $
-|     $Revision: 1.12 $
-|     $Date: 2006/02/16 14:25:46 $
-|     $Author: whoisrich $
+|     $Revision: 1.13 $
+|     $Date: 2008/04/04 21:03:51 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("../class2.php");
@@ -41,7 +41,8 @@
 	}
 }
 
-if (isset($_POST['updateclass'])) {
+if (isset($_POST['updateclass'])) 
+{
 	$remuser = TRUE;
 	$classcount = count($_POST['userclass'])-1;
 	for($a = 0; $a <= $classcount; $a++) {
@@ -53,15 +54,19 @@
         $message = UCSLAN_9;
 	$sql->db_Select("user", "*", "user_id='$id' ");
 	$row = $sql->db_Fetch();
-	if ($_POST['notifyuser']) {
+	if ($_POST['notifyuser']) 
+	{
 		$message .= "<br />".UCSLAN_1.":</b> ".$row['user_name']."<br />";
 		require_once(e_HANDLER."mail.php");
-   		unset($messaccess);
-		for($a = 0; $a <= (count($class)-1); $a++) {
-			if (check_class($class[$a][0], $row['user_class'])) {
-				$messaccess .= $class[$a][1]." - " . $class[$a][2]. "\n";
-			}
+		$messaccess = '';
+		for($a = 0; $a <= (count($class)-1); $a++) 
+		{
+		  if (check_class($class[$a][0], $row['user_class'])) 
+		  {
+			$messaccess .= $class[$a][1]." - " . $class[$a][2]. "\n";
+		  }
 		}
+		if ($messaccess == '') $messaccess = UCSLAN_12."\n";
 		$send_to = $row['user_email'];
 		$subject = UCSLAN_2;
         $message = UCSLAN_3." " . $row['user_name']. ",\n\n".UCSLAN_4." ".SITENAME."\n( ".SITEURL . " )\n\n".UCSLAN_5.": \n\n".$messaccess."\n".UCSLAN_10."\n".SITEADMIN."\n( ".SITENAME." )";
diff -x .svn -aruN 0.7.11.src/e107_admin/userclass2.php 0.7.12.src/e107_admin/userclass2.php
--- 0.7.11.src/e107_admin/userclass2.php	2006-12-24 07:27:24.000000000 -0600
+++ 0.7.12.src/e107_admin/userclass2.php	2008-07-09 15:37:22.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/userclass2.php,v $
-|     $Revision: 1.22 $
-|     $Date: 2006/12/24 13:27:24 $
-|     $Author: mrpete $
+|     $Revision: 1.23 $
+|     $Date: 2008/07/09 20:37:22 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("../class2.php");
@@ -237,7 +237,7 @@
 
 if(isset($_POST['edit']))
 {
-	$sql->db_Select("user", "user_id, user_name, user_class, user_login", "ORDER BY user_name", "no-where");
+	$sql->db_Select("user", "user_id, user_name, user_class, user_login", "user_ban != 1 ORDER BY user_name ");
 	$c = 0;
 	$d = 0;
 	while ($row = $sql->db_Fetch())
diff -x .svn -aruN 0.7.11.src/e107_admin/users.php 0.7.12.src/e107_admin/users.php
--- 0.7.11.src/e107_admin/users.php	2007-11-01 17:01:29.000000000 -0500
+++ 0.7.12.src/e107_admin/users.php	2008-06-06 14:14:14.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/users.php,v $
-|     $Revision: 1.92 $
-|     $Date: 2007/11/01 22:01:29 $
+|     $Revision: 1.94 $
+|     $Date: 2008/06/06 19:14:14 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -55,16 +55,17 @@
 
 $rs = new form;
 
-if (e_QUERY) {
+if (e_QUERY) 
+{
 	$tmp = explode(".", e_QUERY);
 	$action = $tmp[0];
-	$sub_action = $tmp[1];
-	$id = $tmp[2];
-	$from = ($tmp[3] ? $tmp[3] : 0);
+  $sub_action = varset($tmp[1],'');
+  $id = varset($tmp[2],0);
+  $from = varset($tmp[3],0);
 	unset($tmp);
 }
 
-$from = (isset($from)) ? $from : 0;
+$from = varset($from, 0);
 $amount = 30;
 
 
@@ -248,7 +249,7 @@
   //	$sub_action = $_POST['userid'];
 	$sql->db_Select("user", "*", "user_id='".$_POST['userid']."'");
 	$row = $sql->db_Fetch();
-	if ($row['user_perms'] == "0")
+	if (($row['user_perms'] == "0") || ($row['user_perms'] == "0."))
 	{
 		$user->show_message(USRLAN_7);
 	}
@@ -265,7 +266,7 @@
 		else
 		{
 			if($sql->db_Count("user", "(*)", "WHERE user_ip = '{$row['user_ip']}'") > 1)
-			{
+		  {	// Multiple users have same IP address
 				$user->show_message(str_replace("{IP}", $row['user_ip'], USRLAN_136));
 			}
 			else
@@ -293,7 +294,8 @@
 }
 
 // ------- Resend Email Confirmation. --------------
-if (isset($_POST['useraction']) && $_POST['useraction'] == 'resend') {
+if (isset($_POST['useraction']) && $_POST['useraction'] == 'resend') 
+{
 	$qry = (e_QUERY) ? "?".e_QUERY : "";
 	if ($sql->db_Select("user", "*", "user_id='".$_POST['userid']."' ")) {
 		$resend = $sql->db_Fetch();
@@ -311,8 +313,13 @@
 		exit;
 	}
 }
+
+
+
+
 // ------- TEst Email confirmation. --------------
-if (isset($_POST['useraction']) && $_POST['useraction'] == 'test') {
+if (isset($_POST['useraction']) && $_POST['useraction'] == 'test') 
+{
 	$qry = (e_QUERY) ? "?".e_QUERY : "";
 	if ($sql->db_Select("user", "*", "user_id='".$_POST['userid']."' ")) {
 		$test = $sql->db_Fetch();
@@ -327,6 +334,10 @@
 		exit;
 	}
 }
+
+
+
+
 // ------- Delete User --------------
 if (isset($_POST['useraction']) && $_POST['useraction'] == 'deluser') {
 	if ($_POST['confirm']) {
@@ -336,8 +347,9 @@
 		}
 		if(!$sub_action){ $sub_action = "user_id"; }
 		if(!$id){ $id = "DESC"; }
-
-	} else {
+  } 
+  else 
+  {	// Put up confirmation
 		if ($sql->db_Select("user", "*", "user_id='".$_POST['userid']."' ")) {
 			$row = $sql->db_Fetch();
 			$qry = (e_QUERY) ? "?".e_QUERY : "";
@@ -372,13 +384,17 @@
 }
 
 // ------- Remove Admin --------------
-if (isset($_POST['useraction']) && $_POST['useraction'] == "unadmin" && getperms('3')) {
+if (isset($_POST['useraction']) && $_POST['useraction'] == "unadmin" && getperms('3')) 
+{
 	$sql->db_Select("user", "*", "user_id='".$_POST['userid']."'");
 	$row = $sql->db_Fetch();
 	 extract($row);
-	if ($user_perms == "0") {
+  if ($user_perms == "0") 
+  {
 		$user->show_message(USRLAN_5);
-	} else {
+  } 
+  else 
+  {
 		$sql->db_Update("user", "user_admin='0', user_perms='' WHERE user_id='".$_POST['userid']."'");
 		$user->show_message($user_name." ".USRLAN_6);
 	$action = "main";
@@ -387,6 +403,9 @@
 	}
 }
 
+
+
+
 // ------- Approve User. --------------
 if (isset($_POST['useraction']) && $_POST['useraction'] == "verify")
 {
@@ -421,12 +440,14 @@
 	}
 }
 
-if (isset($action) && $action == "uset") {
+if (isset($action) && $action == "uset") 
+{
 	$user->show_message(USRLAN_87);
 	$action = "main";
 }
 
-if (isset($action) && $action == "cu") {
+if (isset($action) && $action == "cu") 
+{
 	$user->show_message(USRLAN_88);
 	$action = "main";
   //	$sub_action = "user_id";
@@ -502,7 +523,7 @@
 
 		if (isset($_POST['searchquery']) && $_POST['searchquery'] != "")
 		{
-			$_POST['searchquery'] = trim($_POST['searchquery']);
+			$_POST['searchquery'] = $tp->toDB(trim($_POST['searchquery']));
       $query = "WHERE ".
 			$query .= (strpos($_POST['searchquery'], "@") !== FALSE) ? "user_email REGEXP('".$_POST['searchquery']."') OR ": "";
 			$query .= (strpos($_POST['searchquery'], ".") !== FALSE) ? "user_ip REGEXP('".$_POST['searchquery']."') OR ": "";
@@ -537,7 +558,7 @@
 
 
 // Search Display Column header.
-	$display_lan = array('user_id' => DUSRLAN_1,
+	$display_lan = array(
 	'user_id' => DUSRLAN_1,
 	'user_name' => DUSRLAN_2,
 	'user_loginname' => DUSRLAN_3,
@@ -799,8 +820,10 @@
 
 	}
 
-	function show_options($action) {
 
+
+	function show_options($action) 
+	{
 		global $unverified;
 		// ##### Display options 
 		if ($action == "") 
diff -x .svn -aruN 0.7.11.src/e107_admin/users_extended.php 0.7.12.src/e107_admin/users_extended.php
--- 0.7.11.src/e107_admin/users_extended.php	2007-04-14 12:24:06.000000000 -0500
+++ 0.7.12.src/e107_admin/users_extended.php	2008-04-06 16:37:41.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/users_extended.php,v $
-|     $Revision: 1.44 $
-|     $Date: 2007/04/14 17:24:06 $
+|     $Revision: 1.45 $
+|     $Date: 2008/04/06 21:37:41 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -43,13 +43,14 @@
 
 
 $ue = new e107_user_extended;
+$message = '';
 
 if (e_QUERY)
 {
 	$tmp = explode(".", e_QUERY);
 	$action = $tmp[0];
-	$sub_action = $tmp[1];
-	$id = $tmp[2];
+	$sub_action = varset($tmp[1],'');
+	$id = varset($tmp[2],0);
 	unset($tmp);
 }
 
@@ -65,6 +66,7 @@
 	$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order-1 WHERE user_extended_struct_type > 0 AND user_extended_struct_parent = {$_parent} AND user_extended_struct_id='".$_id."'");
 }
 
+
 if (isset($_POST['down_x']))
 {
 	$qs = explode(".", $_POST['id']);
@@ -85,6 +87,7 @@
 	$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order-1 WHERE user_extended_struct_type = 0 AND user_extended_struct_id='".$_id."'");
 }
 
+
 if (isset($_POST['catdown_x']))
 {
 	$qs = explode(".", $_POST['id']);
@@ -94,6 +97,7 @@
 	$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order+1 WHERE user_extended_struct_type = 0 AND user_extended_struct_id='".$_id."'");
 }
 
+
 if (isset($_POST['add_field']))
 {
   $ue_field_name = str_replace(' ','_',trim($_POST['user_field']));		// Replace space with underscore - better security
@@ -126,7 +130,9 @@
   }
 }
 
-if (isset($_POST['update_field'])) {
+
+if (isset($_POST['update_field'])) 
+{
 	if($_POST['user_type']==4){
     	$_POST['user_values'] = array($_POST['table_db'],$_POST['field_id'],$_POST['field_value'],$_POST['field_order']);
 	}
@@ -135,19 +141,22 @@
 	admin_update($ue->user_extended_modify($sub_action, $_POST['user_field'], $_POST['user_text'], $_POST['user_type'], $upd_parms, $upd_values, $_POST['user_default'], $_POST['user_required'], $_POST['user_read'], $_POST['user_write'], $_POST['user_applicable'], $_POST['user_parent']), 'update', EXTLAN_29);
 }
 
+
 if (isset($_POST['update_category']))
 {
 	$name = trim($tp->toHTML($_POST['user_field']));
 	admin_update($sql->db_Update("user_extended_struct","user_extended_struct_name = '{$name}', user_extended_struct_read = '{$_POST['user_read']}', user_extended_struct_write = '{$_POST['user_write']}', user_extended_struct_applicable = '{$_POST['user_applicable']}' WHERE user_extended_struct_id = '{$sub_action}'"), 'update', EXTLAN_43);
 }
 
+
 if (isset($_POST['add_category']))
 {
 	$name = $tp->toHTML($_POST['user_field']);
 	admin_update($sql->db_Insert("user_extended_struct","'0', '$name', '', 0, '', '', '', '{$_POST['user_read']}', '{$_POST['user_write']}', '0', '0', '{$_POST['user_applicable']}', '0', '0'"), 'insert', EXTLAN_40);
 }
 
-if ($_POST['eu_action'] == "delext")
+
+if (varset($_POST['eu_action'],'') == "delext")
 {
 	list($_id, $_name) = explode(",",$_POST['key']);
 	if($ue->user_extended_remove($_id, $_name))
@@ -157,7 +166,7 @@
 }
 
 // Delete category
-if ($_POST['eu_action'] == "delcat")
+if (varset($_POST['eu_action'],'') == "delcat")
 {
 	list($_id, $_name) = explode(",",$_POST['key']);
 	if (count($ue->user_extended_get_fields($_id)) > 0)
@@ -252,23 +261,24 @@
 class users_ext
 {
 
-	function show_extended($current)
+	function show_extended($current = '')
 	{
-		global $sql, $ns, $ue, $curtype, $tp, $mySQLdefaultdb, $action, $sub_action;
+	  global $sql, $ns, $ue, $curtype, $tp, $mySQLdefaultdb, $action, $sub_action;
+
+	  $catList = $ue->user_extended_get_categories();
+	  $catList[0][0] = array('user_extended_struct_name' => EXTLAN_36);
+	  $catNums = array_keys($catList);
+	  $extendedList = $ue->user_extended_get_fields();
+	  $text = '';
 
-		$catList = $ue->user_extended_get_categories();
-		$catList[0][0] = array('user_extended_struct_name' => EXTLAN_36);
-		$catNums = array_keys($catList);
-		$extendedList = $ue->user_extended_get_fields();
-
-		if(!$current){
-			$text = "<div style='text-align:center'>";
-			$text .= "<table style='".ADMIN_WIDTH."' class='fborder'>
+	  if(!$current)
+	  {	// Show existing fields
+		$text = "<div style='text-align:center'>";
+		$text .= "<table style='".ADMIN_WIDTH."' class='fborder'>
 			<tr>
 			<td class='fcaption'>".EXTLAN_1."</td>
 			<td class='fcaption'>".EXTLAN_2."</td>";
-		//	$text .="<td class='fcaption'>".EXTLAN_3."</td>";
-			$text .="<td class='fcaption'>".EXTLAN_4."</td>
+		$text .="<td class='fcaption'>".EXTLAN_4."</td>
 			<td class='fcaption'>".EXTLAN_5."</td>
 			<td class='fcaption'>".EXTLAN_6."</td>
 			<td class='fcaption'>".EXTLAN_7."</td>
@@ -277,100 +287,107 @@
 			</tr>
 			";
 
-			foreach($catNums as $cn)
+		foreach($catNums as $cn)
+		{
+		  $text .= "
+			<tr>
+			<td class='forumheader' colspan='9' style='text-align:center'>{$catList[$cn][0]['user_extended_struct_name']}</td>
+			</tr>
+			";
+
+		  $i=0;
+		  if(count($extendedList))
+		  {	//	Show current extended fields
+			foreach($extendedList[$cn] as $ext)	
 			{
+			  $fname = "user_".$ext['user_extended_struct_name'];
+			  $uVal = str_replace(chr(1), "", $ext['user_extended_struct_default']);		// Is this right?
+			  $text .= "
+					<tr>
+					<td class='forumheader3'>{$ext['user_extended_struct_name']}<br />[".$tp->toHTML($ext['user_extended_struct_text'], FALSE, "defs")."]</td>
+					<td class='forumheader3'>".$ue->user_extended_edit($ext,$uVal)."</td>
+					<td class='forumheader3'>".($ext['user_extended_struct_required'] == 1 ? LAN_YES : LAN_NO)."</td>
+					<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_applicable'])."</td>
+					<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_read'])."</td>
+					<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_write'])."</td>
+					<td class='forumheader3' style='width:5px'>
+					<form method='post' action='".e_SELF."'>
+					<input type='hidden' name='id' value='{$ext['user_extended_struct_id']}.{$ext['user_extended_struct_order']}.{$ext['user_extended_struct_parent']}' />
+					";
+			  if($i > 0)
+			  {
 				$text .= "
-				<tr>
-				<td class='forumheader' colspan='9' style='text-align:center'>{$catList[$cn][0]['user_extended_struct_name']}</td>
-				</tr>
-				";
-
-				$i=0;
-				if(count($extendedList))
-				{
-					//	Show current extended fields
-					foreach($extendedList[$cn] as $ext)	{
-					$fname = "user_".$ext['user_extended_struct_name'];
-					$uVal = str_replace(chr(1), "", $curVal[$fname]);
-						$text .= "
-						<tr>
-						<td class='forumheader3'>{$ext['user_extended_struct_name']}<br />[".$tp->toHTML($ext['user_extended_struct_text'], FALSE, "defs")."]</td>
-						<td class='forumheader3'>".$ue->user_extended_edit($ext,$uVal)."</td>
-						<td class='forumheader3'>".($ext['user_extended_struct_required'] == 1 ? LAN_YES : LAN_NO)."</td>
-						<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_applicable'])."</td>
-						<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_read'])."</td>
-						<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_write'])."</td>
-						<td class='forumheader3' style='width:5px'>
-						<form method='post' action='".e_SELF."'>
-						<input type='hidden' name='id' value='{$ext['user_extended_struct_id']}.{$ext['user_extended_struct_order']}.{$ext['user_extended_struct_parent']}' />
+						<input type='image' alt='' title='".EXTLAN_26."' src='".e_IMAGE."/admin_images/up.png' name='up' value='{$ext['user_extended_struct_id']}.{$ext['user_extended_struct_order']}.{$ext['user_extended_struct_parent']}' />
 						";
-						if($i > 0){
-							$text .= "
-							<input type='image' alt='' title='".EXTLAN_26."' src='".e_IMAGE."/admin_images/up.png' name='up' value='{$ext['user_extended_struct_id']}.{$ext['user_extended_struct_order']}.{$ext['user_extended_struct_parent']}' />
-							";
-						}
-						if($i <= count($extendedList[$cn])-2)
-						{
-							$text .= "<input type='image' alt='' title='".EXTLAN_25."' src='".e_IMAGE."/admin_images/down.png' name='down' value='{$ext['user_extended_struct_id']}.{$ext['user_extended_struct_order']}.{$ext['user_extended_struct_parent']}' />";
-						}
-						$text .= "
-						</form>
-						</td>
-						<td class='forumheader3' style='width:50px;text-align:center;'>
-						<form method='post' action='".e_SELF."?extended' onsubmit='return confirm(\"".EXTLAN_27."\")'>
-						<a style='text-decoration:none' href='".e_SELF."?editext.{$ext['user_extended_struct_id']}'>".ADMIN_EDIT_ICON."</a>
-						<input type='hidden' name='eu_action' value='delext' />
-						<input type='hidden' name='key' value='{$ext['user_extended_struct_id']},{$ext['user_extended_struct_name']}' />
-						<input type='image' title='".LAN_DELETE."' name='eudel' src='".ADMIN_DELETE_ICON_PATH."' />
-						</form>
-						</td>
-						</tr>
-						";
-						$i++;
-					}
-				}
-				else
-				{
-					$text .= "
-					<tr>
-					<td colspan='8' class='forumheader3' style='text-align:center'>".EXTLAN_28."</td>
+			  }
+			  if($i <= count($extendedList[$cn])-2)
+			  {
+				$text .= "<input type='image' alt='' title='".EXTLAN_25."' src='".e_IMAGE."/admin_images/down.png' name='down' value='{$ext['user_extended_struct_id']}.{$ext['user_extended_struct_order']}.{$ext['user_extended_struct_parent']}' />";
+			  }
+			  $text .= "
+					</form>
+					</td>
+					<td class='forumheader3' style='width:50px;text-align:center;'>
+					<form method='post' action='".e_SELF."?extended' onsubmit='return confirm(\"".EXTLAN_27."\")'>
+					<a style='text-decoration:none' href='".e_SELF."?editext.{$ext['user_extended_struct_id']}'>".ADMIN_EDIT_ICON."</a>
+					<input type='hidden' name='eu_action' value='delext' />
+					<input type='hidden' name='key' value='{$ext['user_extended_struct_id']},{$ext['user_extended_struct_name']}' />
+					<input type='image' title='".LAN_DELETE."' name='eudel' src='".ADMIN_DELETE_ICON_PATH."' />
+					</form>
+					</td>
 					</tr>
 					";
-				}
+			  $i++;
 			}
-			//Show add/edit form
+		  }
+		  else
+		  {
 			$text .= "
-			</table>";
+				<tr>
+				<td colspan='8' class='forumheader3' style='text-align:center'>".EXTLAN_28."</td>
+				</tr>
+				";
+		  }
 		}
-		else
+		//Show add/edit form
+		$text .= "
+		</table>";
+	  }
+	  else
+	  {
+		if($current == 'new')
 		{
-			if($current == 'new')
-			{
-				$current = '';
-			}
-			list($current_include, $current_regex, $current_regexfail, $current_hide) = explode("^,^",$current['user_extended_struct_parms']);
-			$text .= "
+		  $current = array();
+		  $current_include = '';
+		  $current_regex = '';
+		  $current_regexfail = '';
+		  $current_hide = '';
+		}
+		else
+		{	// Editing existing definition
+		  list($current_include, $current_regex, $current_regexfail, $current_hide) = explode("^,^",$current['user_extended_struct_parms']);
+		}
+		$text .= "
 			<form method='post' action='".e_SELF."?".e_QUERY."'>
 			";
-			$text .= "<table style='".ADMIN_WIDTH."' class='fborder'>  ";
-			$text .= "
-
+		$text .= "<table style='".ADMIN_WIDTH."' class='fborder'>  ";
+		$text .= "
 			<tr>
 			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_10.":</td>
 			<td style='width:70%' class='forumheader3' colspan='3'>user_";
-			if(is_array($current) && $current['user_extended_struct_name'])
-			{
-				$text .= $current['user_extended_struct_name']."
+		if(is_array($current) && $current['user_extended_struct_name'])
+		{
+		  $text .= $current['user_extended_struct_name']."
 				<input type='hidden' name='user_field' value='".$current['user_extended_struct_name']."' />
 				";
-			}
-			else
-			{
-				$text .= "
+		}
+		else
+		{
+		  $text .= "
 				<input class='tbox' type='text' name='user_field' size='40' value='".$current['user_extended_struct_name']."' maxlength='50' />
 				";
-			}
-			$text .= "
+		}
+		$text .= "
 			<br /><span class='smalltext'>".EXTLAN_11."</span>
 			</td>
 			</tr>
@@ -384,27 +401,27 @@
 			</tr>
 			";
 
-			$text .= "<tr>
+		$text .= "<tr>
 			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_14."</td>
 			<td style='width:70%' class='forumheader3' colspan='3'>
 			<select onchange='changeHelp(this.value)' class='tbox' name='user_type' id='user_type'>";
-			foreach($ue->user_extended_types as $key => $val)
-			{
-				$selected = ($current['user_extended_struct_type'] == $key) ? " selected='selected'": "";
-				$text .= "<option value='".$key."' $selected>".$val."</option>";
-			}
-			$curtype = $current['user_extended_struct_type'];
-			if(!$curtype)
-			{
-				$curtype = '1';
-			}
-			$text .= "
+		foreach($ue->user_extended_types as $key => $val)
+		{
+		  $selected = ($current['user_extended_struct_type'] == $key) ? " selected='selected'": "";
+		  $text .= "<option value='".$key."' $selected>".$val."</option>";
+		}
+		$curtype = $current['user_extended_struct_type'];
+		if(!$curtype)
+		{
+		  $curtype = '1';
+		}
+		$text .= "
 			</select>
 			</td></tr>";
 
 
 
-			$text .= "
+		$text .= "
 			<tr>
 			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_3."</td>
 			<td style='width:70%' class='forumheader3' colspan='3'>";
@@ -438,10 +455,14 @@
             $text .= EXTLAN_62."</td><td style='70%'><select style='width:99%' class='tbox' name='table_db' onchange=\"this.form.submit()\" >
             <option value='' class='caption'>".EXTLAN_61."</option>\n";
 			$result = mysql_list_tables($mySQLdefaultdb);
-			while ($row2 = mysql_fetch_row($result)){
-				$fld = str_replace(MPREFIX,"",$row2[0]);
-				$selected =  ($_POST['table_db'] == $fld || $curVals[0] == $fld) ? " selected='selected'" : "";
-         		$text .= (strpos($row2[0], MPREFIX) !== FALSE) ? "<option value=\"".$fld."\" $selected>".$fld."</option>\n" : "";
+			while ($row2 = mysql_fetch_row($result))
+			{
+			  $fld = str_replace(MPREFIX,"",$row2[0]);
+			  $selected =  (varset($_POST['table_db'],'') == $fld || $curVals[0] == $fld) ? " selected='selected'" : "";
+			  if (MPREFIX!='' && strpos($row2[0], MPREFIX)!==FALSE)
+			  {
+				$text .= "<option value=\"".$fld."\" $selected>".$fld."</option>\n";
+			  }
 			}
 			$text .= " </select></td></tr>";
      	if($_POST['table_db'] || $curVals[0]){
@@ -627,6 +648,7 @@
 		$ns->tablerender(EXTLAN_9, $text);
 	}
 
+
 	function show_categories($current)
 	{
 		global $sql, $ns, $ue;
@@ -764,12 +786,13 @@
 		$ns->tablerender(EXTLAN_9, $text);
 	}
 
-	function show_options($action) {
-		// ##### Display options ---------------------------------------------------------------------------------------------------------
-		if ($action == "") {
+
+	function show_options($action) 
+	{
+		if ($action == "") 
+		{
 			$action = "main";
 		}
-		// ##### Display options ---------------------------------------------------------------------------------------------------------
 		$var['main']['text'] = EXTLAN_34;
 		$var['main']['link'] = e_SELF;
 
@@ -786,6 +809,7 @@
 	}
 }
 
+
 function users_extended_adminmenu() {
 	global $user, $action, $ns, $curtype, $action;
 	$user->show_options($action);
@@ -813,6 +837,7 @@
 	return $ret;
 }
 
+
 function show_predefined()
 {
 	global $tp, $ns, $ue, $sql;
@@ -827,6 +852,7 @@
 	//Get list of predefined fields, determine which are already activated.
 	$preList = $ue->parse_extended_xml('getfile');
 	ksort($preList);
+	$active = array();
 	foreach($preList as $k => $v)
 	{
 		if($k != 'version')
@@ -876,6 +902,7 @@
 	exit;
 }
 
+
 function show_field($var, $type='activate')
 {
 	global $tp;
@@ -884,7 +911,6 @@
 //	$showlist = array('type','text', 'values', 'include_text', 'regex');
 	if($head_shown != 1)
 	{
-
 		$txt .= "
 		<tr>
 		<td class='forumheader'>".UE_LAN_9."</td>
@@ -916,6 +942,7 @@
 	return $txt;
 }
 
+
 function field_activate()
 {
 	global $ue, $ns, $tp;
@@ -943,6 +970,7 @@
 	return $ret;
 }
 
+
 function field_deactivate()
 {
 	global $ue, $ns, $tp,$sql;
@@ -965,7 +993,8 @@
 }
 
 
-function process_sql($f){
+function process_sql($f)
+{
     global $sql;
 	$filename = e_ADMIN."sql/extended_".$f.".php";
 	$fd = fopen ($filename, "r");
diff -x .svn -aruN 0.7.11.src/e107_admin/ver.php 0.7.12.src/e107_admin/ver.php
--- 0.7.11.src/e107_admin/ver.php	2008-01-01 09:49:40.000000000 -0600
+++ 0.7.12.src/e107_admin/ver.php	2008-08-25 18:37:52.000000000 -0500
@@ -11,14 +11,14 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_admin/ver.php,v $
-|     $Revision: 1.23 $
-|     $Date: 2008/01/01 15:49:40 $
+|     $Revision: 1.24 $
+|     $Date: 2008/08/25 23:37:52 $
 |     $Author: mcfly_e107 $
 +----------------------------------------------------------------------------+
 */
 
 if (!defined('e107_INIT')) { exit; }
 
-$e107info['e107_version'] = "0.7.11";
+$e107info['e107_version'] = "0.7.12";
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_files/bbcode/img.bb 0.7.12.src/e107_files/bbcode/img.bb
--- 0.7.11.src/e107_files/bbcode/img.bb	2007-11-07 15:44:51.000000000 -0600
+++ 0.7.12.src/e107_files/bbcode/img.bb	2008-03-12 17:15:06.000000000 -0500
@@ -26,8 +26,8 @@
     $parmStr .= $tp -> toAttribute($k)."='".$tp -> toAttribute($v)."' ";
 }
 
-
-if((strpos($code_text,'../') === FALSE) && file_exists(e_IMAGE."newspost_images/".$code_text))
+// Only look for file if not a url - suspected bug in PHP 5.2.5 on XP
+if((strpos($code_text,'../') === FALSE) && (strpos($code_text,'://') === FALSE) && file_exists(e_IMAGE."newspost_images/".$code_text))
 {
     $code_text = e_IMAGE."newspost_images/".$code_text;
 }
diff -x .svn -aruN 0.7.11.src/e107_files/bbcode/link.bb 0.7.12.src/e107_files/bbcode/link.bb
--- 0.7.11.src/e107_files/bbcode/link.bb	2007-12-24 10:12:37.000000000 -0600
+++ 0.7.12.src/e107_files/bbcode/link.bb	2008-01-12 12:52:16.000000000 -0600
@@ -18,7 +18,7 @@
 	/* Fix for people using link=external= */
 	if(strpos($parm,"external=") !== FALSE)
 	{
-		list($extras,$parm) = explode("=",$parm);
+		list($extras,$parm) = explode("=",$parm,2);
 		$parm = $parm." ".$extras;
 	}
 
diff -x .svn -aruN 0.7.11.src/e107_files/def_e107_prefs.php 0.7.12.src/e107_files/def_e107_prefs.php
--- 0.7.11.src/e107_files/def_e107_prefs.php	2007-12-07 13:52:48.000000000 -0600
+++ 0.7.12.src/e107_files/def_e107_prefs.php	2008-03-17 15:47:53.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_files/def_e107_prefs.php,v $
-|     $Revision: 1.64 $
-|     $Date: 2007/12/07 19:52:48 $
+|     $Revision: 1.65 $
+|     $Date: 2008/03/17 20:47:53 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -159,7 +159,7 @@
   'download_email' => '0',
   'comments_disabled' => '0',
   'memberlist_access' => '253',
-  'check_updates' => '1'
+  'check_updates' => '0'
 );
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_files/e107.js 0.7.12.src/e107_files/e107.js
--- 0.7.11.src/e107_files/e107.js	2007-12-19 14:21:57.000000000 -0600
+++ 0.7.12.src/e107_files/e107.js	2008-06-24 03:00:32.000000000 -0500
@@ -5,9 +5,9 @@
 |	e107 website system - Javascript File.
 |
 |	$Source: /cvsroot/e107/e107_0.7/e107_files/e107.js,v $
-|	$Revision: 1.26 $
-|	$Date: 2007/12/19 20:21:57 $
-|	$Author: e107steved $
+|	$Revision: 1.28 $
+|	$Date: 2008/06/24 08:00:32 $
+|	$Author: secretr $
 +----------------------------------------------------------------------------+
 */
 
@@ -182,6 +182,7 @@
 var res = window.screen.width + "x" + window.screen.height;
 var eself = document.location;
 
+/* TODO: @SecretR - Object of removal
 // From http://phpbb.com
 var clientPC = navigator.userAgent.toLowerCase();
 var clientVer = parseInt(navigator.appVersion);
@@ -192,7 +193,7 @@
 var is_mac = (clientPC.indexOf("mac")!=-1);
 var e107_selectedInputArea;
 var e107_selectedRange;
-var e107_dupCounter = 1;
+
 
 // From http://www.massless.org/mozedit/
 function mozWrap(txtarea, open, close){
@@ -217,96 +218,82 @@
 	txtarea.value = s1 + newtext + s3;
 	return;
 }
+*/
 
 function storeCaret (textAr){
 	e107_selectedInputArea = textAr;
+	/* TODO: @SecretR - Object of removal - not needed anymore
 	if (textAr.createTextRange){
 		e107_selectedRange = document.selection.createRange().duplicate();
-	}
+	}*/
 }
 
-function addtext(text, emote)
-{
-  var val = new Array(2);
-	if (window.e107_selectedInputArea)
-	{
-		var ta = e107_selectedInputArea;
-		if (emote != true)
-		{  // Split if its a paired bbcode
-			val = text.split('][');
-			if (val[0] == text) val[1] = '';
-		}
-		else
-		{
-		val = text;
+/**
+ * New improved version - fixed scroll to top behaviour when inserting BBcodes
+ * @TODO - improve it more (0.8) - Prototype
+ */
+function addtext(text, emote) {
+	
+	if (!window.e107_selectedInputArea) {
+		return; //[SecretR] TODO - alert the user 
+	}
+		
+	var eField = e107_selectedInputArea;	
+	var eSelection 	= false;  
+	var tagOpen = '';
+	var tagClose = '';
+	
+	if (emote != true) {  // Split if its a paired bbcode
+		var tmp = text.split('][', 2);
+		if (tmp[0] == text) {
+			tagOpen = text;
+		} else {
+			tagOpen = tmp[0] + ']';
+			tagClose = '[' + tmp[1];
 		}
+	} else { //Insert Emote
+		tagOpen = text;
+	}
+		
 
-		if ((clientVer >= 4) && is_ie && is_win)
-		{
-			theSelection = document.selection.createRange().text; /* wrap selected text */
-			if (theSelection)
-			{
-				if (emote != true)
-				{
-				  if (val[1] == '')
-				  {  // Single piece of text
-					document.selection.createRange().text = val[0];
-				  }
-				  else
-				  {  // bbcode
-					document.selection.createRange().text = val[0] +']' +  theSelection + '[' + val[1];
-				  }
-				}
-				else
-				{
-					document.selection.createRange().text = val + theSelection;
-				}
-				ta.focus();
-				theSelection = '';
-				return;
-			}
-
-		}
-		else
-		  if (ta.selectionEnd && (ta.selectionEnd - ta.selectionStart > 0))
-		  { // Selected text here
-			if (emote != true)
-			{
-			  if  (val[1] != '')
-			  {  // BBCode to wrap
-				mozWrap(ta, val[0] +']', '[' + val[1]); /* wrap selected text */
-			  }
-			  else
-			  {  // Single piece of text to insert, and delete any selected text
-				mozSwap(ta, text); /* wrap selected text */
-			  }
-			}
-			else
-			{
-				mozWrap(ta, val, ''); /* wrap selected text */
-			}
-			return;
-		  }
-		text = ' ' + text + ' ';
-		if (ta.createTextRange && e107_selectedRange)
-		{
-			var caretPos = e107_selectedRange; /* IE */
-			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
+	// Windows user  
+	if (document.selection) {
+		eSelection = document.selection.createRange().text;
+		eField.focus();
+		if (eSelection) {
+			document.selection.createRange().text = tagOpen + eSelection + tagClose;
+		} else {
+			document.selection.createRange().text = tagOpen + tagClose;
 		}
-		else
-		  if (ta.selectionStart || ta.selectionStart == '0')
-		  { /* Moz */
-		   	var startPos = ta.selectionStart;
-			var endPos = ta.selectionEnd;
-			var charb4 = ta.value.charAt(endPos-1);
-			ta.value = ta.value.substring(0, endPos)+ text + ta.value.substring(endPos);
-		  }
-		  else
-		  {
-			ta.value  += text;
-		  }
-		ta.focus();
-	}
+		
+		eSelection = '';
+		
+		eField.blur();
+		eField.focus();
+		
+		return;
+	} 
+	
+	var scrollPos = eField.scrollTop;
+	var selLength = eField.textLength;
+	var selStart = eField.selectionStart;
+	var selEnd = eField.selectionEnd; 
+	if (selEnd <= 2 && typeof(selLength) != 'undefined') {
+		selEnd = selLength;
+	}
+	var sel1 = (eField.value).substring(0,selStart);
+	var sel2 = (eField.value).substring(selStart, selEnd)
+	var sel3 = (eField.value).substring(selEnd, selLength);
+
+	var newStart = selStart + tagOpen.length + sel2.length + tagClose.length;
+	eField.value = sel1 + tagOpen + sel2 + tagClose + sel3;
+
+	eField.focus();
+	eField.selectionStart = newStart;
+	eField.selectionEnd = newStart;
+	eField.scrollTop = scrollPos;
+	return;
+
 }
 
 function help(help,tagid){
@@ -331,6 +318,7 @@
 	object.className = over;
 }
 
+var e107_dupCounter = 1;
 function duplicateHTML(copy,paste,baseid){
 		if(document.getElementById(copy)){
 
diff -x .svn -aruN 0.7.11.src/e107_files/import/mambo.php 0.7.12.src/e107_files/import/mambo.php
--- 0.7.11.src/e107_files/import/mambo.php	2007-08-03 16:10:43.000000000 -0500
+++ 0.7.12.src/e107_files/import/mambo.php	2008-03-28 17:10:49.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_files/import/mambo.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2007/08/03 21:10:43 $
+|     $Revision: 1.3 $
+|     $Date: 2008/03/28 22:10:49 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -115,7 +115,7 @@
 $text .= "<td class='fcaption'>lvDate</td>";
 $text .= "</tr>";
 
-$result = mysql_query("SELECT name,username,email,block,sendEmail,gid,password,usertype,UNIX_TIMESTAMP(registerDate) AS regDate,UNIX_TIMESTAMP(lastvisitDate) AS lvDate FROM mos_users", $phpbbConnection);
+$result = mysql_query("SELECT name,username,email,block,sendEmail,gid,password,usertype,UNIX_TIMESTAMP(registerDate) AS regDate,UNIX_TIMESTAMP(lastvisitDate) AS lvDate FROM {$mamboPrefix}users", $phpbbConnection);
 while ($mos = mysql_fetch_array($result, MYSQL_ASSOC)) {
 $text .= "<tr>";
 $text .= "<td class='forumheader3'>".$mos['name']."</td>";
diff -x .svn -aruN 0.7.11.src/e107_files/import/phpbb2.php 0.7.12.src/e107_files/import/phpbb2.php
--- 0.7.11.src/e107_files/import/phpbb2.php	2006-09-28 19:48:11.000000000 -0500
+++ 0.7.12.src/e107_files/import/phpbb2.php	2008-07-20 12:08:20.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_files/import/phpbb2.php,v $
-|     $Revision: 1.8 $
-|     $Date: 2006/09/29 00:48:11 $
-|     $Author: mcfly_e107 $
+|     $Revision: 1.10 $
+|     $Date: 2008/07/20 17:08:20 $
+|     $Author: e107steved $
 |
 |     31/1/2006  Changes by Albert Drent
 |                Aducom Software
@@ -125,7 +125,7 @@
 	goError("Error! Could not connect to e107 database.");
 }
 
-echo "Successfully connected to phpBB and e107 databases ...<br><br />";
+echo "Successfully connected to phpBB and e107 databases ...<br /><br />";
 
 
 $phpbb_res = mysql_query("SELECT * FROM {$phpbb2Prefix}users", $phpbbConnection);
@@ -272,7 +272,9 @@
 
 		//echo "PARENT: $parent_id, TOPIC: $topic_id<br />"; 
 
-		$query = "SELECT * FROM {$phpbb2Prefix}posts LEFT JOIN {$phpbb2Prefix}posts_text ON ({$phpbb2Prefix}posts.post_id = {$phpbb2Prefix}posts_text.post_id) WHERE topic_id='{$topic_id}' AND post_subject = '' ORDER BY post_time DESC";
+// Amending next line to not require blank post_subject might work better
+//		$query = "SELECT * FROM {$phpbb2Prefix}posts LEFT JOIN {$phpbb2Prefix}posts_text ON ({$phpbb2Prefix}posts.post_id = {$phpbb2Prefix}posts_text.post_id) WHERE topic_id='{$topic_id}' AND post_subject = '' ORDER BY post_time DESC";
+		$query = "SELECT * FROM {$phpbb2Prefix}posts LEFT JOIN {$phpbb2Prefix}posts_text ON ({$phpbb2Prefix}posts.post_id = {$phpbb2Prefix}posts_text.post_id) WHERE topic_id='{$topic_id}' ORDER BY post_time DESC";
 		$phpbb_res2 = mysql_query($query, $phpbbConnection);
 		if(!$phpbb_res2)
 		{
diff -x .svn -aruN 0.7.11.src/e107_files/import/phpnuke.php 0.7.12.src/e107_files/import/phpnuke.php
--- 0.7.11.src/e107_files/import/phpnuke.php	2005-12-24 20:02:41.000000000 -0600
+++ 0.7.12.src/e107_files/import/phpnuke.php	2008-07-20 12:08:21.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_files/import/phpnuke.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2005/12/25 02:02:41 $
-|     $Author: sweetas $
+|     $Revision: 1.3 $
+|     $Date: 2008/07/20 17:08:21 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -103,7 +103,7 @@
 	goError("Error! Cound not connect to e107 database.");
 }
 
-echo "Successfully connected to ".ASYSTEM." and e107 databases ...<br><br />";
+echo "Successfully connected to ".ASYSTEM." and e107 databases ...<br /><br />";
 
 /* ++++++++++++++ USERS ++++++++++++++ */
 $result = mysql_query("SELECT * FROM {$dbPrefix}users", $ASystemConnection);
diff -x .svn -aruN 0.7.11.src/e107_files/shortcode/batch/bbcode_shortcodes.php 0.7.12.src/e107_files/shortcode/batch/bbcode_shortcodes.php
--- 0.7.11.src/e107_files/shortcode/batch/bbcode_shortcodes.php	2007-06-13 14:36:15.000000000 -0500
+++ 0.7.12.src/e107_files/shortcode/batch/bbcode_shortcodes.php	2008-06-02 13:55:26.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/bbcode_shortcodes.php,v $
-|     $Revision: 1.13 $
-|     $Date: 2007/06/13 19:36:15 $
+|     $Revision: 1.15 $
+|     $Date: 2008/06/02 18:55:26 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -77,23 +77,29 @@
 }
 
 
-foreach($register_bb as $key=>$val) // allow themes to plug in to it.
+if (!empty($register_bb))
 {
+  foreach($register_bb as $key=>$val) // allow themes to plug in to it.
+  {
 	if($val[0]=="")
 	{
     	$val[0] = $bbcode_func;
 	}
 	$bbcode[$key] = $val;
 	$iconpath[$key] = $val[3];
+  }
 }
 
 
-foreach($eplug_bb as $key=>$val)  // allow plugins to plug into it.
+if (!empty($eplug_bb))
 {
+  foreach($eplug_bb as $key=>$val)  // allow plugins to plug into it.
+  {
 	extract($val);
    //	echo "$onclick $onclick_var $helptext $icon <br />";
     $bbcode[$name] = array($onclick,$onclick_var,$helptext,$icon,$function,$function_var);
 	$iconpath[$name] = $icon;
+  }
 }
 
 
@@ -132,7 +138,7 @@
 	global $bbcode_helpactive,$bbcode_helptag;
 	$bbcode_helptag = ($parm) ? $parm : "helpb";
 	$bbcode_helpactive = TRUE;
-	return "<input id='{$bbcode_helptag}' class='helpbox' type='text' name='{$bbcode_helptag}' size='100'  />\n";
+	return "<input id='{$bbcode_helptag}' class='helpbox' type='text' name='{$bbcode_helptag}' size='90' maxlength='100' />\n";
 SC_END
 
 
diff -x .svn -aruN 0.7.11.src/e107_files/shortcode/batch/comment_shortcodes.php 0.7.12.src/e107_files/shortcode/batch/comment_shortcodes.php
--- 0.7.11.src/e107_files/shortcode/batch/comment_shortcodes.php	2007-08-17 14:23:02.000000000 -0500
+++ 0.7.12.src/e107_files/shortcode/batch/comment_shortcodes.php	2008-05-25 03:25:33.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/comment_shortcodes.php,v $
-|     $Revision: 1.21 $
-|     $Date: 2007/08/17 19:23:02 $
+|     $Revision: 1.22 $
+|     $Date: 2008/05/25 08:25:33 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -33,9 +33,12 @@
 
 SC_BEGIN USERNAME
 global $USERNAME, $comrow;
-if (isset($comrow['user_id']) && $comrow['user_id']) {
+if (isset($comrow['user_id']) && $comrow['user_id']) 
+{
 	$USERNAME = "<a href='".e_BASE."user.php?id.".$comrow['user_id']."'>".$comrow['user_name']."</a>\n";
-}else{
+}
+else
+{
 	$comrow['user_id'] = 0;
 	$USERNAME = preg_replace("/[0-9]+\./", '', $comrow['comment_author']);
 	$USERNAME = str_replace("Anonymous", LAN_ANONYMOUS, $USERNAME);
@@ -43,6 +46,7 @@
 return $USERNAME;
 SC_END
 
+
 SC_BEGIN TIMEDATE
 global $TIMEDATE, $comrow, $datestamp, $gen;
 $datestamp = $gen->convert_date($comrow['comment_datestamp'], "short");
@@ -106,7 +110,8 @@
 	}
 	else
 	{
-		return "<a href='".e_SELF."?".$comment_edit_query.".edit.".$comrow['comment_id']."'><img src='".e_IMAGE."generic/".IMODE."/newsedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' style='border: 0;' /></a>";
+//		return "<a href='".e_SELF."?".$comment_edit_query.".edit.".$comrow['comment_id']."'><img src='".e_IMAGE."generic/".IMODE."/newsedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' style='border: 0;' /></a>";
+		return "<a href='".e_BASE."comment.php?".$comment_edit_query.".edit.".$comrow['comment_id']."'><img src='".e_IMAGE."generic/".IMODE."/newsedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' style='border: 0;' /></a>";
 	}
 }
 else
diff -x .svn -aruN 0.7.11.src/e107_files/shortcode/batch/download_shortcodes.php 0.7.12.src/e107_files/shortcode/batch/download_shortcodes.php
--- 0.7.11.src/e107_files/shortcode/batch/download_shortcodes.php	2007-10-12 14:54:27.000000000 -0500
+++ 0.7.12.src/e107_files/shortcode/batch/download_shortcodes.php	2008-08-14 17:55:55.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/download_shortcodes.php,v $
-|     $Revision: 1.27 $
-|     $Date: 2007/10/12 19:54:27 $
-|     $Author: e107steved $
+|     $Revision: 1.28 $
+|     $Date: 2008/08/14 22:55:55 $
+|     $Author: e107coders $
 +----------------------------------------------------------------------------+
 */
 if (!defined('e107_INIT')) { exit; }
@@ -483,8 +483,17 @@
 	    foreach ($catlist as $thiscat)
 	    {  // Main categories
 			// Could add a display class to the group, but the default looked OK
-			$boxinfo .= "<optgroup label='".htmlspecialchars($thiscat['download_category_name'])."'>\n";
-		  	$scprefix = '';
+
+            if(count($catlist)>1)
+			{
+				$boxinfo .= "<optgroup label='".htmlspecialchars($thiscat['download_category_name'])."'>\n";
+		  		$scprefix = '';
+			}
+			else
+			{
+				$sel = ($cdc == $sc['download_category_id']) ? " selected='selected'" : "";
+            	$boxinfo .= "<option value='".$thiscat['download_category_id']."' {$sel}>".htmlspecialchars($thiscat['download_category_name'])."</option>\n";
+			}
 
 	      	foreach ($thiscat['subcats'] as $sc)
 	      	{  // Sub-categories
diff -x .svn -aruN 0.7.11.src/e107_files/shortcode/batch/news_shortcodes.php 0.7.12.src/e107_files/shortcode/batch/news_shortcodes.php
--- 0.7.11.src/e107_files/shortcode/batch/news_shortcodes.php	2007-11-08 15:05:51.000000000 -0600
+++ 0.7.12.src/e107_files/shortcode/batch/news_shortcodes.php	2008-07-15 16:11:50.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/news_shortcodes.php,v $
-|     $Revision: 1.34 $
-|     $Date: 2007/11/08 21:05:51 $
+|     $Revision: 1.35 $
+|     $Date: 2008/07/15 21:11:50 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -45,13 +45,15 @@
 $news_item = getcachedvars('current_news_item');
 $param = getcachedvars('current_news_param');
 $category_icon = $tp -> parseTemplate('{NEWSHEADER}', FALSE, $news_shortcodes);
+if (!$category_icon) return '';
 return "<a class='".$GLOBALS['NEWS_CSSMODE']."_icon' href='".e_BASE."news.php?cat.".$news_item['news_category']."'><img style='".$param['caticon']."'  src='".$category_icon."' alt='' /></a>";
 SC_END
 
 SC_BEGIN NEWSHEADER
 $news_item = getcachedvars('current_news_item');
 $param = getcachedvars('current_news_param');
-$category_icon = str_replace("../", "", $news_item['category_icon']);
+$category_icon = str_replace("../", "", trim($news_item['category_icon']));
+if (!$category_icon) return '';
 if ($category_icon && strstr("images", $category_icon)) {
 	return THEME.$category_icon;
 } else {
@@ -264,6 +266,7 @@
 $news_item = getcachedvars('current_news_item');
 $param = getcachedvars('current_news_param');
 $category_icon = $tp -> parseTemplate('{NEWSHEADER}', FALSE, $news_shortcodes);
+if (!$category_icon) return '';
 if($param['caticon'] == ""){$param['caticon'] = "border:0px";}
 return "<a class='".$GLOBALS['NEWS_CSSMODE']."_caticon' href='".e_BASE."news.php?cat.".$news_item['news_category']."'><img style='".$param['caticon']."' src='".$category_icon."' alt='' /></a>";
 SC_END
diff -x .svn -aruN 0.7.11.src/e107_files/shortcode/batch/user_shortcodes.php 0.7.12.src/e107_files/shortcode/batch/user_shortcodes.php
--- 0.7.11.src/e107_files/shortcode/batch/user_shortcodes.php	2007-12-19 14:34:28.000000000 -0600
+++ 0.7.12.src/e107_files/shortcode/batch/user_shortcodes.php	2008-04-01 14:58:16.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/user_shortcodes.php,v $
-|     $Revision: 1.26 $
-|     $Date: 2007/12/19 20:34:28 $
+|     $Revision: 1.29 $
+|     $Date: 2008/04/01 19:58:16 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -87,7 +87,7 @@
   }
   cachevars('total_chatposts', $chatposts);
 }
-return round(($user['user_chats']/$chatposts) * 100, 2);
+return ($chatposts!=0) ? round(($user['user_chats']/$chatposts) * 100, 2): 0;
 SC_END
 
 SC_BEGIN USER_COMMENTPER
@@ -97,17 +97,17 @@
 	$commentposts = $sql->db_Count("comments");
 	cachevars('total_commentposts', $commentposts);
 }
-return round(($user['user_comments']/$commentposts) * 100, 2);
+return ($commentposts!=0) ? round(($user['user_comments']/$commentposts) * 100, 2): 0;
 SC_END
 
 SC_BEGIN USER_FORUMPER
 global $sql, $user;
 if(!$forumposts = getcachedvars('total_forumposts'))
 {
-	$forumposts = $sql->db_Count("forum_t");
-	cachevars('total_forumposts', $forumposts);
+  $forumposts = (isset($pref['plug_installed']['forum'])) ? $sql->db_Count("forum_t"): 0;
+  cachevars('total_forumposts', $forumposts);
 }
-return round(($user['user_forums']/$forumposts) * 100, 2);
+return ($forumposts!==0) ? round(($user['user_forums']/$forumposts) * 100, 2): 0;
 SC_END
 
 SC_BEGIN USER_LEVEL
@@ -333,24 +333,21 @@
 if (!$full_perms) return;
 if(!$userjump = getcachedvars('userjump'))
 {
-	$sql->db_Select("user", "user_id, user_name", "ORDER BY user_id ASC", "no-where");
-	$c = 0;
-	while ($row = $sql->db_Fetch())
-	{
-		$array[$c]['id'] = $row['user_id'];
-		$array[$c]['name'] = $row['user_name'];
-		if ($row['user_id'] == $user['user_id'])
-		{
-			$userjump['prev']['id'] = $array[$c-1]['id'];
-			$userjump['prev']['name'] = $array[$c-1]['name'];
-			$row = $sql->db_Fetch();
-			$userjump['next']['id'] = $row['user_id'];
-			$userjump['next']['name'] = $row['user_name'];
-			break;
-		}
-		$c++;
-	}
-	cachevars('userjump', $userjump);
+//  $sql->db_Select("user", "user_id, user_name", "`user_id` > ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id ASC LIMIT 1 ");
+  $sql->db_Select_gen("SELECT user_id, user_name FROM `#user` FORCE INDEX (PRIMARY) WHERE `user_id` > ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id ASC LIMIT 1 ");
+  if ($row = $sql->db_Fetch())
+  {
+	$userjump['next']['id'] = $row['user_id'];
+	$userjump['next']['name'] = $row['user_name'];
+  }
+//  $sql->db_Select("user", "user_id, user_name", "`user_id` < ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id DESC LIMIT 1 ");
+  $sql->db_Select_gen("SELECT user_id, user_name FROM `#user` FORCE INDEX (PRIMARY) WHERE `user_id` < ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id DESC LIMIT 1 ");
+  if ($row = $sql->db_Fetch())
+  {
+	$userjump['prev']['id'] = $row['user_id'];
+	$userjump['prev']['name'] = $row['user_name'];
+  }
+  cachevars('userjump', $userjump);
 }
 if($parm == 'prev')
 {
diff -x .svn -aruN 0.7.11.src/e107_files/shortcode/custom.sc 0.7.12.src/e107_files/shortcode/custom.sc
--- 0.7.11.src/e107_files/shortcode/custom.sc	2007-04-15 00:02:16.000000000 -0500
+++ 0.7.12.src/e107_files/shortcode/custom.sc	2008-05-16 14:09:00.000000000 -0500
@@ -3,31 +3,35 @@
 $custom_query = explode('+', $parm);
 switch($custom_query[0])
 {
-		case "login":
-		case "login noprofile":
-				include_lan(e_PLUGIN."login_menu/languages/".e_LANGUAGE.".php");
-
-				$sep = (defined("LOGINC_SEP")) ? LOGINC_SEP : "<span class='loginc sep'>.:.</span>";
-
-				if (USER == TRUE){
-						$ret .= "<span class='mediumtext'><span class='loginc welcome'>".LOGIN_MENU_L5." ".USERNAME."</span>&nbsp;&nbsp;&nbsp;".$sep." ";
-						if(ADMIN == TRUE){
-								$ret .= "<a class='loginc admin' href='".e_ADMIN."admin.php'>".LOGIN_MENU_L11."</a> ".$sep." ";
-						}
-						$ret .= ($custom_query[0] != "login noprofile") ? "<a class='loginc profile' href='".e_BASE."user.php?id.".USERID."'>".LOGIN_MENU_L13."</a>\n".$sep." ":"";
-						$ret .= "<a class='loginc usersettings' href='" . e_BASE . "usersettings.php'>".LOGIN_MENU_L12."</a> ".$sep." <a class='loginc logout' href='".e_BASE."index.php?logout'>".LOGIN_MENU_L8."</a> ".$sep."</span>";
-				} else {
-						$ret .= "<form method='post' action='".e_SELF."'>\n<div class='loginc_div'>\n".LOGIN_MENU_L1."<input class='tbox loginc user' type='text' name='username' size='15' value='$username' maxlength='20' />&nbsp;&nbsp;\n".LOGIN_MENU_L2."<input class='tbox loginc pass' type='password' name='userpass' size='15' value='' maxlength='20' />&nbsp;&nbsp;\n";
-						$ret .= ($pref['user_tracking'] == "cookie") ? "<input type='checkbox' name='autologin' value='1' />".LOGIN_MENU_L6."&nbsp;&nbsp;\n" : "";
-						$ret .= "<input class='button loginc' type='submit' name='userlogin' value='".LOGIN_MENU_L28."' />";
-						if($pref['user_reg'])
-						{
-							$ret .= "&nbsp;&nbsp;<a class='loginc signup' href='".e_SIGNUP."'>".LOGIN_MENU_L3."</a>";
-						}
-						$ret .= "</div>\n</form>";
-				}
-				return $ret;
-				break;
+  case "login":
+  case "login noprofile":
+	include_lan(e_PLUGIN."login_menu/languages/".e_LANGUAGE.".php");
+
+	$sep = (defined("LOGINC_SEP")) ? LOGINC_SEP : "<span class='loginc sep'>.:.</span>";
+
+	if (USER == TRUE)
+	{
+	  $ret .= "<span class='mediumtext'><span class='loginc welcome'>".LOGIN_MENU_L5." ".USERNAME."</span>&nbsp;&nbsp;&nbsp;".$sep." ";
+	  if(ADMIN == TRUE)
+	  {
+		$ret .= "<a class='loginc admin' href='".e_ADMIN."admin.php'>".LOGIN_MENU_L11."</a> ".$sep." ";
+	  }
+	  $ret .= ($custom_query[0] != "login noprofile") ? "<a class='loginc profile' href='".e_BASE."user.php?id.".USERID."'>".LOGIN_MENU_L13."</a>\n".$sep." ":"";
+	  $ret .= "<a class='loginc usersettings' href='" . e_BASE . "usersettings.php'>".LOGIN_MENU_L12."</a> ".$sep." <a class='loginc logout' href='".e_BASE."index.php?logout'>".LOGIN_MENU_L8."</a> ".$sep."</span>";
+	} 
+	else 
+	{
+	  $ret .= "<form method='post' action='".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."'>\n<div class='loginc_div'>\n".LOGIN_MENU_L1."<input class='tbox loginc user' type='text' name='username' size='15' value='$username' maxlength='20' />&nbsp;&nbsp;\n".LOGIN_MENU_L2."<input class='tbox loginc pass' type='password' name='userpass' size='15' value='' maxlength='20' />&nbsp;&nbsp;\n";
+	  $ret .= ($pref['user_tracking'] == "cookie") ? "<input type='checkbox' name='autologin' value='1' />".LOGIN_MENU_L6."&nbsp;&nbsp;\n" : "";
+	  $ret .= "<input class='button loginc' type='submit' name='userlogin' value='".LOGIN_MENU_L28."' />";
+	  if($pref['user_reg'])
+	  {
+		$ret .= "&nbsp;&nbsp;<a class='loginc signup' href='".e_SIGNUP."'>".LOGIN_MENU_L3."</a>";
+	  }
+	  $ret .= "</div>\n</form>";
+	}
+	return $ret;
+	break;
 
 		case "search":
 				if(!check_class($pref['search_restrict']))
diff -x .svn -aruN 0.7.11.src/e107_files/shortcode/menu.sc 0.7.12.src/e107_files/shortcode/menu.sc
--- 0.7.11.src/e107_files/shortcode/menu.sc	2007-05-11 14:58:08.000000000 -0500
+++ 0.7.12.src/e107_files/shortcode/menu.sc	2008-06-19 17:46:12.000000000 -0500
@@ -1,4 +1,4 @@
-/* $Id: menu.sc,v 1.28 2007/05/11 19:58:08 e107steved Exp $ */
+/* $Id: menu.sc,v 1.29 2008/06/19 22:46:12 e107coders Exp $ */
 global $sql;
 global $ns;
 global $eMenuList;
@@ -78,7 +78,7 @@
 			$page  = $sql -> db_Fetch();
 			$caption = $tp -> toHTML($page['page_title'], TRUE, 'parse_sc, constants');
 			$text = $tp -> toHTML($page['page_text'], TRUE, 'parse_sc, constants');
-			$ns -> tablerender($caption, $text);
+			$ns -> tablerender($caption, $text, "custom_menu");
 		}
 		else
 		{
diff -x .svn -aruN 0.7.11.src/e107_files/shortcode/user_extended.sc 0.7.12.src/e107_files/shortcode/user_extended.sc
--- 0.7.11.src/e107_files/shortcode/user_extended.sc	2007-10-13 14:46:42.000000000 -0500
+++ 0.7.12.src/e107_files/shortcode/user_extended.sc	2008-05-25 10:31:59.000000000 -0500
@@ -2,7 +2,7 @@
 //EXAMPLE: {EXTENDED=gender.value.5}  will show the value of the extended field user_gender for user #5
 include(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_extended.php");
 $parms = explode(".", $parm);
-global $currentUser, $sql, $tp, $loop_uid, $e107, $sc_style;
+global $currentUser, $tp, $loop_uid, $e107, $sc_style;
 if(isset($loop_uid) && intval($loop_uid) == 0) { return ""; }
 $key = $parms[0].".".$parms[1];
 $sc_style['USER_EXTENDED']['pre'] = (isset($sc_style['USER_EXTENDED'][$key]['pre']) ? $sc_style['USER_EXTENDED'][$key]['pre'] : "");
@@ -95,7 +95,8 @@
 	if($ueStruct["user_".$parms[0]]['user_extended_struct_type'] == '4')
 	{
 		$tmp = explode(",",$ueStruct["user_".$parms[0]]['user_extended_struct_values']);
-		if($sql->db_Select($tmp[0],"{$tmp[1]}, {$tmp[2]}","{$tmp[1]} = '{$uVal}'"))
+		$sql_ue = new db;			// Use our own DB object to avoid conflicts
+		if($sql_ue->db_Select($tmp[0],"{$tmp[1]}, {$tmp[2]}","{$tmp[1]} = '{$uVal}'"))
 		{
 			$row = $sql->db_Fetch();
 			$ret_data = $row[$tmp[2]];
diff -x .svn -aruN 0.7.11.src/e107_handlers/admin_log_class.php 0.7.12.src/e107_handlers/admin_log_class.php
--- 0.7.11.src/e107_handlers/admin_log_class.php	2007-11-04 03:10:41.000000000 -0600
+++ 0.7.12.src/e107_handlers/admin_log_class.php	2008-06-27 16:22:19.000000000 -0500
@@ -12,8 +12,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/admin_log_class.php,v $
-|     $Revision: 1.10 $
-|     $Date: 2007/11/04 09:10:41 $
+|     $Revision: 1.11 $
+|     $Date: 2008/06/27 21:22:19 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -93,7 +93,7 @@
 			$event_detail = $tp -> toDB($event_detail, true,false,'no_html');
 			$event_type = $tp -> toDB($event_type, true,false,'no_html');
 			$time_stamp = time();
-			$uid = (USERID !== FALSE) ? USERID : '0';
+			$uid = (USER) ? USERID : '0';
 			$ip = $e107->getip();
 			if($this->_options['backtrace'] == true) {
 				$event_detail .= "\n\n".debug_backtrace();
diff -x .svn -aruN 0.7.11.src/e107_handlers/comment_class.php 0.7.12.src/e107_handlers/comment_class.php
--- 0.7.11.src/e107_handlers/comment_class.php	2007-08-08 14:27:50.000000000 -0500
+++ 0.7.12.src/e107_handlers/comment_class.php	2008-07-31 14:26:35.000000000 -0500
@@ -12,8 +12,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/comment_class.php,v $
-|     $Revision: 1.71 $
-|     $Date: 2007/08/08 19:27:50 $
+|     $Revision: 1.75 $
+|     $Date: 2008/07/31 19:26:35 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -272,8 +272,8 @@
 			$sub_query = "
 			SELECT c.*, u.*, ue.*
 			FROM #comments AS c
-			LEFT JOIN #user AS u ON c.comment_author = u.user_id
-			LEFT JOIN #user_extended AS ue ON c.comment_author = ue.user_extended_id
+			LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.comment_author,'.',1) = u.user_id
+			LEFT JOIN #user_extended AS ue ON SUBSTRING_INDEX(c.comment_author,'.',1) = ue.user_extended_id
 			WHERE comment_item_id='".intval($thisid)."' AND comment_type='".$tp -> toDB($type, true)."' AND comment_pid='".intval($comrow['comment_id'])."'
 			ORDER BY comment_datestamp
 			";
@@ -478,13 +478,13 @@
 
 		$query = $pref['nested_comments'] ?
 		"SELECT c.*, u.*, ue.* FROM #comments AS c
-		LEFT JOIN #user AS u ON c.comment_author = u.user_id
-		LEFT JOIN #user_extended AS ue ON c.comment_author = ue.user_extended_id
+		LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.comment_author,'.',1) = u.user_id
+		LEFT JOIN #user_extended AS ue ON SUBSTRING_INDEX(c.comment_author,'.',1) = ue.user_extended_id
 		WHERE c.comment_item_id='".intval($id)."' AND c.comment_type='".$tp -> toDB($type, true)."' AND c.comment_pid='0' ORDER BY c.comment_datestamp"
 		:
 		"SELECT c.*, u.*, ue.* FROM #comments AS c
-		LEFT JOIN #user AS u ON c.comment_author = u.user_id
-		LEFT JOIN #user_extended AS ue ON c.comment_author = ue.user_extended_id
+		LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.comment_author,'.',1) = u.user_id
+		LEFT JOIN #user_extended AS ue ON SUBSTRING_INDEX(c.comment_author,'.',1) = ue.user_extended_id
 		WHERE c.comment_item_id='".intval($id)."' AND c.comment_type='".$tp -> toDB($type, true)."' ORDER BY c.comment_datestamp";
 
 		$text = "";
@@ -553,25 +553,26 @@
 
 	function recalc_user_comments($id)
 	{
-		global $sql;
+	  global $sql;
 	
-		if(is_array($id))
-		{
-			foreach($id as $_id)
-			{
-				$this->recalc_user_comments($_id);
-			}
-		}
-		$qry = "
+	  if(is_array($id))
+	  {
+		foreach($id as $_id)
+		{
+		  $this->recalc_user_comments($_id);
+		}
+		return;
+	  }
+	  $qry = "
 		SELECT COUNT(*) AS count
 		FROM #comments
 		WHERE SUBSTRING_INDEX(comment_author,'.',1) = '{$id}'
 		";
-		if($sql->db_Select_gen($qry))
-		{
-			$row = $sql->db_Fetch();
-			$sql->db_Update("user","user_comments = '{$row['count']}' WHERE user_id = '{$id}'");
-		}
+	  if($sql->db_Select_gen($qry))
+	  {
+		$row = $sql->db_Fetch();
+		$sql->db_Update("user","user_comments = '{$row['count']}' WHERE user_id = '{$id}'");
+	  }
 	}
 	
 	function get_author_list($id, $comment_type)
@@ -627,7 +628,8 @@
 		$fl = new e_file;
 
 		$omit = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$','.bak$');
-		$files = $fl->get_files(e_PLUGIN, $fmask = 'e_comment.php', $omit, $recurse_level = 1, $current_level = 0);
+//		$files = $fl->get_files(e_PLUGIN, $fmask = 'e_comment.php', $omit, $recurse_level = 1, $current_level = 0);
+		$files = $fl->get_files(e_PLUGIN, 'e_comment.php', $omit, 1, 0);
 
 		foreach($files as $file){
 			unset($e_comment, $key);
@@ -685,24 +687,18 @@
 		$qry1 = ($qry ? " AND ".$qry : "");
 
 		//get 'amount' of records from comment db
-		/*
-		$query = $pref['nested_comments'] ?
-		"SELECT c.*, u.*, ue.* FROM #comments AS c
-		LEFT JOIN #user AS u ON c.comment_author = u.user_id
-		LEFT JOIN #user_extended AS ue ON c.comment_author = ue.user_extended_id
-		WHERE c.comment_pid='0' ".$qry1." ORDER BY c.comment_datestamp DESC LIMIT ".intval($from1).",".intval($amount1)." "
-		:
-		"SELECT c.*, u.*, ue.* FROM #comments AS c
-		LEFT JOIN #user AS u ON c.comment_author = u.user_id
-		LEFT JOIN #user_extended AS ue ON c.comment_author = ue.user_extended_id
-		WHERE c.comment_id!='' ".$qry1." ORDER BY c.comment_datestamp DESC LIMIT ".intval($from1).",".intval($amount1)." ";
-		*/
 
+/*
 		$query = "
 		SELECT c.*, u.*, ue.* FROM #comments AS c
-		LEFT JOIN #user AS u ON c.comment_author = u.user_id
-		LEFT JOIN #user_extended AS ue ON c.comment_author = ue.user_extended_id
-		WHERE c.comment_id!='' ".$qry1." ORDER BY c.comment_datestamp DESC LIMIT ".intval($from1).",".intval($amount1)." ";
+		LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.comment_author,'.',1) = u.user_id
+		LEFT JOIN #user_extended AS ue ON SUBSTRING_INDEX(c.comment_author,'.',1) = ue.user_extended_id
+		WHERE c.comment_id!='' AND c.comment_blocked = 0 ".$qry1." ORDER BY c.comment_datestamp DESC LIMIT ".intval($from1).",".intval($amount1)." ";
+//		WHERE c.comment_id!='' ".$qry1." ORDER BY c.comment_datestamp DESC LIMIT ".intval($from1).",".intval($amount1)." ";
+*/
+		$query = "
+		SELECT c.*  FROM #comments AS c
+		WHERE c.comment_id!='' AND c.comment_blocked = 0 ".$qry1." ORDER BY c.comment_datestamp DESC LIMIT ".intval($from1).",".intval($amount1)." ";
 
 		if ($comment_total = $sql->db_Select_gen($query))
 		{
diff -x .svn -aruN 0.7.11.src/e107_handlers/db_debug_class.php 0.7.12.src/e107_handlers/db_debug_class.php
--- 0.7.11.src/e107_handlers/db_debug_class.php	2006-12-05 03:54:57.000000000 -0600
+++ 0.7.12.src/e107_handlers/db_debug_class.php	2008-07-20 12:08:29.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/db_debug_class.php,v $
-|     $Revision: 1.19 $
-|     $Date: 2006/12/05 09:54:57 $
-|     $Author: mrpete $
+|     $Revision: 1.20 $
+|     $Date: 2008/07/20 17:08:29 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -72,7 +72,7 @@
 		global $ns;
 		
 		if (!isset($ns)) {
-			echo "Why did ns go away?<br/>";
+			echo "Why did ns go away?<br />";
 			$ns = new e107table;
 		}
 		
@@ -105,7 +105,7 @@
 	
 		// Add any desired notes to $aMarkNotes[$nMarks]... e.g.
 		//global $eTimingStart;
-		//$this->aMarkNotes[$nMarks] .= "verify start: ".$eTimingStart."<br/>";
+		//$this->aMarkNotes[$nMarks] .= "verify start: ".$eTimingStart."<br />";
 	}
 
 	function Mark_Query($query, $rli, $origQryRes, $aTrace, $mytime, $curtable) {
@@ -206,7 +206,7 @@
     	       	        <td class='forumheader3'>".$cQuery['query']."</td></tr>\n<tr><td class='forumheader3'>".$cQuery['error']."</td></tr>\n";
 				}
 			}
-			$text .= "\n</table><br/>\n";
+			$text .= "\n</table><br />\n";
 		}
 
 		//
@@ -222,10 +222,10 @@
 			foreach ($this->aSQLdetails as $idx => $cQuery) {
 				if ($cQuery['ok']) {
 					$text .= "<tr><td class='forumheader3' style='text-align:right'>{$idx}&nbsp;</td>
-	       	        <td class='forumheader3' style='text-align:right'>".number_format($cQuery['time'] * 1000.0, 4)."&nbsp;</td><td class='forumheader3'>".$cQuery['query'].'<br/>['.$cQuery['marker']." - ".$cQuery['caller']."]</td></tr>\n";
+	       	        <td class='forumheader3' style='text-align:right'>".number_format($cQuery['time'] * 1000.0, 4)."&nbsp;</td><td class='forumheader3'>".$cQuery['query'].'<br />['.$cQuery['marker']." - ".$cQuery['caller']."]</td></tr>\n";
 				}
 			}
-			$text .= "\n</table><br/>\n";
+			$text .= "\n</table><br />\n";
 		}
 
 
@@ -235,7 +235,7 @@
 		if (E107_DBG_SQLDETAILS) {
 			foreach ($this->aSQLdetails as $idx => $cQuery) {
 				$text .= "\n<table class='fborder' style='width: 100%;'>\n";
-				$text .= "<tr><td class='forumheader3' colspan='".$cQuery['nFields']."'><b>".$idx.") Query:</b> [".$cQuery['marker']." - ".$cQuery['caller']."]<br/>".$cQuery['query']."</td></tr>\n";
+				$text .= "<tr><td class='forumheader3' colspan='".$cQuery['nFields']."'><b>".$idx.") Query:</b> [".$cQuery['marker']." - ".$cQuery['caller']."]<br />".$cQuery['query']."</td></tr>\n";
 				if (isset($cQuery['explain'])) {
 					$text .= $cQuery['explain'];
 				}
@@ -335,7 +335,7 @@
 		$aSum['DB Time']=number_format($aSum['DB Time']*1000.0, 1);
 
 		$text .= "<tr><td class='fcaption'><b>".implode("</b>&nbsp;</td><td class='fcaption' style='text-align:right'><b>", $aSum)."</b>&nbsp;</td><td class='fcaption'>&nbsp;</td></tr>\n";
-		$text .= "\n</table><br/>\n";
+		$text .= "\n</table><br />\n";
 
 		//
 		// Stats by Table
@@ -381,7 +381,7 @@
 		$aSum['%DB Count']=($sql->db_QueryCount()) ? number_format(100.0 * ($aSum['DB Count'] / ($sql->db_QueryCount())), 0) : 0;
 		$aSum['DB Time']=number_format($aSum['DB Time']*1000.0, 1);
 		$text .= "<tr><td class='fcaption'>".implode("&nbsp;</td><td class='fcaption' style='text-align:right'>", array_values($aSum))."&nbsp;</td></tr>\n";
-		$text .= "\n</table><br/>\n";
+		$text .= "\n</table><br />\n";
 
 		return $text;
 	}
@@ -545,7 +545,7 @@
 			$text .= "<tr class='forumheader3'><td>".implode("&nbsp;</td><td>", array_values($curLog))."&nbsp;</td></tr>\n";
 		}
 
-		$text .= "</table><br/>\n";
+		$text .= "</table><br />\n";
 
 		return $text;
 	}
@@ -573,7 +573,7 @@
 //
 	if (isset($e107_Clean_Exit)) return; // We've now sent a footer...
 	
-//	echo isset($In_e107_Footer) ? "In footer" : "In startup".'<br>';
+//	echo isset($In_e107_Footer) ? "In footer" : "In startup".'<br />';
 
 	while (ob_get_level() > 0) {
 		ob_end_flush();
diff -x .svn -aruN 0.7.11.src/e107_handlers/e107_class.php 0.7.12.src/e107_handlers/e107_class.php
--- 0.7.11.src/e107_handlers/e107_class.php	2007-08-13 14:56:24.000000000 -0500
+++ 0.7.12.src/e107_handlers/e107_class.php	2008-05-16 14:40:18.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/e107_class.php,v $
-|     $Revision: 1.61 $
-|     $Date: 2007/08/13 19:56:24 $
+|     $Revision: 1.62 $
+|     $Date: 2008/05/16 19:40:18 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -133,37 +133,50 @@
 	 * Check if current user is banned
 	 *
 	 */
-	function ban() {
-		global $sql, $e107, $tp, $pref;
-		$ban_count = $sql->db_Count("banlist");
-		if($ban_count)
-		{
-			$ip = $this->getip();
-			$tmp = explode(".",$ip);
-			$wildcard =  $tmp[0].".".$tmp[1].".".$tmp[2].".*";
-			$wildcard2 = $tmp[0].".".$tmp[1].".*.*";
-
-			if(varsettrue($pref['enable_rdns']))
-			{
-				$tmp = $e107->get_host_name(getenv('REMOTE_ADDR'));
-				preg_match("/[\w]+\.[\w]+$/si", $tmp, $match);
-				$bhost = (isset($match[0]) ? " OR banlist_ip='".$tp -> toDB($match[0], true)."'" : "");
-			}
-			else
-			{
-				$bhost = "";
-			}
+	function ban() 
+	{
+	  global $sql, $e107, $tp, $pref;
+	  $ban_count = $sql->db_Count("banlist");
+	  if($ban_count)
+	  {
+	    $vals = array();
+		$ip = $this->getip();
+		if ($ip != 'x.x.x.x')
+		{
+		  $tmp = explode(".",$ip);
+		  $vals[] = $tp -> toDB($_SERVER['REMOTE_ADDR'], true);
+		  $vals[] = $tmp[0].".".$tmp[1].".".$tmp[2].".*";
+		  $vals[] = $tmp[0].".".$tmp[1].".*.*";
+		}
 
-			if ($ip != '127.0.0.1')
-			{
-				if ($sql->db_Select("banlist", "*", "banlist_ip='".$tp -> toDB($_SERVER['REMOTE_ADDR'], true)."' OR banlist_ip='".USEREMAIL."' OR banlist_ip='{$ip}' OR banlist_ip='{$wildcard}' OR banlist_ip='{$wildcard2}' {$bhost}"))
-				{
-				  header("HTTP/1.1 403 Forbidden", true);
-					// enter a message here if you want some text displayed to banned users ...
-					exit();
-				}
-			}
+		if(varsettrue($pref['enable_rdns']))
+		{
+		  $tmp = array_reverse(explode('.',$addr = $e107->get_host_name(getenv('REMOTE_ADDR'))));
+		  $line = '';
+		  $vals[] = $addr;
+		  foreach ($tmp as $e)
+		  {
+			$line = '.'.$e.$line;
+			$vals[] = '*'.$line;
+		  }
+		}
+
+		if ((defined('USEREMAIL') && USEREMAIL))
+		{
+		  $vals[] = USEREMAIL;
 		}
+
+		if (($ip != '127.0.0.1') && count($vals))
+		{
+		  $match = "`banlist_ip`='".implode("' OR `banlist_ip`='",$vals)."'";
+		  if ($sql->db_Select("banlist", "*",$match))
+		  {
+			header("HTTP/1.1 403 Forbidden", true);
+				// enter a message here if you want some text displayed to banned users ...
+			exit();
+		  }
+		}
+	  }
 	}
 
 	/**
@@ -171,12 +184,16 @@
 	 *
 	 * @return string
 	 */
-	function getip() {
-		if(!$this->_ip_cache){
-			if (getenv('HTTP_X_FORWARDED_FOR')) {
-				$ip=$_SERVER['REMOTE_ADDR'];
-				if (preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip3)) {
-				$ip2 = array('#^0\..*#', 
+	function getip() 
+	{
+	  if(!$this->_ip_cache)
+	  {
+		if (getenv('HTTP_X_FORWARDED_FOR')) 
+		{
+		  $ip=$_SERVER['REMOTE_ADDR'];
+		  if (preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip3)) 
+		  {
+			$ip2 = array('#^0\..*#', 
 					'#^127\..*#', 							// Local loopbacks
 					'#^192\.168\..*#', 						// RFC1918 - Private Network
 					'#^172\.(?:1[6789]|2\d|3[01])\..*#', 	// RFC1918 - Private network
@@ -184,24 +201,29 @@
 					'#^169\.254\..*#', 						// RFC3330 - Link-local, auto-DHCP 
 					'#^2(?:2[456789]|[345][0-9])\..*#'		// Single check for Class D and Class E
 					);
-					$ip = preg_replace($ip2, $ip, $ip3[1]);
-				}
-			} else {
-				$ip = $_SERVER['REMOTE_ADDR'];
-			}
-			if ($ip == "") {
-				$ip = "x.x.x.x";
-			}
-			$this->_ip_cache = $ip;
+			$ip = preg_replace($ip2, $ip, $ip3[1]);
+		  }
+		} 
+		else 
+		{
+		  $ip = $_SERVER['REMOTE_ADDR'];
+		}
+		if ($ip == "") 
+		{
+		  $ip = "x.x.x.x";
 		}
-		return $this->_ip_cache;
+		$this->_ip_cache = $ip;
+	  }
+	  return $this->_ip_cache;
 	}
 
-	function get_host_name($ip_address) {
-		if(!$this->_host_name_cache[$ip_address]) {
-			$this->_host_name_cache[$ip_address] = gethostbyaddr($ip_address);
-		}
-		return $this->_host_name_cache[$ip_address];
+	function get_host_name($ip_address) 
+	{
+	  if (!varsettrue($this->_host_name_cache[$ip_address]))
+	  {
+		$this->_host_name_cache[$ip_address] = gethostbyaddr($ip_address);
+	  }
+	  return $this->_host_name_cache[$ip_address];
 	}
 
 	/**
diff -x .svn -aruN 0.7.11.src/e107_handlers/e_parse_class.php 0.7.12.src/e107_handlers/e_parse_class.php
--- 0.7.11.src/e107_handlers/e_parse_class.php	2007-12-30 03:49:42.000000000 -0600
+++ 0.7.12.src/e107_handlers/e_parse_class.php	2008-07-17 14:17:54.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/e_parse_class.php,v $
-|     $Revision: 1.203 $
-|     $Date: 2007/12/30 09:49:42 $
+|     $Revision: 1.211 $
+|     $Date: 2008/07/17 19:17:54 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -90,7 +90,7 @@
 
 				'user_body' =>					// text is user-entered (i.e. untrusted)'body' or 'bulk' text (e.g. custom page body, content body)
 					array(
-						// no changes to default-on items
+						'constants'=>TRUE
 						),
 
 				'linktext' =>			// text is the 'content' of a link (A tag, etc)
@@ -245,16 +245,14 @@
 	function htmlwrap($str, $width, $break = "\n", $nobreak = "", $nobr = "pre", $utf = false)
 	{
 		/*
-		* Parts of code from  htmlwrap() function - v1.6
-		* Copyright (c) 2004 Brian Huisman AKA GreyWyvern
-		* http://www.greywyvern.com/code/php/htmlwrap_1.1.php.txt
-		*
-		* This program may be distributed under the terms of the GPL
-		*   - http://www.gnu.org/licenses/gpl.txt
-		*
-		* Other mods by steved
+		Pretty well complete rewrite to try and handle utf-8 properly.
+		Breaks a utf-8 string every $width characters max. If possible, breaks after 'safe' characters.
+		$break is the character inserted to flag the break.
 		*/
 
+  if (!ctype_digit($width)) return $str;		// Don't wrap if non-numeric width
+  if ($width < 6) return $str;					// Trap stupid wrap counts, as well
+
   // Transform protected element lists into arrays
   $nobreak = explode(" ", strtolower($nobreak));
 
@@ -268,8 +266,8 @@
   $lbrks = "/?!%)-}]\\\"':;&";
 
   // Is $str a UTF8 string?
-	$utf8 = ($utf || CHARSET == 'utf-8') ? "u" : "";
-
+	$utf8 = ($utf || strtolower(CHARSET) == 'utf-8') ? "u" : "";
+	
 
 // Start of the serious stuff - split into HTML tags and text between
 	  $content = preg_split('#(<.*?>)#mis', $str, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
@@ -314,51 +312,84 @@
         // Else if we're outside any tags, and with non-zero length string...
         } 
 		elseif ($value) 
-		{
-          // If unprotected...
+		{    // If unprotected...
           if (!count($innbk)) 
 		  {
             // Use the ACK (006) ASCII symbol to replace all HTML entities temporarily
             $value = str_replace("\x06", "", $value);
             preg_match_all("/&([a-z\d]{2,7}|#\d{2,5});/i", $value, $ents);
             $value = preg_replace("/&([a-z\d]{2,7}|#\d{2,5});/i", "\x06", $value);
-
-            // Enter the line-break loop
-            do 
-			{
-              $store = $value;
-
-              // Find the first stretch of characters over the $width limit
-              if (preg_match("/^(.*?\s)?(\S{".$width."})(?!(".preg_quote($break, "/")."|\s))(.*)$/s".(($utf8) ? "u" : ""), $value, $match)) 
-			  {
-                if (strlen($match[2])) 
+			$split = preg_split('#(\s)#'.$utf8, $value, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
+			$value = '';
+			foreach ($split as $sp)
+			{
+			  while (strlen($sp) > $width)
+			  {	// Enough characters that we may need to do something.
+				$pulled = '';
+				if ($utf8)
 				{
-                  // Determine the last "safe line-break" character within this match
-                  for ($x = 0, $ledge = 0; $x < strlen($lbrks); $x++) $ledge = max($ledge, strrpos($match[2], $lbrks{$x}));
-                  if (!$ledge) $ledge = strlen($match[2]) - 1;
-
-                  // Insert the modified string
-                  $value = $match[1].substr($match[2], 0, $ledge + 1).$break.substr($match[2], $ledge + 1).$match[4];
-                }
-              }
-            // Loop while overlimit strings are still being found
-            } while ($store != $value);
+				  // Pull out a piece of the maximum permissible length
+				  preg_match('#^((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$width.'})(.{0,1}).*#s',$sp,$matches);
 
+				  if (empty($matches[2]))
+				  {  // utf-8 length is less than specified - treat as a special case
+				    $value .= $sp;
+					$sp = '';
+				  }
+				  else
+				  {		// Need to find somewhere to break the string
+					for ($i = strlen($matches[1])-1; $i >= 0; $i--)
+					{
+					  if (strpos($lbrks,$matches[1][$i]) !== FALSE) break;
+					}
+					if ($i < 0)
+					{	// No 'special' break character found - break at the word boundary
+					  $pulled = $matches[1];
+					}
+					else
+					{
+					  $pulled = substr($sp,0,$i+1);
+					}
+				  }
+				}
+				else
+				{
+					for ($i = min($width,strlen($sp)); $i > 0; $i--)
+					{
+					  if (strpos($lbrks,$sp[$i-1]) !== FALSE) break;		// No speed advantage to defining match character
+					}
+					if ($i == 0)
+					{	// No 'special' break boundary character found - break at the word boundary
+					  $pulled = substr($sp,0,$width);
+					}
+					else
+					{
+					  $pulled = substr($sp,0,$i);
+					}
+				}
+				if ($pulled)
+				{
+				  $value .= $pulled.$break;
+				  $sp = substr($sp,strlen($pulled));			// Shorten $sp by whatever we've processed (will work even for utf-8)
+				}
+			  }
+			  $value .= $sp;		// Add in any residue
+			}
             // Put captured HTML entities back into the string
             foreach ($ents[0] as $ent) $value = preg_replace("/\x06/", $ent, $value, 1);
-          }
+          } 
         }
-
         // Send the modified segment down the drain
         $drain .= $value;
 	  }
-
 	  // Return contents of the drain
 	  return $drain;
 	}
 
 
 
+
+
 	function html_truncate ($text, $len = 200, $more = "[more]")
 	{
 		$pos = 0;
@@ -430,15 +461,24 @@
 	function text_truncate($text, $len = 200, $more = "[more]") 
 	{
 	  if (strlen($text) <= $len) return $text; 		// Always valid
-	  if (CHARSET !== 'utf-8') return substr($text,0,$len).$more;	// Non-utf-8 - one byte per character - simple
-  
-	  // Its a utf-8 string here - don't know whether its longer than allowed length yet
-	  preg_match('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,0}'.
+	  if (strtolower(CHARSET) !== 'utf-8')
+	  {
+		$ret = substr($text,0,$len);	// Non-utf-8 - one byte per character - simple (unless there's an entity involved)
+	  }
+	  else
+	  {	  // Its a utf-8 string here - don't know whether its longer than allowed length yet
+		preg_match('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,0}'.
 				'((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$len.'})(.{0,1}).*#s',$text,$matches);
 
-	  $ret = $matches[1];
-	  if (!empty($matches[2])) $ret .= $more;
-	  return $ret;
+		if (empty($matches[2])) return $text;			// return if utf-8 length is less than max as well
+		$ret = $matches[1];
+	  }
+	  // search for possible broken html entities
+      // - if an & is in the last 8 chars, removing it and whatever follows shouldn't hurt
+      // it should work for any characters encoding
+      $leftAmp = strrpos(substr($ret,-8), '&');
+      if($leftAmp) $ret = substr($ret,0,strlen($ret)-8+$leftAmp);
+	  return $ret.$more;
 	}
 
 
@@ -590,7 +630,7 @@
             if ($pref['link_replace'] && !$opts['no_replace'])
 			{
               $_ext = ($pref['links_new_window'] ? " rel=\"external\"" : "");
-              $text = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" {$_ext}>".$pref['link_text']."</a>", $text);
+              $text = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<,]*)#is", "\\1<a href=\"\\2\" {$_ext}>".$pref['link_text']."</a>", $text);
 			  $text = preg_replace("#(^|[\n \]])((www|ftp)\.[\w+-]+?\.[\w+\-.]*(?(?=/)(/.+?(?=\s|,\s))|(?=\W)))#is", "\\1<a href=\"http://\\2\" {$_ext}>".$pref['link_text']."</a>", $text);
               if(CHARSET != "utf-8" && CHARSET != "UTF-8")
 			  {
diff -x .svn -aruN 0.7.11.src/e107_handlers/form_handler.php 0.7.12.src/e107_handlers/form_handler.php
--- 0.7.11.src/e107_handlers/form_handler.php	2007-03-23 16:46:48.000000000 -0500
+++ 0.7.12.src/e107_handlers/form_handler.php	2008-04-04 16:40:50.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/form_handler.php,v $
-|     $Revision: 1.7 $
-|     $Date: 2007/03/23 21:46:48 $
+|     $Revision: 1.8 $
+|     $Date: 2008/04/04 21:40:50 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -28,7 +28,7 @@
 		return "\n<form action='".$form_action."' ".$method.$target.$name.$form_enctype.$form_js.">";
 	}
 	 
-	function form_text($form_name, $form_size, $form_value, $form_maxlength, $form_class = "tbox", $form_readonly = "", $form_tooltip = "", $form_js = "") {
+	function form_text($form_name, $form_size, $form_value, $form_maxlength = FALSE, $form_class = "tbox", $form_readonly = "", $form_tooltip = "", $form_js = "") {
 		$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
 		$value = (isset($form_value) ? " value='".$form_value."'" : "");
 		$size = ($form_size ? " size='".$form_size."'" : "");
@@ -38,7 +38,7 @@
 		return "\n<input class='".$form_class."' type='text' ".$name.$value.$size.$maxlength.$readonly.$tooltip.$form_js." />";
 	}
 	 
-	function form_password($form_name, $form_size, $form_value, $form_maxlength, $form_class = "tbox", $form_readonly = "", $form_tooltip = "", $form_js = "") {
+	function form_password($form_name, $form_size, $form_value, $form_maxlength = FALSE, $form_class = "tbox", $form_readonly = "", $form_tooltip = "", $form_js = "") {
 		$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
 		$value = (isset($form_value) ? " value='".$form_value."'" : "");
 		$size = ($form_size ? " size='".$form_size."'" : "");
diff -x .svn -aruN 0.7.11.src/e107_handlers/language_class.php 0.7.12.src/e107_handlers/language_class.php
--- 0.7.11.src/e107_handlers/language_class.php	2007-03-30 20:01:46.000000000 -0500
+++ 0.7.12.src/e107_handlers/language_class.php	2008-08-22 04:52:59.000000000 -0500
@@ -4,14 +4,16 @@
 |     e107 website system - Language Class.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/language_class.php,v $
-|     $Revision: 1.10 $
-|     $Date: 2007/03/31 01:01:46 $
+|     $Revision: 1.11 $
+|     $Date: 2008/08/22 09:52:59 $
 |     $Author: e107coders $
 +----------------------------------------------------------------------------+
 */
 
 class language{
 
+// http://www.loc.gov/standards/iso639-2/php/code_list.php
+
 	var $list = array(
             "aa" => "Afar",
 			"ab" => "Abkhazian",
@@ -111,7 +113,7 @@
 	        "ng" => "Ndonga",
 	        "ne" => "Nepali",
 	        "nl" => "Dutch",
-	        "nb" => "Norwegian",
+	        "no" => "Norwegian",
 
 	        "ny" => "Chichewa",
 	        "or" => "Oriya",
diff -x .svn -aruN 0.7.11.src/e107_handlers/login.php 0.7.12.src/e107_handlers/login.php
--- 0.7.11.src/e107_handlers/login.php	2007-01-11 12:35:06.000000000 -0600
+++ 0.7.12.src/e107_handlers/login.php	2008-04-29 14:30:45.000000000 -0500
@@ -12,9 +12,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/login.php,v $
-|     $Revision: 1.39 $
-|     $Date: 2007/01/11 18:35:06 $
-|     $Author: mcfly_e107 $
+|     $Revision: 1.40 $
+|     $Date: 2008/04/29 19:30:45 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -132,7 +132,7 @@
 				}
 				$edata_li = array("user_id" => $user_id, "user_name" => $username);
 				$e_event->trigger("login", $edata_li);
-				$redir = (e_QUERY ? e_SELF."?".e_QUERY : e_SELF);
+				$redir = str_replace('&amp;','&',(e_QUERY ? e_SELF."?".e_QUERY : e_SELF));
 				if (strstr($_SERVER['SERVER_SOFTWARE'], "Apache")) {
 					header("Location: ".$redir);
 					exit;
diff -x .svn -aruN 0.7.11.src/e107_handlers/magpie_rss.php 0.7.12.src/e107_handlers/magpie_rss.php
--- 0.7.11.src/e107_handlers/magpie_rss.php	2006-02-07 06:58:26.000000000 -0600
+++ 0.7.12.src/e107_handlers/magpie_rss.php	2008-06-05 14:55:57.000000000 -0500
@@ -391,7 +391,7 @@
                 
                 $atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified'];
                 if ( $atom_date ) {
-                    $epoch = @parse_w3cdtf($item['modified']);
+                    $epoch = @parse_w3cdtf($atom_date);
                     if ($epoch and $epoch > 0) {
                         $item['date_timestamp'] = $epoch;
                     }
diff -x .svn -aruN 0.7.11.src/e107_handlers/search/search_pages.php 0.7.12.src/e107_handlers/search/search_pages.php
--- 0.7.11.src/e107_handlers/search/search_pages.php	2007-11-04 14:41:31.000000000 -0600
+++ 0.7.12.src/e107_handlers/search/search_pages.php	2008-06-24 12:39:29.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/search_pages.php,v $
-|     $Revision: 1.3 $
-|     $Date: 2007/11/04 20:41:31 $
+|     $Revision: 1.4 $
+|     $Date: 2008/06/24 17:39:29 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -31,7 +31,7 @@
 $weights = array('1.2', '0.6');
 $no_results = LAN_198;
 
-$where = "page_class IN (".USERCLASS_LIST.") AND `menu_name`='' AND".$advanced_where;
+$where = "page_class IN (".USERCLASS_LIST.") AND `page_theme` = '' AND".$advanced_where;
 $order = array('page_datestamp' => DESC);
 $table = "page";
 
diff -x .svn -aruN 0.7.11.src/e107_handlers/shortcode_handler.php 0.7.12.src/e107_handlers/shortcode_handler.php
--- 0.7.11.src/e107_handlers/shortcode_handler.php	2007-07-18 15:46:42.000000000 -0500
+++ 0.7.12.src/e107_handlers/shortcode_handler.php	2008-03-02 15:08:20.000000000 -0600
@@ -12,8 +12,8 @@
 | GNU General Public License (http://gnu.org).
 |
 | $Source: /cvsroot/e107/e107_0.7/e107_handlers/shortcode_handler.php,v $
-| $Revision: 1.44 $
-| $Date: 2007/07/18 20:46:42 $
+| $Revision: 1.45 $
+| $Date: 2008/03/02 21:08:20 $
 | $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -109,36 +109,36 @@
 		}
 		else
 		{
-			$sc_perms = e_UC_PUBLIC;			// Default permissions are 'everybody'
-			if ($this->parseSCFiles == TRUE)
+		  if ($this->parseSCFiles == TRUE)
+		  {
+			if (is_array($this -> registered_codes) && array_key_exists($code, $this->registered_codes))
 			{
-				if (is_array($this -> registered_codes) && array_key_exists($code, $this->registered_codes))
-				{
-					if($this->registered_codes[$code]['type'] == 'plugin')
-					{
-					  if (isset($this->registered_codes[$code]['perms'])) $sc_perms = $this->registered_codes[$code]['perms'];
-					  $scFile = e_PLUGIN.strtolower($this->registered_codes[$code]['path']).'/'.strtolower($code).'.sc';
-					}
-					else
-					{
-						$scFile = THEME.strtolower($code).'.sc';
-					}
+			  if($this->registered_codes[$code]['type'] == 'plugin')
+			  {
+				if (check_class($this->registered_codes[$code]['perms']))
+				{	// Use the plugin 'override' shortcode
+				  $scFile = e_PLUGIN.strtolower($this->registered_codes[$code]['path']).'/'.strtolower($code).'.sc';
 				}
 				else
-				{
-						$scFile = e_FILE."shortcode/".strtolower($code).".sc";
-				}
-				if (!check_class($sc_perms))
-				{	// Mainly to pick up e_UC_NOBODY
-				  $shortcode = 'return;';
-				  $this->scList[$code] = 'return;';
-				}
-				elseif (file_exists($scFile)) 
-				{
-					$shortcode = file_get_contents($scFile);
-					$this->scList[$code] = $shortcode;
+				{	// Look for a core shortcode
+				  $scFile = e_FILE."shortcode/".strtolower($code).".sc";
 				}
+			  }
+			  else
+			  {
+				$scFile = THEME.strtolower($code).'.sc';
+			  }
+			}
+			else
+			{
+			  $scFile = e_FILE."shortcode/".strtolower($code).".sc";
+			}
+			if (file_exists($scFile)) 
+			{
+			  $shortcode = file_get_contents($scFile);
+			  $this->scList[$code] = $shortcode;
 			}
+		  }
 		}
 
 		if (!isset($shortcode))
diff -x .svn -aruN 0.7.11.src/e107_handlers/sitelinks_class.php 0.7.12.src/e107_handlers/sitelinks_class.php
--- 0.7.11.src/e107_handlers/sitelinks_class.php	2007-08-17 23:55:21.000000000 -0500
+++ 0.7.12.src/e107_handlers/sitelinks_class.php	2008-05-30 15:57:20.000000000 -0500
@@ -12,9 +12,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/sitelinks_class.php,v $
-|     $Revision: 1.118 $
-|     $Date: 2007/08/18 04:55:21 $
-|     $Author: e107coders $
+|     $Revision: 1.119 $
+|     $Date: 2008/05/30 20:57:20 $
+|     $Author: e107steved $
 +---------------------------------------------------------------+
 */
 
@@ -58,8 +58,9 @@
         global $pref, $ns, $e107cache, $linkstyle;
         $usecache = ((trim(defset('LINKSTART_HILITE')) != "" || trim(defset('LINKCLASS_HILITE')) != "") ? false : true);
 
-        if ($usecache && !strpos(e_SELF, e_ADMIN) & ($data = $e107cache->retrieve('sitelinks_'.$cat.md5($linkstyle.e_PAGE.e_QUERY)))) {
-            return $data;
+        if ($usecache && !strpos(e_SELF, e_ADMIN) && ($data = $e107cache->retrieve('sitelinks_'.$cat.md5($linkstyle.e_PAGE.e_QUERY)))) 
+		{
+          return $data;
         }
 
         if (LINKDISPLAY == 4) {
@@ -281,7 +282,7 @@
     $link_qry = (isset($tmp[1])) ? $tmp[1] : "";
     $link_slf = (isset($tmp[0])) ? $tmp[0] : "";
     $link_pge = basename($link_slf);
-    $link_match = strpos(e_SELF,$tmp[0]);
+	$link_match = (empty($tmp[0])) ? "": strpos(e_SELF,$tmp[0]);	// e_SELF is the actual displayed page
 
     if(e_MENU == "debug" && getperms('0'))
     {
@@ -394,15 +395,15 @@
                 return true;
             }
         }
-        if(!preg_match("/all|item|cat|list/", e_QUERY) && (strpos(e_SELF, str_replace("../", "",$link)) !== false)){
+		if(!preg_match("/all|item|cat|list/", e_QUERY) && (empty($link) == false) && (strpos(e_SELF, str_replace("../", "",$link)) !== false)){
             return true;
         }
 
-        if((!$link_qry && !e_QUERY) && (strpos(e_SELF,$link) !== FALSE)){
+		if((!$link_qry && !e_QUERY) && (empty($link) == FALSE) && (strpos(e_SELF,$link) !== FALSE)){
             return TRUE;
         }
 
-        if(($link_slf == e_SELF && !link_qry) || (e_QUERY && strpos(e_SELF."?".e_QUERY,$link)!== FALSE) ){
+		if(($link_slf == e_SELF && !link_qry) || (e_QUERY && empty($link) == FALSE && strpos(e_SELF."?".e_QUERY,$link)!== FALSE) ){
             return TRUE;
         }
 
diff -x .svn -aruN 0.7.11.src/e107_handlers/theme_handler.php 0.7.12.src/e107_handlers/theme_handler.php
--- 0.7.11.src/e107_handlers/theme_handler.php	2007-05-04 15:51:11.000000000 -0500
+++ 0.7.12.src/e107_handlers/theme_handler.php	2008-04-10 14:23:51.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/theme_handler.php,v $
-|     $Revision: 1.35 $
-|     $Date: 2007/05/04 20:51:11 $
+|     $Revision: 1.37 $
+|     $Date: 2008/04/10 19:23:51 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -72,47 +72,59 @@
 		$themeArray = array();
 		$tloop = 1;
 		$handle = opendir(e_THEME);
-		while (false !== ($file = readdir($handle))) {
-			if ($file != "." && $file != ".." && $file != "CVS" && $file != "templates" && is_dir(e_THEME.$file) && file_exists(e_THEME.$file."/theme.php")) {
-				if($mode == "id") {
-					$themeArray[$tloop] = $file;
-				} else {
-					$themeArray[$file]['id'] = $tloop;
+		while (false !== ($file = readdir($handle))) 
+		{
+		  if ($file != "." && $file != ".." && $file != "CVS" && $file != "templates" && is_dir(e_THEME.$file) && file_exists(e_THEME.$file."/theme.php")) 
+		  {
+			if($mode == "id") 
+			{
+			  $themeArray[$tloop] = $file;
+			} 
+			else 
+			{
+			  $themeArray[$file]['id'] = $tloop;
+			}
+			$tloop++;
+			$STYLESHEET = FALSE;
+			if(!$mode) 
+			{
+			  $handle2 = opendir(e_THEME.$file."/");
+			  while (false !== ($file2 = readdir($handle2))) 
+			  { // Read files in theme directory
+				if ($file2 != "." && $file2 != ".." && $file != "CVS" && !is_dir(e_THEME.$file."/".$file2)) 
+				{
+				  $themeArray[$file]['files'][] = $file2;
+				  if(strstr($file2, "preview.")) 
+				  {
+					$themeArray[$file]['preview'] = e_THEME.$file."/".$file2;
+				  }
+				  if(strstr($file2, "css") && !strstr($file2, "menu.css") && strpos($file2, "e_") !== 0 && strpos($file2, "admin_") !== 0)
+				  {
+					/* get information string for css file */
+					$fp=fopen(e_THEME.$file."/".$file2, "r");
+					$cssContents = fread ($fp, filesize(e_THEME.$file."/".$file2));
+					fclose($fp);
+					$nonadmin = preg_match('/\* Non-Admin(.*?)\*\//', $cssContents) ? true : false;
+					preg_match('/\* info:(.*?)\*\//', $cssContents, $match);
+					$match[1]=varset($match[1],'');
+					$themeArray[$file]['css'][] = array("name" => $file2, "info" => $match[1], "nonadmin" => $nonadmin);
+					if($STYLESHEET)
+					{
+					  $themeArray[$file]['multipleStylesheets'] = TRUE;
+					}
+					else
+					{
+					  $STYLESHEET = TRUE;
+					}
+				  }
 				}
-				$tloop++;
-				$STYLESHEET = FALSE;
-				if(!$mode) {
-					$handle2 = opendir(e_THEME.$file."/");
-					while (false !== ($file2 = readdir($handle2))) {
-						if ($file2 != "." && $file2 != ".." && $file != "CVS" && !is_dir(e_THEME.$file."/".$file2)) {
-							$themeArray[$file]['files'][] = $file2;
-							if(strstr($file2, "preview.")) {
-								$themeArray[$file]['preview'] = e_THEME.$file."/".$file2;
-							}
-							if(strstr($file2, "css") && !strstr($file2, "menu.css") && strpos($file2, "e_") !== 0 && strpos($file2, "admin_") !== 0)
-							{
-								/* get information string */
-								$fp=fopen(e_THEME.$file."/".$file2, "r");
-								$cssContents = fread ($fp, filesize(e_THEME.$file."/".$file2));
-								fclose($fp);
-								$nonadmin = preg_match('/\* Non-Admin(.*?)\*\//', $cssContents) ? true : false;
-								preg_match('/\* info:(.*?)\*\//', $cssContents, $match);
-								$match[1]=varset($match[1],'');
-								$themeArray[$file]['css'][] = array("name" => $file2, "info" => $match[1], "nonadmin" => $nonadmin);
-								if($STYLESHEET)
-								{
-									$themeArray[$file]['multipleStylesheets'] = TRUE;
-								}
-								else
-								{
-									$STYLESHEET = TRUE;
-								}
 
-							}
-						}
-						$fp=fopen(e_THEME.$file."/theme.php", "r");
-						$themeContents = fread ($fp, filesize(e_THEME.$file."/theme.php"));
-						fclose($fp);
+
+				if($file2=='theme.php')
+				{
+				  $fp=fopen(e_THEME.$file."/theme.php", "r");
+				  $themeContents = fread ($fp, filesize(e_THEME.$file."/theme.php"));
+				  fclose($fp);
 						preg_match('/themename(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match);
 						$themeArray[$file]['name'] = varset($match[3],'');
 						preg_match('/themeversion(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match);
@@ -136,14 +148,15 @@
 						$css = strtolower($match[2]);
 						$themeArray[$file]['csscompliant'] = ($css == "true" ? true : false);
 
-						if (!$themeArray[$file]['name'])
-						{
-							unset($themeArray[$file]);
-						}
-					}
-					closedir($handle2);
+				  if (!$themeArray[$file]['name'])
+				  {
+					unset($themeArray[$file]);
+				  }
 				}
+			  }
+			  closedir($handle2);
 			}
+		  }
 		}
 		closedir($handle);
 		return $themeArray;
@@ -416,8 +429,7 @@
 
 	function showPreview()
 	{
-		@include_once(e_LANGUAGE."admin/lan_theme.php");
-		@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_theme.php");
+		include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_theme.php");
 		$text = "<br /><div class='indent'>".TPVLAN_1.".</div><br />";
 		global $ns;
 		$ns->tablerender(TPVLAN_2, $text);
diff -x .svn -aruN 0.7.11.src/e107_handlers/tiny_mce/wysiwyg.php 0.7.12.src/e107_handlers/tiny_mce/wysiwyg.php
--- 0.7.11.src/e107_handlers/tiny_mce/wysiwyg.php	2007-04-12 18:35:32.000000000 -0500
+++ 0.7.12.src/e107_handlers/tiny_mce/wysiwyg.php	2008-05-31 12:55:18.000000000 -0500
@@ -4,9 +4,9 @@
 |     e107 website system - Tiny MCE controller file.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/tiny_mce/wysiwyg.php,v $
-|     $Revision: 1.35 $
-|     $Date: 2007/04/12 23:35:32 $
-|     $Author: e107coders $
+|     $Revision: 1.36 $
+|     $Date: 2008/05/31 17:55:18 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -102,7 +102,7 @@
             source = source.replace(/^\s*|\s*$/g,'');
             if(source != '')
             {
-                source = '[html]\\n' + source + '\\n[/html]';
+                source = '[html]\\n' + source + '\\n[/html]';";
 /*
 				source = source.replace(/<\/strong>/gi,'[/b]');
                 source = source.replace(/<strong>/gi,'[b]');
@@ -115,7 +115,7 @@
                 source = source.replace(/<\/strong>/gi,'[/b]');
 				source = source.replace(/<a href=\"(.*?)\"(.*?)>(.*?)<\/a>/gi,'[link=$1 $2]$3[/link]');
 */
-
+$text .= "
             }
 
 		// Convert e107 paths.
@@ -140,11 +140,12 @@
 
             if (html_bbcode_check == '[/html]') {
                 source = source.slice(0, -7);
-            }
+            }";
 /*
 			source = source.replace(/\[b\]/gi,'<strong>');
 			source = source.replace(/\[\/b\]/gi,'<\/strong>');
 */
+$text .= "
 			source = source.replace(/\{e_IMAGE\}/gi,'".$IMAGES_DIRECTORY."');
 			source = source.replace(/\{e_PLUGIN\}/gi,'".$PLUGINS_DIRECTORY."');
 
diff -x .svn -aruN 0.7.11.src/e107_handlers/traffic_class_display.php 0.7.12.src/e107_handlers/traffic_class_display.php
--- 0.7.11.src/e107_handlers/traffic_class_display.php	2005-12-14 11:37:34.000000000 -0600
+++ 0.7.12.src/e107_handlers/traffic_class_display.php	2008-07-20 12:08:29.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/traffic_class_display.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2005/12/14 17:37:34 $
-|     $Author: sweetas $
+|     $Revision: 1.3 $
+|     $Date: 2008/07/20 17:08:29 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -114,7 +114,7 @@
             $cTot = number_format($this->calTime*1000.0,4);
 
             $text .="<tr><td class='forumheader3' colspan='6'>
-            <b>Note:</b> These times have been decreased by the calibration offset:<br/>
+            <b>Note:</b> These times have been decreased by the calibration offset:<br />
             $cal2 usec per call(start,stop); $cal1 usec per call(start). Total adjustment: $cTot msec.</td></tr>\n";
             $text .="</table><br />\n";
         }
diff -x .svn -aruN 0.7.11.src/e107_handlers/upload_handler.php 0.7.12.src/e107_handlers/upload_handler.php
--- 0.7.11.src/e107_handlers/upload_handler.php	2007-12-11 15:18:04.000000000 -0600
+++ 0.7.12.src/e107_handlers/upload_handler.php	2008-07-06 16:25:21.000000000 -0500
@@ -12,8 +12,8 @@
 |        GNU General Public License (http://gnu.org).
 |
 |   $Source: /cvsroot/e107/e107_0.7/e107_handlers/upload_handler.php,v $
-|   $Revision: 1.32 $
-|   $Date: 2007/12/11 21:18:04 $
+|   $Revision: 1.34 $
+|   $Date: 2008/07/06 21:25:21 $
 |   $Author: e107steved $
 +---------------------------------------------------------------+
 */
@@ -451,13 +451,21 @@
 	if($uploaddir == e_THEME) {$upload_storagetype = 1;}
 	$options['save_to_db'] = ($upload_storagetype == "2" && $avatar == FALSE);
 
+	if (strpos($avatar,'=') !== FALSE)
+	{
+	  list($avatar,$param) = explode('=',$avatar,2);
+	}
+	else
+	{
+	  $param = USERID;
+	}
 	switch ($avatar)
 	{
 	  case 'attachment' :
 	    $avatar = "attachment+".$fileinfo;
 		break;
 	  case 'avatar' :
-	    $avatar = 'prefix+ap_'.USERID.'_';				// Prefix unique to user
+	    $avatar = 'prefix+ap_'.$param.'_';				// Prefix unique to user
 		$options['overwrite'] = TRUE;			// Allow update of avatar with same file name
 		break;
 	}
@@ -612,7 +620,7 @@
 {
   $source = trim($source);
   $mult = 1;
-  $nostrip = FALSE;
+  if (strlen($source) && (strtoupper(substr($source,-1,1)) == 'B')) $source = substr($source,0,-1);
   if (!$source || is_numeric($source))
   {
     $val = $source;
diff -x .svn -aruN 0.7.11.src/e107_handlers/user_extended_class.php 0.7.12.src/e107_handlers/user_extended_class.php
--- 0.7.11.src/e107_handlers/user_extended_class.php	2007-10-30 03:11:42.000000000 -0500
+++ 0.7.12.src/e107_handlers/user_extended_class.php	2008-06-10 14:30:04.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/user_extended_class.php,v $
-|     $Revision: 1.44 $
-|     $Date: 2007/10/30 08:11:42 $
-|     $Author: e107coders $
+|     $Revision: 1.47 $
+|     $Date: 2008/06/10 19:30:04 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -88,13 +88,40 @@
 		return (in_array($name, $this->reserved_names));
 	}
 
+
+	// $val is whatever the user entered.
+	// $params is the field definition
+	// Return FALSE if acceptable, TRUE if fail , error message on regex fail if the message is defined
+	function user_extended_validate_entry($val, $params)
+	{
+	  global $tp;
+	  $parms = explode("^,^", $params['user_extended_struct_parms']);
+	  $requiredField = $params['user_extended_struct_required'] == 1;
+	  $regex = $tp->toText($parms[1]);
+	  $regexfail = $tp->toText($parms[2]);
+      if (defined($regexfail)) { $regexfail = constant($regexfail); }
+	  if($val == '' && $requiredField) return TRUE;
+	  switch ($type)
+	  {
+		case 7 :
+		  if ($requiredField && ($val == '0000-00-00')) return TRUE;
+		  break;
+	  }
+	  if($regex != "" && $val != "")
+	  {
+		if(!preg_match($regex, $val)) return $regexfail ? $regexfail : TRUE;
+	  }
+	  return FALSE;			// Pass by default here
+	}
+
+
+
 	function user_extended_get_categories($byID = TRUE)
 	{
 	   	$ret = array();
 		global $sql;
 		if($sql->db_Select("user_extended_struct", "*", "user_extended_struct_type = 0 ORDER BY user_extended_struct_order ASC"))
 		{
-
 			if($byID == TRUE)
 			{
 				while($row = $sql->db_Fetch())
@@ -115,6 +142,7 @@
 	function user_extended_get_fields($cat = "")
 	{
 		global $sql;
+		$ret = array();
 		$more = ($cat) ? " AND user_extended_struct_parent = ".intval($cat)." " : "";
 		if($sql->db_Select("user_extended_struct", "*", "user_extended_struct_type > 0 {$more} ORDER BY user_extended_struct_order ASC"))
 		{
@@ -141,6 +169,7 @@
 		return $ret;
 	}
 
+
 	function user_extended_type_text($type, $default)
 	{
 		global $tp;
@@ -182,13 +211,14 @@
 		return $db_type.$default_text;
 	}
 
+
 	function user_extended_field_exist($name)
 	{
 		global $sql, $tp;
 		return $sql->db_Count('user_extended_struct','(*)', "WHERE user_extended_struct_name = '".$tp -> toDB($name, true)."'");
 	}
 
-	function user_extended_add($name, $text, $type, $parms, $values, $default, $required, $read, $write, $applicable, $order='', $parent)
+	function user_extended_add($name, $text, $type, $parms, $values, $default, $required, $read, $write, $applicable, $order='', $parent=0)
 	{
 		global $sql, $tp;
 		if(is_array($name))
@@ -224,6 +254,8 @@
 		return FALSE;
 	}
 
+
+
 	function user_extended_modify($id, $name, $text, $type, $parms, $values, $default, $required, $read, $write, $applicable, $parent)
 	{
 		global $sql, $tp;
@@ -273,14 +305,16 @@
 		return "<input type='checkbox' {$chk} value='1' name='{$name}' />&nbsp;".UE_LAN_HIDE;
 	}
 
+
+
 	function user_extended_edit($struct, $curval)
 	{
 		global $cal, $tp;
-		$choices = explode(",",$struct['user_extended_struct_values']);
 		if(trim($curval) == "" && $struct['user_extended_struct_default'] != "")
 		{
 			$curval = $struct['user_extended_struct_default'];
 		}
+	  $choices = explode(",",$struct['user_extended_struct_values']);
 		foreach($choices as $k => $v)
 		{
 			$choices[$k] = str_replace("[E_COMMA]", ",", $choices[$k]);
@@ -290,7 +324,8 @@
 		$regex = $tp->toText($parms[1]);
 		$regexfail = $tp->toText($parms[2]);
 		$fname = "ue[user_".$struct['user_extended_struct_name']."]";
-		if(strpos($include, 'class') === FALSE)	{
+	  if(strpos($include, 'class') === FALSE)	
+	  {
 			$include .= " class='tbox' ";
 		}
 
@@ -391,16 +426,17 @@
 		{
 			return $ueStruct;
 		}
-		global $sql, $tp;
+		global $tp;
 		$ret = array();
 		$parms = "";
 		if($orderby != "")
 		{
 			$parms = "1 ORDER BY ".$tp -> toDB($orderby, true);
 		}
-		if($sql->db_Select('user_extended_struct','*',$parms))
+		$sql_ue = new db;		// Use our own db to avoid interference with other objects
+		if($sql_ue->db_Select('user_extended_struct','*',$parms))
 		{
-			while($row = $sql->db_Fetch())
+			while($row = $sql_ue->db_Fetch())
 			{
 				$ret['user_'.$row['user_extended_struct_name']] = $row;
 			}
@@ -409,6 +445,7 @@
 		return $ret;
 	}
 
+
 	function parse_extended_xml($contents, $no_cache = FALSE)
 	{
 		if($no_cache == FALSE && $this->extended_xml)
diff -x .svn -aruN 0.7.11.src/e107_handlers/userclass_class.php 0.7.12.src/e107_handlers/userclass_class.php
--- 0.7.11.src/e107_handlers/userclass_class.php	2007-04-11 16:25:01.000000000 -0500
+++ 0.7.12.src/e107_handlers/userclass_class.php	2008-04-25 14:39:47.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_handlers/userclass_class.php,v $
-|     $Revision: 1.21 $
-|     $Date: 2007/04/11 21:25:01 $
+|     $Revision: 1.22 $
+|     $Date: 2008/04/25 19:39:47 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -259,14 +259,7 @@
 		foreach($uinfoArray as $uid => $curclass)
 		{
 			$newarray = array_diff(explode(',', $curclass), array('', $cid));
-			if (count($newarray) > 1)
-			{
-				$new_userclass = implode(',', $newarray);
-			}
-			else
-			{
-				$new_userclass = $newarray[0];
-			}
+			$new_userclass = implode(',', $newarray);
 			$sql2->db_Update('user', "user_class='".$tp -> toDB($new_userclass, true)."' WHERE user_id=".intval($uid));
 		}
 	}
diff -x .svn -aruN 0.7.11.src/e107_languages/English/admin/help/custommenu.php 0.7.12.src/e107_languages/English/admin/help/custommenu.php
--- 0.7.11.src/e107_languages/English/admin/help/custommenu.php	2005-12-14 11:37:43.000000000 -0600
+++ 0.7.12.src/e107_languages/English/admin/help/custommenu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,26 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/custommenu.php,v $
-|     $Revision: 1.3 $
-|     $Date: 2005/12/14 17:37:43 $
-|     $Author: sweetas $
-+----------------------------------------------------------------------------+
-*/
-
-if (!defined('e107_INIT')) { exit; }
-
-$text = "From this screen you can create custom menus or custom pages with your own content in them.<br /><br />
-Please see <a href='http://docs.e107.org?Custom Pages'>http://docs.e107.org?Custom Pages</a>";
-
-$ns -> tablerender(CUSLAN_18, $text);
-?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_languages/English/admin/help/list_menu_conf.php 0.7.12.src/e107_languages/English/admin/help/list_menu_conf.php
--- 0.7.11.src/e107_languages/English/admin/help/list_menu_conf.php	2005-12-14 11:37:43.000000000 -0600
+++ 0.7.12.src/e107_languages/English/admin/help/list_menu_conf.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,30 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/list_menu_conf.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2005/12/14 17:37:43 $
-|     $Author: sweetas $
-+----------------------------------------------------------------------------+
-*/
-
-if (!defined('e107_INIT')) { exit; }
-
-$text = "In this section you can configure 3 menus<br>
-<b> New Articles Menu</b> <br>
-Enter a number for example '5' in the first field to show the first 5 articles, leave empty to see all, You configure what the title of the link should be to the rest of the articles in the second field, when you leave this last option empty it won't create a link, for example: 'All articles'<br>
-<b> Comments/Forum Menu</b> <br>
-The number of comments default to 5, the number of characters default to 10000. The postfix is for if a line is too long it will cut it off and append this postfix to the end, a good choice for this is '...', check original topics if you want to see those in the overview.<br>
-
-";
-$ns -> tablerender("Menu Configuration Help", $text);
-?>
diff -x .svn -aruN 0.7.11.src/e107_languages/English/admin/help/menus2.php 0.7.12.src/e107_languages/English/admin/help/menus2.php
--- 0.7.11.src/e107_languages/English/admin/help/menus2.php	2006-08-26 21:24:44.000000000 -0500
+++ 0.7.12.src/e107_languages/English/admin/help/menus2.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,28 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/menus2.php,v $
-|     $Revision: 1.3 $
-|     $Date: 2006/08/27 02:24:44 $
-|     $Author: mcfly_e107 $
-+----------------------------------------------------------------------------+
-*/
-
-if (!defined('e107_INIT')) { exit; }
-
-$caption = "Menu Help";
-$text .= "You can arrange where and in which order your menu items are displayed from here. Use the arrows to move the menus up and down until you are satisfied with their positioning.<br />
-The menu items in the middle of the screen are de-activated; you can activate these by choosing a location to put them in.
-";
-
-$ns -> tablerender("Menus Help", $text);
-?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_languages/English/admin/help/poll.php 0.7.12.src/e107_languages/English/admin/help/poll.php
--- 0.7.11.src/e107_languages/English/admin/help/poll.php	2005-12-14 11:37:43.000000000 -0600
+++ 0.7.12.src/e107_languages/English/admin/help/poll.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,26 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/poll.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2005/12/14 17:37:43 $
-|     $Author: sweetas $
-+----------------------------------------------------------------------------+
-*/
-
-if (!defined('e107_INIT')) { exit; }
-
-$text = "You set polls/surveys from this page, just type in the poll title and options, preview it and if all looks ok tick the box to make it active.<br /><br />
-To see the poll, go to your menus page and make sure poll_menu is activated.";
-
-$ns -> tablerender("Polls", $text);
-?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_languages/English/admin/lan_admin.php 0.7.12.src/e107_languages/English/admin/lan_admin.php
--- 0.7.11.src/e107_languages/English/admin/lan_admin.php	2007-07-03 14:22:15.000000000 -0500
+++ 0.7.12.src/e107_languages/English/admin/lan_admin.php	2008-06-29 10:23:37.000000000 -0500
@@ -4,15 +4,15 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_admin.php,v $
-|     $Revision: 1.58 $
-|     $Date: 2007/07/03 19:22:15 $
+|     $Revision: 1.60 $
+|     $Date: 2008/06/29 15:23:37 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 define("ADLAN_0", "News");
 define("ADLAN_1", "Add/edit/delete news items");
-define("ADLAN_2", "News Categories");
-define("ADLAN_3", "Add/edit/delete news categories");
+//define("ADLAN_2", "News Categories");
+//define("ADLAN_3", "Add/edit/delete news categories");
 define("ADLAN_4", "Preferences");
 define("ADLAN_5", "Edit Site Preferences");
 define("ADLAN_6", "Menus");
@@ -21,26 +21,26 @@
 define("ADLAN_9", "Add/delete site administrators");
 define("ADLAN_10", "Admin password");
 define("ADLAN_11", "Change your password");
-define("ADLAN_12", "Forums");
-define("ADLAN_13", "Add/Edit Forums");
-define("ADLAN_14", "Articles");
-define("ADLAN_15", "Add new/edit/delete articles");
-define("ADLAN_16", "Content");
-define("ADLAN_17", "Add new/edit/delete content pages");
-define("ADLAN_18", "Reviews");
-define("ADLAN_19", "Add new/edit/delete reviews");
-define("ADLAN_22", "Link Categories");
-define("ADLAN_23", "Add new/edit/delete link categories");
+//define("ADLAN_12", "Forums");
+//define("ADLAN_13", "Add/Edit Forums");
+//define("ADLAN_14", "Articles");
+//define("ADLAN_15", "Add new/edit/delete articles");
+//define("ADLAN_16", "Content");
+//define("ADLAN_17", "Add new/edit/delete content pages");
+//define("ADLAN_18", "Reviews");
+//define("ADLAN_19", "Add new/edit/delete reviews");
+//define("ADLAN_22", "Link Categories");
+//define("ADLAN_23", "Add new/edit/delete link categories");
 define("ADLAN_24", "Downloads");
 define("ADLAN_25", "Manage Downloads");
-define("ADLAN_26", "Download Categories");
-define("ADLAN_27", "Add new/edit/delete download categories");
+//define("ADLAN_26", "Download Categories");
+//define("ADLAN_27", "Add new/edit/delete download categories");
 define("ADLAN_28", "Welcome Message");
 define("ADLAN_29", "Set static welcome message");
 define("ADLAN_30", "File Manager");
 define("ADLAN_31", "Manage/upload files");
-define("ADLAN_32", "Submitted News");
-define("ADLAN_33", "Review user submitted news items");
+//define("ADLAN_32", "Submitted News");
+//define("ADLAN_33", "Review user submitted news items");
 define("ADLAN_34", "Banlist");
 define("ADLAN_35", "Ban visitors");
 define("ADLAN_36", "Users");
@@ -57,53 +57,53 @@
 define("ADLAN_47", "Welcome");
 define("ADLAN_48", "Logged in");
 define("ADLAN_49", "main site administrator");
-define("ADLAN_50", "permissions");
+//define("ADLAN_50", "permissions");
 define("ADLAN_51", "Please log in to gain access to administration area");
 define("ADLAN_52", "Admin Front Page");
 define("ADLAN_53", "Leave Admin");
 define("ADLAN_54", "Banners");
 define("ADLAN_55", "Configure banners");
-define("ADLAN_56", "Chatbox");
-define("ADLAN_57", "Configure chatbox");
+//define("ADLAN_56", "Chatbox");
+//define("ADLAN_57", "Configure chatbox");
 define("ADLAN_58", "Emoticons");
 define("ADLAN_59", "Configure emoticons");
 define("ADLAN_60", "Front Page");
 define("ADLAN_61", "Configure front page content");
-define("ADLAN_62", "News Feeds");
-define("ADLAN_63", "Configure news feeds");
-define("ADLAN_64", "Log Stats");
-define("ADLAN_65", "Log stats/counter etc");
+//define("ADLAN_62", "News Feeds");
+//define("ADLAN_63", "Configure news feeds");
+//define("ADLAN_64", "Log Stats");
+//define("ADLAN_65", "Log stats/counter etc");
 define("ADLAN_66", "Meta Tags");
 define("ADLAN_67", "Add/Edit site meta tags");
 define("ADLAN_68", "PHP Info");
 define("ADLAN_69", "PHP Info page");
-define("ADLAN_70", "Polls");
-define("ADLAN_71", "Add/Edit Polls");
+//define("ADLAN_70", "Polls");
+//define("ADLAN_71", "Add/Edit Polls");
 define("ADLAN_72", "Public Uploads");
 define("ADLAN_73", "Configure public file uploads");
 define("ADLAN_74", "Cache");
 define("ADLAN_75", "Set cache status");
-define("ADLAN_77", "You have had a news item submitted - please click here to check.");
+//define("ADLAN_77", "You have had a news item submitted - please click here to check.");
 define("ADLAN_78", "Extended User Fields");
 define("ADLAN_79", "Edit extended user fields");
 
 
-define("ADLAN_86", "Incorrect password ");
-define("ADLAN_87", "Administrator name not found in database ");
-define("ADLAN_88", "Unable to login ");
+//define("ADLAN_86", "Incorrect password ");
+//define("ADLAN_87", "Administrator name not found in database ");
+//define("ADLAN_88", "Unable to login ");
 define("ADLAN_89", "Admin Name ");
 define("ADLAN_90", "Admin Password ");
 define("ADLAN_91", "Log In");
 define("ADLAN_92", "Please log in to proceed to administration area ...");
 define("ADLAN_93", "Show Admin Functions");
-define("ADLAN_94", "Show Installed Plugins");
+//define("ADLAN_94", "Show Installed Plugins");
 define("ADLAN_95", "Plugin Management");
-define("ADLAN_96", "None");
-define("ADLAN_97", "Click here for FAQ");
+//define("ADLAN_96", "None");
+//define("ADLAN_97", "Click here for FAQ");
 define("ADLAN_98", "Plugin Manager");
 define("ADLAN_99", "Install/upgrade etc. plugins");
-define("ADLAN_100", "Theme Layout");
-define("ADLAN_101", "Template Creator");
+//define("ADLAN_100", "Theme Layout");
+//define("ADLAN_101", "Template Creator");
 define("ADLAN_102", "It has been more than 30 days since you changed the main administrator password - ");
 define("ADLAN_103", "Click here to change it now");
 define("ADLAN_104", "Security");
@@ -111,9 +111,9 @@
 define("ADLAN_105", "Images");
 define("ADLAN_106", "Image Settings");
 
-define("ADLAN_107", "Unchecked submitted news items");
-define("ADLAN_108", "Unchecked file uploads");
-define("ADLAN_109", "Information");
+//define("ADLAN_107", "Unchecked submitted news items");
+//define("ADLAN_108", "Unchecked file uploads");
+//define("ADLAN_109", "Information");
 define("ADLAN_110", "Registered members");
 define("ADLAN_111", "Unverified members");
 define("ADLAN_112", "Banned users");
@@ -130,17 +130,17 @@
 define("ADLAN_121", "Install");
 
 
-define("ADLAN_123", "Unchecked submitted articles");
-define("ADLAN_124", "Unchecked submitted reviews");
+//define("ADLAN_123", "Unchecked submitted articles");
+//define("ADLAN_124", "Unchecked submitted reviews");
 
-define("ADLAN_125", "Unchecked reported forum posts");
+//define("ADLAN_125", "Unchecked reported forum posts");
 
-define("ADLAN_126", "Main Options");
-define("ADLAN_127", "Users");
-define("ADLAN_128", "Content");
-define("ADLAN_129", "Communication");
-define("ADLAN_130", "Files Management");
-define("ADLAN_131", "Other tools");
+//define("ADLAN_126", "Main Options");
+//define("ADLAN_127", "Users");
+//define("ADLAN_128", "Content");
+//define("ADLAN_129", "Communication");
+//define("ADLAN_130", "Files Management");
+//define("ADLAN_131", "Other tools");
 
 define("ADLAN_132", "Language");
 define("ADLAN_133", "default");
@@ -187,8 +187,8 @@
 define("ADLAN_LAT_1", "Latest");
 
 define("ADLAN_LAT_2", "Submitted news items");
-define("ADLAN_LAT_3", "Submitted articles");
-define("ADLAN_LAT_4", "Submitted reviews");
+//define("ADLAN_LAT_3", "Submitted articles");
+//define("ADLAN_LAT_4", "Submitted reviews");
 define("ADLAN_LAT_5", "Submitted links");
 define("ADLAN_LAT_6", "Reported forum posts");
 define("ADLAN_LAT_7", "File uploads");
diff -x .svn -aruN 0.7.11.src/e107_languages/English/admin/lan_cpage.php 0.7.12.src/e107_languages/English/admin/lan_cpage.php
--- 0.7.11.src/e107_languages/English/admin/lan_cpage.php	2005-06-22 12:08:01.000000000 -0500
+++ 0.7.12.src/e107_languages/English/admin/lan_cpage.php	2008-07-09 15:08:02.000000000 -0500
@@ -4,9 +4,9 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_cpage.php,v $
-|     $Revision: 1.4 $
-|     $Date: 2005/06/22 17:08:01 $
-|     $Author: stevedunstan $
+|     $Revision: 1.5 $
+|     $Date: 2008/07/09 20:08:02 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 define("CUSLAN_1", "Title");
@@ -51,5 +51,7 @@
 
 define("CUSLAN_41", "Display author and date information");
 define("CUSLAN_42", "No pages defined yet");
+define('CUSLAN_43', 'untitled menu: ');
+define('CUSLAN_44', 'untitled page');
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_languages/English/admin/lan_mailout.php 0.7.12.src/e107_languages/English/admin/lan_mailout.php
--- 0.7.11.src/e107_languages/English/admin/lan_mailout.php	2006-08-10 11:11:50.000000000 -0500
+++ 0.7.12.src/e107_languages/English/admin/lan_mailout.php	2008-07-28 16:33:27.000000000 -0500
@@ -4,14 +4,14 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_mailout.php,v $
-|     $Revision: 1.14 $
-|     $Date: 2006/08/10 16:11:50 $
-|     $Author: e107coders $
+|     $Revision: 1.16 $
+|     $Date: 2008/07/28 21:33:27 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 define("PRFLAN_52", "Save Changes");
 define("PRFLAN_63", "Send test email");
-define("PRFLAN_64", "Clicking button will send test email to main admin email address");
+//define("PRFLAN_64", "Clicking button will send test email to main admin email address");
 define("PRFLAN_65", "Click to send email to");
 define("PRFLAN_66", "Test email from");
 define("PRFLAN_67", "This is a test email, it appears that your email settings are working ok!\n\nRegards\nfrom the e107 website system.");
@@ -94,6 +94,7 @@
 define("MAILAN_65", "seconds");
 define("MAILAN_66", "Cancelled Successfully");
 define("MAILAN_67", "Use 'POP before SMTP' authentication"); 
+define('MAILAN_68', 'Test address');
 
 
 
diff -x .svn -aruN 0.7.11.src/e107_languages/English/admin/lan_userclass.php 0.7.12.src/e107_languages/English/admin/lan_userclass.php
--- 0.7.11.src/e107_languages/English/admin/lan_userclass.php	2004-10-03 10:57:25.000000000 -0500
+++ 0.7.12.src/e107_languages/English/admin/lan_userclass.php	2008-04-04 16:03:58.000000000 -0500
@@ -4,9 +4,9 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_userclass.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2004/10/03 15:57:25 $
-|     $Author: mcfly_e107 $
+|     $Revision: 1.3 $
+|     $Date: 2008/04/04 21:03:58 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -20,5 +20,6 @@
 define("UCSLAN_8", "Notify User");
 define("UCSLAN_9", "Classes Updated.");
 define("UCSLAN_10", "Regards,");
+define('UCSLAN_12', 'Member privileges only');
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_languages/English/admin/lan_users.php 0.7.12.src/e107_languages/English/admin/lan_users.php
--- 0.7.11.src/e107_languages/English/admin/lan_users.php	2007-09-28 15:50:23.000000000 -0500
+++ 0.7.12.src/e107_languages/English/admin/lan_users.php	2008-07-03 16:23:24.000000000 -0500
@@ -4,8 +4,8 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_users.php,v $
-|     $Revision: 1.32 $
-|     $Date: 2007/09/28 20:50:23 $
+|     $Revision: 1.33 $
+|     $Date: 2008/07/03 21:23:24 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -168,7 +168,7 @@
 define("DUSRLAN_3", "Username");
 define("DUSRLAN_4", "Custom Title");
 define("DUSRLAN_5", "Password");
-define("DUSRLAN_6", "Session");
+define("DUSRLAN_6", "Photo");
 define("DUSRLAN_7", "Email");
 define("DUSRLAN_8", "Website");
 define("DUSRLAN_9", "ICQ");
@@ -177,7 +177,7 @@
 define("DUSRLAN_12", "Location");
 define("DUSRLAN_13", "Birthday");
 define("DUSRLAN_14", "Signature");
-define("DUSRLAN_15", "Image");
+define("DUSRLAN_15", "Avatar");
 define("DUSRLAN_16", "Timezone");
 define("DUSRLAN_17", "Hide Email");
 define("DUSRLAN_18", "Join Date");
@@ -197,7 +197,7 @@
 define("DUSRLAN_32", "Real Name");
 define("DUSRLAN_33", "User Class");
 define("DUSRLAN_34", "Perms");
-define("DUSRLAN_35", "Picture");
+define("DUSRLAN_35", "Tracked threads");
 define("DUSRLAN_36", "Password Change");
 define("DUSRLAN_37", "XUP");
 
diff -x .svn -aruN 0.7.11.src/e107_languages/English/admin/lan_users_extended.php 0.7.12.src/e107_languages/English/admin/lan_users_extended.php
--- 0.7.11.src/e107_languages/English/admin/lan_users_extended.php	2007-04-14 12:24:13.000000000 -0500
+++ 0.7.12.src/e107_languages/English/admin/lan_users_extended.php	2008-06-29 05:00:24.000000000 -0500
@@ -4,8 +4,8 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_users_extended.php,v $
-|     $Revision: 1.20 $
-|     $Date: 2007/04/14 17:24:13 $
+|     $Revision: 1.21 $
+|     $Date: 2008/06/29 10:00:24 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -60,7 +60,7 @@
 define("EXTLAN_48", "Add new value");
 define("EXTLAN_49", "Allow user to hide");
 define("EXTLAN_50", "Setting this to yes will allow the user to hide this value from non-admins");
-define("EXTLAN_51", "Any valid w3c parameter may be entered here<br />ie <i><b>class='tbox' size='40' maxlength='80'</i></b>");
+define("EXTLAN_51", "Any valid w3c parameter may be entered here<br />e.g. <b><i>class='tbox' size='40' maxlength='80'</i></b>");
 define("EXTLAN_52", "regex validation code");
 define("EXTLAN_53", "Enter the regex code that will need to be matched to make it a valid entry <br />**regex delimiters are required**");
 define("EXTLAN_54", "regex failure text");
diff -x .svn -aruN 0.7.11.src/e107_languages/English/lan_comment.php 0.7.12.src/e107_languages/English/lan_comment.php
--- 0.7.11.src/e107_languages/English/lan_comment.php	2007-12-25 06:42:57.000000000 -0600
+++ 0.7.12.src/e107_languages/English/lan_comment.php	2008-05-25 03:25:33.000000000 -0500
@@ -4,8 +4,8 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_comment.php,v $
-|     $Revision: 1.13 $
-|     $Date: 2007/12/25 12:42:57 $
+|     $Revision: 1.14 $
+|     $Date: 2008/05/25 08:25:33 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -30,6 +30,7 @@
 define("COMLAN_103", "Article");
 define("COMLAN_104", "Review");
 define("COMLAN_105", "Content");
+define("COMLAN_106", "Download");
 define("COMLAN_145", "Registered: ");
 define("COMLAN_194", "Guest");
 define("COMLAN_195", "Registered member");
diff -x .svn -aruN 0.7.11.src/e107_languages/English/lan_download.php 0.7.12.src/e107_languages/English/lan_download.php
--- 0.7.11.src/e107_languages/English/lan_download.php	2007-02-03 08:21:19.000000000 -0600
+++ 0.7.12.src/e107_languages/English/lan_download.php	2008-07-04 15:23:11.000000000 -0500
@@ -4,8 +4,8 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_download.php,v $
-|     $Revision: 1.16 $
-|     $Date: 2007/02/03 14:21:19 $
+|     $Revision: 1.17 $
+|     $Date: 2008/07/04 20:23:11 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -96,6 +96,8 @@
 
 define("LAN_dl_75", "no image available ");
 define("LAN_dl_76", "Go to page");
-define("LAN_dl_77", "Downloads");		// Intentional duplicate - some languages need it to be different. This is for number of townloads
+define("LAN_dl_77", "Downloads");		// Intentional duplicate - some languages need it to be different. This is for number of downloads
+
+define('LAN_dl_78', 'That download has been disabled or discontinued. Please check in the --LINK--downloads</a> area for a more recent version.'); 
 
 ?>
diff -x .svn -aruN 0.7.11.src/e107_languages/English/lan_error.php 0.7.12.src/e107_languages/English/lan_error.php
--- 0.7.11.src/e107_languages/English/lan_error.php	2006-10-31 15:16:29.000000000 -0600
+++ 0.7.12.src/e107_languages/English/lan_error.php	2008-07-25 15:12:44.000000000 -0500
@@ -4,9 +4,9 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_error.php,v $
-|     $Revision: 1.7 $
-|     $Date: 2006/10/31 21:16:29 $
-|     $Author: e107coders $
+|     $Revision: 1.8 $
+|     $Date: 2008/07/25 20:12:44 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 define("PAGE_NAME", "Error");
@@ -39,11 +39,20 @@
 define("LAN_ERROR_25", "[1]: Unable to read core settings from database - Core settings exist but cannot be unserialized. Attempting to restore core backup ...");
 define("LAN_ERROR_26", "[2]: Unable to read core settings from database - non-existent core settings.");
 define("LAN_ERROR_27", "[3]: Core settings saved - backup made active.");
-define("LAN_ERROR_28", "[4]: No core backup found. Please run the <a href='".e_FILE."resetcore/resetcore.php'>Reset_Core</a> utility to rebuild your core settings. <br />After rebuilding your core please save a backup from the admin/sql screen.");
+define("LAN_ERROR_28", "[4]: No core backup found. Check that your database has valid content. If not, please run the <a href='".e_FILE."resetcore/resetcore.php'>Reset_Core</a> utility to rebuild your core settings. <br />After rebuilding your core please save a backup from the admin/sql screen.");
 define("LAN_ERROR_29", "[5]: Field(s) have been left blank. Please resubmit the form and fill in the required fields.");
 define("LAN_ERROR_30", "[6]: Unable to form a valid connection to mySQL. Please check that your e107_config.php contains the correct information.");
 define("LAN_ERROR_31", "[7]: mySQL is running but database ({$mySQLdefaultdb}) couldn't be connected to.<br />Please check it exists and that your e107_config.php contains the correct information.");
 define("LAN_ERROR_32", "To complete the upgrade, copy the following text into your e107_config.php file:");
 
+define("LAN_ERROR_33", "Processing error! Normally, I would redirect to the home page.");
+define("LAN_ERROR_34", "Unknown error! Please inform the site administrator you saw this:");
+
+define('LAN_ERROR_35', 'Error 400 - Bad Request');
+define('LAN_ERROR_36', 'There is a formatting error in the web page you are trying to access.');
+define('LAN_ERROR_37', 'Error Icon');
+define('LAN_ERROR_38', '');
+define('LAN_ERROR_39', '');
+
 
 ?>
diff -x .svn -aruN 0.7.11.src/e107_languages/English/lan_installer.php 0.7.12.src/e107_languages/English/lan_installer.php
--- 0.7.11.src/e107_languages/English/lan_installer.php	2007-04-12 17:58:23.000000000 -0500
+++ 0.7.12.src/e107_languages/English/lan_installer.php	2008-07-09 16:38:14.000000000 -0500
@@ -82,10 +82,12 @@
 [b]Support[/b]
 e107 Homepage: [link=http://e107.org]http://e107.org[/link], you will find the FAQ and documentation here.
 Forums: [link=http://e107.org/e107_plugins/forum/forum.php]http://e107.org/e107_plugins/forum/forum.php[/link]
+Plugin Developer Community: [link=http://www.e107coders.org]http://e107coders.org[/link]
 
 [b]Downloads[/b]
-Plugins: [link=http://e107coders.org]http://e107coders.org[/link]
-Themes: [link=http://e107themes.org]http://e107themes.org[/link]
+Plugins: [link=http://plugins.e107.org]http://plugins.e107.org[/link]
+Themes: [link=http://themes.e107.org]http://themes.e107.org[/link]
+
 
 Thank you for trying e107, we hope it fulfils your website needs.
 (You can delete this message from your admin section.)");
@@ -143,6 +145,10 @@
 define("LANINS_103", 'Reviews');
 define("LANINS_104", 'Review Front Page ...');
 
-define("LANINS_105", '');
-define("LANINS_106", '');
+define("LANINS_105", 'A database name or prefix beginning with some digits followed by \'e\' or \'E\' is not acceptable');
+define("LANINS_106", 'WARNING - E107 cannot write to the directories and/or files listed. While this will not stop E107 installing, it will mean that certain features are not available. 
+				You will need to change the file permissions to use these features');
+define("LANINS_107", '');
+define("LANINS_108", '');
+
 ?>
diff -x .svn -aruN 0.7.11.src/e107_languages/English/lan_links.php 0.7.12.src/e107_languages/English/lan_links.php
--- 0.7.11.src/e107_languages/English/lan_links.php	2006-07-04 11:33:32.000000000 -0500
+++ 0.7.12.src/e107_languages/English/lan_links.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,50 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_links.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2006/07/04 16:33:32 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Links");
-
-define("LAN_61", "Link Categories");
-define("LAN_62", "categories");
-define("LAN_63", "category");
-define("LAN_64", "in this category");
-define("LAN_65", "link");
-define("LAN_66", "links");
-define("LAN_67", "Show All Links");
-define("LAN_68", "edit");
-define("LAN_69", "delete");
-define("LAN_86", "Category:");
-define("LAN_88", "Referrals:");
-define("LAN_89", "Admin: ");
-define("LAN_90", "add new link in this category");
-define("LAN_91", "add new category");
-
-define("LAN_92", "Submit a link");
-define("LAN_93", "After submitting your link it will be reviewed by a site admin and if appropriate it will be added to the main links page.");
-define("LAN_94", "Link Name:");
-define("LAN_95", "Link URL:");
-define("LAN_96", "Link Description:");
-define("LAN_97", "URL to link button:");
-define("LAN_98", "Submit Link");
-
-define("LAN_99", "Thank you");
-define("LAN_100", "Your link has been saved and will be reviewed by a site administrator.");
-define("LAN_101", "Please click here to submit a link");
-
-define("LAN_102", "There");
-define("LAN_103", "is");
-define("LAN_104", "are");
-define("LAN_105", "total in");
-define("LAN_106", "Underlined fields are required.");
-
-define("LAN_Links_1", "Total links");
-define("LAN_Links_2", "Total links activated");
-define("LAN_LINKS_3", "Anonymous");
-?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_languages/English/lan_newspost.php 0.7.12.src/e107_languages/English/lan_newspost.php
--- 0.7.11.src/e107_languages/English/lan_newspost.php	2006-01-14 19:08:03.000000000 -0600
+++ 0.7.12.src/e107_languages/English/lan_newspost.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,44 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_newspost.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2006/01/15 01:08:03 $
-|     $Author: streaky $
-+----------------------------------------------------------------------------+
-*/
-define("NWSLAN_1", "News story deleted.");
-define("NWSLAN_2", "Please tick the confirm box to delete this news item.");
-define("NWSLAN_3", "No news items yet.");
-define("NWSLAN_4", "Existing News");
-define("NWSLAN_5", "Open HTML Editor");
-define("NWSLAN_6", "Category");
-define("NWSLAN_7", "Edit");
-define("NWSLAN_8", "Delete");
-define("NWSLAN_9", "tick to confirm");
-define("NWSLAN_10", "No categories set yet.");
-define("NWSLAN_11", "Add/Edit Categories");
-define("NWSLAN_12", "Title");
-define("NWSLAN_13", "Body");
-define("NWSLAN_14", "Extended");
-define("NWSLAN_15", "Comments");
-define("NWSLAN_16", "Enabled");
-define("NWSLAN_17", "Disabled");
-define("NWSLAN_18", "Allow comments to be posted to this news item");
-define("NWSLAN_19", "Activation");
-define("NWSLAN_20", "Leave blank to disable auto-activation");
-define("NWSLAN_21", "Activate between");
-define("NWSLAN_22", "Visibility");
-define("NWSLAN_23", "Ticking will make the news item visible only to users in that class");
-define("NWSLAN_24", "Preview again");
-define("NWSLAN_25", "Update news in database");
-define("NWSLAN_26", "Post news to database");
-define("NWSLAN_27", "Preview");
-define("NWSLAN_28", "New story");
-define("NWSLAN_29", "News Post");
-
-define("NWSLAN_30", "Show title only");
-
-?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_languages/English/lan_signup.php 0.7.12.src/e107_languages/English/lan_signup.php
--- 0.7.11.src/e107_languages/English/lan_signup.php	2007-11-11 15:52:44.000000000 -0600
+++ 0.7.12.src/e107_languages/English/lan_signup.php	2008-07-30 14:46:23.000000000 -0500
@@ -4,8 +4,8 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_signup.php,v $
-|     $Revision: 1.29 $
-|     $Date: 2007/11/11 21:52:44 $
+|     $Revision: 1.30 $
+|     $Date: 2008/07/30 19:46:23 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -78,7 +78,7 @@
 define("LAN_SIGNUP_27", "Show");
 define("LAN_SIGNUP_28", "choice of Content/Mail-lists");
 define("LAN_SIGNUP_29", "A verification email will be sent to the email address you enter here so it must be valid.");
-define("LAN_SIGNUP_30", "If you do not wish to display your email address on this site, please tick the 'hide email address' box.");
+define("LAN_SIGNUP_30", "If you do not wish to display your email address on this site, please select 'Yes' for the 'Hide email address?' option.");
 
 define("LAN_SIGNUP_31", "URL to your XUP file");
 define("LAN_SIGNUP_32", "What's an XUP file?");
diff -x .svn -aruN 0.7.11.src/e107_plugins/banner_menu/banner_menu.php 0.7.12.src/e107_plugins/banner_menu/banner_menu.php
--- 0.7.11.src/e107_plugins/banner_menu/banner_menu.php	2006-06-14 17:12:07.000000000 -0500
+++ 0.7.12.src/e107_plugins/banner_menu/banner_menu.php	2008-08-03 03:08:36.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/banner_menu/banner_menu.php,v $
-|     $Revision: 1.12 $
-|     $Date: 2006/06/14 22:12:07 $
-|     $Author: lisa_ $
+|     $Revision: 1.13 $
+|     $Date: 2008/08/03 08:08:36 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -32,58 +32,64 @@
 
 
 global $THEMES_DIRECTORY;
-if (file_exists(THEME."banner_template.php")) {
-	require_once(THEME."banner_template.php");
-} else {
-	require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
+if (file_exists(THEME."banner_template.php")) 
+{
+  require_once(THEME."banner_template.php");
+} 
+else 
+{
+  require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
 }
 
-if(isset($campaign)){
-	$parm = (isset($campaign) ? $campaign : "");
-	$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
-	$BANNER = eval($bannersccode);
-	$txt = $BANNER_MENU_START;
-	$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
-	$txt .= $BANNER_MENU_END;
+if(isset($campaign))
+{
+  $parm = $campaign;
+  $bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
+  $BANNER = eval($bannersccode);
+  $txt = $BANNER_MENU_START;
+  $txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
+  $txt .= $BANNER_MENU_END;
 	
-}else{
-	if (isset($menu_pref['banner_campaign']) && $menu_pref['banner_campaign'])
+}
+else
+{
+  if (isset($menu_pref['banner_campaign']) && $menu_pref['banner_campaign'])
+  {
+	if(strstr($menu_pref['banner_campaign'], "|"))
 	{
-		if(strstr($menu_pref['banner_campaign'], "|"))
-		{
-			$campaignlist = explode("|", $menu_pref['banner_campaign']);
-			$amount = ($menu_pref['banner_amount']<1 ? '1' : $menu_pref['banner_amount']);
-			$amount = ($amount > count($campaignlist) ? count($campaignlist) : $amount);
-			$keys = array_rand($campaignlist, $amount);
-			$parms = array();
-			foreach($keys as $k=>$v){
-				$parms[] = $campaignlist[$v];
-			}
-		}
-		else
-		{
-			$parms[] = $menu_pref['banner_campaign'];
-		}
+	  $campaignlist = explode("|", $menu_pref['banner_campaign']);
+	  $amount = ($menu_pref['banner_amount']<1 ? '1' : $menu_pref['banner_amount']);
+	  $amount = ($amount > count($campaignlist) ? count($campaignlist) : $amount);
+	  $keys = array_rand($campaignlist, $amount);
+	  $parms = array();
+	  foreach($keys as $k=>$v)
+	  {
+		$parms[] = $campaignlist[$v];
+	  }
 	}
-
-	$txt = $BANNER_MENU_START;
-	foreach($parms as $parm){
-		$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
-		$BANNER = eval($bannersccode);
-		$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
+	else
+	{
+	  $parms[] = $menu_pref['banner_campaign'];
 	}
-	$txt .= $BANNER_MENU_END;
-}
+  }
 
-$text = $txt;
+  $txt = $BANNER_MENU_START;
+  foreach($parms as $parm)
+  {
+	$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
+	$BANNER = eval($bannersccode);
+	$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
+  }
+  $txt .= $BANNER_MENU_END;
+}
 
 if (isset($menu_pref['banner_rendertype']) && $menu_pref['banner_rendertype'] == 2)
 {
-	$ns->tablerender($menu_pref['banner_caption'], $text);
+  $ns->tablerender($menu_pref['banner_caption'], $txt);
 }
 else
 {
-	echo $text;
+  echo $txt;
 }
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_plugins/calendar_menu/calendar_shortcodes.php 0.7.12.src/e107_plugins/calendar_menu/calendar_shortcodes.php
--- 0.7.11.src/e107_plugins/calendar_menu/calendar_shortcodes.php	2007-09-03 16:06:02.000000000 -0500
+++ 0.7.12.src/e107_plugins/calendar_menu/calendar_shortcodes.php	2008-07-28 15:15:56.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/calendar_shortcodes.php,v $
-|     $Revision: 1.14 $
-|     $Date: 2007/09/03 21:06:02 $
+|     $Revision: 1.15 $
+|     $Date: 2008/07/28 20:15:56 $
 |     $Author: e107steved $
 |
 | 10.11.06 - mods for next CVS release
@@ -132,13 +132,16 @@
 // CALENDAR SHOWEVENT ------------------------------------------------------------
 SC_BEGIN SHOWEVENT_IMAGE
 	global $SHOWEVENT_IMAGE, $ev;
-	if($ev['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon'])){
-		$img = "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon']."' alt='' height='".$ev['imagesize']."' width='".$ev['imagesize']."' />";
-	}else{
-		$img = "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' style='border:0; vertical-align:middle;' />";
+	if($ev['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon']))
+	{
+	  $img = "<img style='border:0' src='".e_PLUGIN_ABS."calendar_menu/images/".$ev['event_cat_icon']."' alt='' height='".$ev['imagesize']."' width='".$ev['imagesize']."' />";
+	}
+	else
+	{
+	  $img = "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' style='border:0; vertical-align:middle;' />";
 	}
 	return $img;
-	//return "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon']."' alt='' height='".$ev['imagesize']."' width='".$ev['imagesize']."' />";
+	//return "<img style='border:0' src='".e_PLUGIN_ABS."calendar_menu/images/".$ev['event_cat_icon']."' alt='' height='".$ev['imagesize']."' width='".$ev['imagesize']."' />";
 SC_END
 
 SC_BEGIN SHOWEVENT_INDICAT
@@ -177,11 +180,10 @@
 SC_BEGIN CALENDAR_CALENDAR_RECENT_ICON
   global $ev;
   if (!isset($ev['is_recent'])) return "";
-//  $recent_icon = e_PLUGIN."calendar_menu/images/recent_icon.png";
-  $recent_icon = e_IMAGE."generic/".IMODE."/new.png";
-  if (file_exists($recent_icon))
+//  $recent_icon = e_IMAGE_ABS."generic/".IMODE."/new.png";
+  if (file_exists(e_IMAGE."generic/".IMODE."/new.png"))
 	{
-	  return "<img style='border:0' src='".$recent_icon."' alt='' /> ";
+	  return "<img style='border:0' src='".e_IMAGE_ABS."generic/".IMODE."/new.png"."' alt='' /> ";
 	}
   return "R";
 SC_END
@@ -287,11 +289,10 @@
   global $thisevent, $ecal_class;
   if (($ecal_class->max_recent_show == 0) || (time() - $thisevent['event_datestamp']) > $ecal_class->max_recent_show) return "";
 // Can use the generic icon, or a calendar-specific one  
-  $recent_icon = e_IMAGE."generic/".IMODE."/new.png";
-//  $recent_icon = e_PLUGIN."calendar_menu/images/recent_icon.png";
-  if (file_exists($recent_icon))
+//  $recent_icon = e_IMAGE."generic/".IMODE."/new.png";
+  if (file_exists(e_IMAGE."generic/".IMODE."/new.png"))
 	{
-	  return "<img style='border:0' src='".$recent_icon."' alt='' /> ";
+	  return "<img style='border:0' src='".e_IMAGE_ABS."generic/".IMODE."/new.png"."' alt='' /> ";
 	}
   return "";
 SC_END
@@ -338,7 +339,7 @@
   global $thisevent;
   if ($thisevent['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon']))
 	{
-	  return "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon']."' alt='' /> ";
+	  return "<img style='border:0' src='".e_PLUGIN_ABS."calendar_menu/images/".$thisevent['event_cat_icon']."' alt='' /> ";
 	}
 	else
 	{
@@ -405,13 +406,13 @@
 
 SC_BEGIN EVENT_THREAD
   global $EVENT_THREAD, $thisevent;
-  return (isset($thisevent['event_thread']) && ($thisevent['event_thread'] != "")) ? "<a href='{$thisevent['event_thread']}'><img src='".e_PLUGIN."forum/images/".IMODE."/e.png' alt='' style='border:0; vertical-align:middle;' width='16' height='16' /></a> <a href='{$thisevent['event_thread']}'>".EC_LAN_39."</a>" : "";
+  return (isset($thisevent['event_thread']) && ($thisevent['event_thread'] != "")) ? "<a href='{$thisevent['event_thread']}'><img src='".e_PLUGIN_ABS."forum/images/".IMODE."/e.png' alt='' style='border:0; vertical-align:middle;' width='16' height='16' /></a> <a href='{$thisevent['event_thread']}'>".EC_LAN_39."</a>" : "";
 SC_END
 
 SC_BEGIN EVENT_OPTIONS
 	global $EVENT_OPTIONS, $thisevent, $event_author_name, $cal_super;
 	if (USERNAME == $event_author_name || $cal_super){
-		$EVENT_OPTIONS = "<a href='event.php?ed.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE."admin_images/edit_16.png' title='".EC_LAN_35."' alt='".EC_LAN_35 . "'/></a>&nbsp;&nbsp;<a href='".e_PLUGIN."calendar_menu/event.php?de.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE."admin_images/delete_16.png' title='".EC_LAN_36."' alt='".EC_LAN_36."'/></a>";
+		$EVENT_OPTIONS = "<a href='event.php?ed.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE_ABS."admin_images/edit_16.png' title='".EC_LAN_35."' alt='".EC_LAN_35 . "'/></a>&nbsp;&nbsp;<a href='".e_PLUGIN."calendar_menu/event.php?de.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE_ABS."admin_images/delete_16.png' title='".EC_LAN_36."' alt='".EC_LAN_36."'/></a>";
 	}
 	return $EVENT_OPTIONS;
 SC_END
diff -x .svn -aruN 0.7.11.src/e107_plugins/chatbox_menu/chatbox_menu.php 0.7.12.src/e107_plugins/chatbox_menu/chatbox_menu.php
--- 0.7.11.src/e107_plugins/chatbox_menu/chatbox_menu.php	2007-04-25 14:35:10.000000000 -0500
+++ 0.7.12.src/e107_plugins/chatbox_menu/chatbox_menu.php	2008-06-26 14:40:37.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/chatbox_menu.php,v $
-|     $Revision: 1.78 $
-|     $Date: 2007/04/25 19:35:10 $
+|     $Revision: 1.79 $
+|     $Date: 2008/06/26 19:40:37 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -195,7 +195,6 @@
 			}
 
 			$datestamp = $obj2->convert_date($cb['cb_datestamp'], "short");
-			if(!$pref['cb_wordwrap']) { $pref['cb_wordwrap'] = 30; }
 			$emotes_active = $pref['cb_emote'] ? 'USER_BODY, emotes_on' : 'USER_BODY, emotes_off';
 
 			$cb_message = $tp -> toHTML($cb['cb_message'], FALSE, $emotes_active, $cb_uid, $pref['menu_wordwrap']);
@@ -212,16 +211,9 @@
 				$CHATBOXSTYLE = "<!-- chatbox -->\n<div class='spacer'>
 				$bullet <b>{USERNAME}</b><br /><span class='smalltext'>{TIMEDATE}</span><br /><div class='smallblacktext'>{MESSAGE}</div></div><br />\n";
 			}
-
-			$search[0] = "/\{USERNAME\}(.*?)/si";
-			$replace[0] = $cb_nick;
-			$search[1] = "/\{TIMEDATE\}(.*?)/si";
-			$replace[1] = $datestamp;
-			$search[2] = "/\{MESSAGE\}(.*?)/si";
-			$replace[2] = ($cb['cb_blocked'] ? CHATBOX_L6 : $cb_message);
-
-			$text .= preg_replace($search, $replace, $CHATBOXSTYLE);
-
+			$search = array('{USERNAME}', '{TIMEDATE}', '{MESSAGE}');
+			$replace = array($cb_nick,$datestamp,($cb['cb_blocked'] ? CHATBOX_L6 : $cb_message));
+			$text .= str_replace($search,$replace,$CHATBOXSTYLE);
 		}
 	}
 	else
diff -x .svn -aruN 0.7.11.src/e107_plugins/compliance_menu/compliance_menu.php 0.7.12.src/e107_plugins/compliance_menu/compliance_menu.php
--- 0.7.11.src/e107_plugins/compliance_menu/compliance_menu.php	2007-05-31 16:16:59.000000000 -0500
+++ 0.7.12.src/e107_plugins/compliance_menu/compliance_menu.php	2008-07-28 15:15:56.000000000 -0500
@@ -3,8 +3,8 @@
 if (!defined('e107_INIT')) { exit; }
 
 $text = "<div style='text-align:center'>
-	<a href='http://validator.w3.org/check?uri=".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."'><img style='border:0' src='".e_PLUGIN."compliance_menu/images/valid-xhtml11.png' alt='Valid XHTML 1.1!' height='31' width='88' /></a><br />
-	<a href='http://jigsaw.w3.org/css-validator/validator?uri=".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."'><img style='border:0' src='".e_PLUGIN."compliance_menu/images/vcss.png' alt='Valid CSS!' height='31' width='88' /></a>
+	<a href='http://validator.w3.org/check?uri=".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."'><img style='border:0' src='".e_PLUGIN_ABS."compliance_menu/images/valid-xhtml11.png' alt='Valid XHTML 1.1!' height='31' width='88' /></a><br />
+	<a href='http://jigsaw.w3.org/css-validator/validator?uri=".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."'><img style='border:0' src='".e_PLUGIN_ABS."compliance_menu/images/vcss.png' alt='Valid CSS!' height='31' width='88' /></a>
 	</div>";
 $caption = (file_exists(THEME."images/compliance_menu.png") ? "<img src='".THEME_ABS."images/compliance_menu.png' alt='' /> ".COMPLIANCE_L1 : COMPLIANCE_L1);
 $ns->tablerender($caption, $text, 'compliance');
diff -x .svn -aruN 0.7.11.src/e107_plugins/content/content.php 0.7.12.src/e107_plugins/content/content.php
--- 0.7.11.src/e107_plugins/content/content.php	2007-01-19 23:19:21.000000000 -0600
+++ 0.7.12.src/e107_plugins/content/content.php	2008-06-27 16:22:19.000000000 -0500
@@ -12,9 +12,9 @@
 |        GNU General Public License (http://gnu.org).
 |
 |		$Source: /cvsroot/e107/e107_0.7/e107_plugins/content/content.php,v $
-|		$Revision: 1.113 $
-|		$Date: 2007/01/20 05:19:21 $
-|		$Author: mrpete $
+|		$Revision: 1.114 $
+|		$Date: 2008/06/27 21:22:19 $
+|		$Author: e107steved $
 +---------------------------------------------------------------+
 */
 
@@ -341,7 +341,7 @@
 				}
 			}
 
-			if(USERID){
+			if(USER){
 				$personalmanagercheck = FALSE;
 				$array = $aa -> getCategoryTree("", "", TRUE);
 				$catarray = array_keys($array);
diff -x .svn -aruN 0.7.11.src/e107_plugins/content/content_manager.php 0.7.12.src/e107_plugins/content/content_manager.php
--- 0.7.11.src/e107_plugins/content/content_manager.php	2006-12-07 06:57:01.000000000 -0600
+++ 0.7.12.src/e107_plugins/content/content_manager.php	2008-06-27 16:22:19.000000000 -0500
@@ -12,9 +12,9 @@
 |        GNU General Public License (http://gnu.org).
 |
 |		$Source: /cvsroot/e107/e107_0.7/e107_plugins/content/content_manager.php,v $
-|		$Revision: 1.24 $
-|		$Date: 2006/12/07 12:57:01 $
-|		$Author: mrpete $
+|		$Revision: 1.25 $
+|		$Date: 2008/06/27 21:22:19 $
+|		$Author: e107steved $
 +---------------------------------------------------------------+
 */
 
@@ -102,7 +102,7 @@
 }
 
 if(!e_QUERY){
-	if(USERID){
+	if(USER){
 		$aform -> show_contentmanager("edit", USERID, USERNAME);
 		require_once(FOOTERF);
 		exit;
diff -x .svn -aruN 0.7.11.src/e107_plugins/content/e_latest.php 0.7.12.src/e107_plugins/content/e_latest.php
--- 0.7.11.src/e107_plugins/content/e_latest.php	2006-06-11 11:20:25.000000000 -0500
+++ 0.7.12.src/e107_plugins/content/e_latest.php	2008-07-23 15:33:08.000000000 -0500
@@ -1,9 +1,7 @@
 <?php
 if (!defined('e107_INIT')) { exit; }
 
-$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content_admin.php';
-include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content_admin.php');
-
+include_lan(e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content_admin.php');
 $plugintable = "pcontent";
 $reported_content = $sql -> db_Count($plugintable, '(*)', "WHERE content_refer='sa' ");
 $text .= "
diff -x .svn -aruN 0.7.11.src/e107_plugins/content/e_status.php 0.7.12.src/e107_plugins/content/e_status.php
--- 0.7.11.src/e107_plugins/content/e_status.php	2007-03-01 03:49:09.000000000 -0600
+++ 0.7.12.src/e107_plugins/content/e_status.php	2008-07-23 15:33:08.000000000 -0500
@@ -1,8 +1,7 @@
 <?php
 if (!defined('e107_INIT')) { exit; }
 
-$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content_admin.php';
-include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content_admin.php');
+include_lan(e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content_admin.php');
 
 $sql2 = new db;
 $total = $sql -> db_Count("pcontent", "(*)", "WHERE LEFT(content_parent,1) != '0' AND content_refer != 'sa'");
diff -x .svn -aruN 0.7.11.src/e107_plugins/content/handlers/content_form_class.php 0.7.12.src/e107_plugins/content/handlers/content_form_class.php
--- 0.7.11.src/e107_plugins/content/handlers/content_form_class.php	2007-05-29 15:14:10.000000000 -0500
+++ 0.7.12.src/e107_plugins/content/handlers/content_form_class.php	2008-07-25 16:03:07.000000000 -0500
@@ -12,9 +12,9 @@
 |        GNU General Public License (http://gnu.org).
 |
 |		$Source: /cvsroot/e107/e107_0.7/e107_plugins/content/handlers/content_form_class.php,v $
-|		$Revision: 1.127 $
-|		$Date: 2007/05/29 20:14:10 $
-|		$Author: lisa_ $
+|		$Revision: 1.129 $
+|		$Date: 2008/07/25 21:03:07 $
+|		$Author: e107steved $
 +---------------------------------------------------------------+
 */
 
@@ -1256,7 +1256,7 @@
 						}
 					}
 					$text .= "
-					<input class='button' style='width:20' type='submit' name='letter' value='all' />
+					<input class='button' style='width:20' type='submit' name='letter' value='".CONTENT_LAN_ALL."' />
 					</td>
 					</tr>
 					</table>
@@ -2254,8 +2254,8 @@
 		function show_options(){
 			global $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer;
 
-			$lan_file = $plugindir."languages/".e_LANGUAGE."/lan_content_options.php";
-			include_once(file_exists($lan_file) ? $lan_file : $plugindir."languages/English/lan_content_options.php");
+//			$lan_file = $plugindir."languages/".e_LANGUAGE."/lan_content_options.php";
+//			include_once(file_exists($lan_file) ? $lan_file : $plugindir."languages/English/lan_content_options.php");
 
 			$text = "
 			<div style='text-align:center'>
diff -x .svn -aruN 0.7.11.src/e107_plugins/content/languages/English/lan_content.php 0.7.12.src/e107_plugins/content/languages/English/lan_content.php
--- 0.7.11.src/e107_plugins/content/languages/English/lan_content.php	2006-11-30 10:10:50.000000000 -0600
+++ 0.7.12.src/e107_plugins/content/languages/English/lan_content.php	2008-07-25 16:03:34.000000000 -0500
@@ -4,9 +4,9 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/languages/English/lan_content.php,v $
-|     $Revision: 1.75 $
-|     $Date: 2006/11/30 16:10:50 $
-|     $Author: lisa_ $
+|     $Revision: 1.76 $
+|     $Date: 2008/07/25 21:03:34 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -190,6 +190,8 @@
 define("CONTENT_LAN_91", "next page");
 define("CONTENT_LAN_92", " - current");
 
+define('CONTENT_LAN_ALL', 'all');
+
 define("CONTENT_MENU_LAN_0", "content Menu :");
 define("CONTENT_MENU_LAN_1", "no content items yet");
 define("CONTENT_MENU_LAN_2", "recent items");
diff -x .svn -aruN 0.7.11.src/e107_plugins/forum/e_rss.php 0.7.12.src/e107_plugins/forum/e_rss.php
--- 0.7.11.src/e107_plugins/forum/e_rss.php	2006-07-07 22:18:25.000000000 -0500
+++ 0.7.12.src/e107_plugins/forum/e_rss.php	2008-07-21 16:07:07.000000000 -0500
@@ -109,7 +109,7 @@
 		"SELECT t.thread_thread, t.thread_id, t.thread_name, t.thread_datestamp, t.thread_parent, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, u.user_name, u.user_email FROM #forum_t AS t
 		LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id
 		LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
-		WHERE f.forum_class IN (0, 251, 252) AND t.thread_parent=0
+		WHERE f.forum_class IN (".USERCLASS_LIST.") AND t.thread_parent=0
 		ORDER BY t.thread_datestamp DESC LIMIT 0,".$this -> limit;
 		$sqlrss->db_Select_gen($this -> rssQuery);
 		$tmp = $sqlrss->db_getList();
@@ -141,7 +141,7 @@
 		LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id
 		LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id
 		LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
-		WHERE f.forum_class  IN (0, 251, 252)
+		WHERE f.forum_class  IN (".USERCLASS_LIST.")
 		ORDER BY t.thread_datestamp DESC LIMIT 0,".$this -> limit;
 		$sqlrss->db_Select_gen($this -> rssQuery);
 		$tmp = $sqlrss->db_getList();
@@ -183,7 +183,7 @@
 		FROM #forum_t AS t
 		LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id
 		LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
-		WHERE f.forum_class  IN (0, 251, 255) AND t.thread_id=".intval($this -> topicid);
+		WHERE f.forum_class  IN (".USERCLASS_LIST.") AND t.thread_id=".intval($this -> topicid);
 		$sqlrss->db_Select_gen($this -> rssQuery);
 		$topic = $sqlrss->db_Fetch();
 
@@ -192,7 +192,7 @@
 		FROM #forum_t AS t
 		LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id
 		LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
-		WHERE f.forum_class  IN (0, 251, 255) AND t.thread_parent=".intval($this -> topicid);
+		WHERE f.forum_class  IN (".USERCLASS_LIST.") AND t.thread_parent=".intval($this -> topicid);
 		$sqlrss->db_Select_gen($this -> rssQuery);
 		$replies = $sqlrss->db_getList();
 
diff -x .svn -aruN 0.7.11.src/e107_plugins/forum/forum_post.php 0.7.12.src/e107_plugins/forum/forum_post.php
--- 0.7.11.src/e107_plugins/forum/forum_post.php	2007-12-19 14:12:36.000000000 -0600
+++ 0.7.12.src/e107_plugins/forum/forum_post.php	2008-01-18 15:08:06.000000000 -0600
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_post.php,v $
-|     $Revision: 1.86 $
-|     $Date: 2007/12/19 20:12:36 $
+|     $Revision: 1.87 $
+|     $Date: 2008/01/18 21:08:06 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -618,7 +618,7 @@
 							}
 							else
 							{
-								@unlink($fpath.$orig_file);
+								@unlink(e_FILE.'public/'.$orig_file);
 								//show resized
 								$parms = image_getsize(e_FILE.'public/'.$new_file);
 								$_POST['post'] .= "[br][img{$parms}]".$fpath.$new_file."[/img][br]";
diff -x .svn -aruN 0.7.11.src/e107_plugins/forum/forum_shortcodes.php 0.7.12.src/e107_plugins/forum/forum_shortcodes.php
--- 0.7.11.src/e107_plugins/forum/forum_shortcodes.php	2007-10-27 15:19:27.000000000 -0500
+++ 0.7.12.src/e107_plugins/forum/forum_shortcodes.php	2008-05-26 07:02:27.000000000 -0500
@@ -16,7 +16,7 @@
 	
 SC_BEGIN THREADDATESTAMP
 global $post_info, $gen, $thread_id;
-return "<a id='post_{$post_info['thread_id']}'>".IMAGE_post."</a> ".$gen->convert_date($post_info['thread_datestamp'], "forum");
+return "<a id='post_{$post_info['thread_id']}' href='".e_SELF."?{$post_info['thread_id']}.post'>".IMAGE_post."</a> ".$gen->convert_date($post_info['thread_datestamp'], "forum");
 SC_END
 	
 SC_BEGIN POST
diff -x .svn -aruN 0.7.11.src/e107_plugins/forum/forum_stats.php 0.7.12.src/e107_plugins/forum/forum_stats.php
--- 0.7.11.src/e107_plugins/forum/forum_stats.php	2007-02-27 14:26:07.000000000 -0600
+++ 0.7.12.src/e107_plugins/forum/forum_stats.php	2008-06-26 14:59:04.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_stats.php,v $
-|     $Revision: 1.15 $
-|     $Date: 2007/02/27 20:26:07 $
+|     $Revision: 1.16 $
+|     $Date: 2008/06/26 19:59:04 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -156,7 +156,6 @@
 	<tr><td style='width: 50%; text-align: right;'><b>".FSLAN_8.":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>{$db_size}</td></tr>
 	<tr><td style='width: 50%; text-align: right;'><b>".FSLAN_9.":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>{$avg_row_len}</td></tr>
 
-	</tr>
 	</table>
 </td>
 </tr>
diff -x .svn -aruN 0.7.11.src/e107_plugins/forum/newforumposts_menu.php 0.7.12.src/e107_plugins/forum/newforumposts_menu.php
--- 0.7.11.src/e107_plugins/forum/newforumposts_menu.php	2007-10-08 16:02:52.000000000 -0500
+++ 0.7.12.src/e107_plugins/forum/newforumposts_menu.php	2008-07-20 12:08:36.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/newforumposts_menu.php,v $
-|     $Revision: 1.21 $
-|     $Date: 2007/10/08 21:02:52 $
+|     $Revision: 1.22 $
+|     $Date: 2008/07/20 17:08:36 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -86,7 +86,7 @@
 
 		if ($menu_pref['newforumposts_title'])
 		{
-			$text .= "<img src='".THEME_ABS."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' /> <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$id}.post'>".$topic."</a><br />".$fi['thread_thread']."<br />".NFP_11." ".$poster."<br />".$datestamp."<br/><br />";
+			$text .= "<img src='".THEME_ABS."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' /> <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$id}.post'>".$topic."</a><br />".$fi['thread_thread']."<br />".NFP_11." ".$poster."<br />".$datestamp."<br /><br />";
 		}
 		else
 		{
diff -x .svn -aruN 0.7.11.src/e107_plugins/links_page/e_latest.php 0.7.12.src/e107_plugins/links_page/e_latest.php
--- 0.7.11.src/e107_plugins/links_page/e_latest.php	2005-12-14 13:28:44.000000000 -0600
+++ 0.7.12.src/e107_plugins/links_page/e_latest.php	2008-07-28 15:15:57.000000000 -0500
@@ -2,5 +2,5 @@
 if (!defined('e107_INIT')) { exit; }
 
 $submitted_links = $sql->db_Select("tmp", "*", "tmp_ip='submitted_link' ");
-$text .= "<div style='padding-bottom: 2px;'><img src='".e_PLUGIN."links_page/images/linkspage_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' />".($submitted_links ? " <a href='".e_PLUGIN."links_page/admin_linkspage_config.php?sn'>".ADLAN_LAT_5.": $submitted_links</a>" : " ".ADLAN_LAT_5.": ".$submitted_links)."</div>";
+$text .= "<div style='padding-bottom: 2px;'><img src='".e_PLUGIN_ABS."links_page/images/linkspage_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' />".($submitted_links ? " <a href='".e_PLUGIN_ABS."links_page/admin_linkspage_config.php?sn'>".ADLAN_LAT_5.": $submitted_links</a>" : " ".ADLAN_LAT_5.": ".$submitted_links)."</div>";
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_plugins/links_page/languages/English.php 0.7.12.src/e107_plugins/links_page/languages/English.php
--- 0.7.11.src/e107_plugins/links_page/languages/English.php	2006-12-29 06:58:02.000000000 -0600
+++ 0.7.12.src/e107_plugins/links_page/languages/English.php	2008-07-16 15:45:17.000000000 -0500
@@ -4,14 +4,11 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/languages/English.php,v $
-|     $Revision: 1.29 $
-|     $Date: 2006/12/29 12:58:02 $
+|     $Revision: 1.30 $
+|     $Date: 2008/07/16 20:45:17 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
-// if(!defined("PAGE_NAME")){define("PAGE_NAME", "Links");}  <--
-// Lisa, could you please move this out of the language file ?
-
 
 
 define("LCLAN_PLUGIN_LAN_1", "Links Page");
@@ -313,6 +310,8 @@
 define("LAN_LINKS_49", "");
 define("LAN_LINKS_50", "You do not have permission to submit links at present");
 
+define('LAN_LINKS_SCH_1','Posted in reply to link');
+
 define("LAN_ADMIN_HELP_0", "linkspage help area");
 
 define("LAN_ADMIN_HELP_1", "<i>the manage link categories page shows all categories present.</i><br /><br /><b>detailed list</b><br />You see a list of all categories with their icon, name and description, options, and sorting options.<br /><br /><b>explanation of icons</b><br />
diff -x .svn -aruN 0.7.11.src/e107_plugins/links_page/link_class.php 0.7.12.src/e107_plugins/links_page/link_class.php
--- 0.7.11.src/e107_plugins/links_page/link_class.php	2007-09-28 16:20:58.000000000 -0500
+++ 0.7.12.src/e107_plugins/links_page/link_class.php	2008-07-28 15:15:57.000000000 -0500
@@ -11,8 +11,8 @@
 |    GNU    General Public  License (http://gnu.org).
 |
 |    $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/link_class.php,v $
-|    $Revision: 1.43 $
-|    $Date: 2007/09/28 21:20:58 $
+|    $Revision: 1.46 $
+|    $Date: 2008/07/28 20:15:57 $
 |    $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -476,7 +476,9 @@
         }
     }
 
-    function dbLinkCreate($mode='') {
+	// Create a new link. If $mode == 'submit', link has to go through the approval process; else its admin entry
+    function dbLinkCreate($mode='') 
+	{
         global $ns, $tp, $qs, $sql, $e107cache, $e_event, $linkspage_pref;
 
         $link_name          = $tp->toDB($_POST['link_name']);
@@ -484,26 +486,32 @@
         $link_description   = $tp->toDB($_POST['link_description']);
         $link_button        = $tp->toDB($_POST['link_but']);
 
-        if (!strstr($link_url, "http")) {
-            $link_url = "http://".$link_url;
+		if (!$link_name || !$link_url || !$link_description) 
+		{
+		  message_handler("ALERT", 5);
+		  return;
+		} 
+
+        if ($link_url && !strstr($link_url, "http")) 
+		{
+          $link_url = "http://".$link_url;
         }
 
         //create link, submit area, tmp table
-		if(isset($mode) && $mode == "submit"){
-			if (!$_POST['link_name'] || !$_POST['link_url'] || !$_POST['link_description']) {
-				 message_handler("ALERT", 5);
-			} else {
-                $username           = (defined('USERNAME')) ? USERNAME : LAN_LINKS_3;
+		if(isset($mode) && $mode == "submit")
+		{
+		  $username           = (defined('USERNAME')) ? USERNAME : LAN_LINKS_3;
 
-                $submitted_link     = intval($_POST['cat_id'])."^".$link_name."^".$link_url."^".$link_description."^".$link_button."^".$username;
-                $sql->db_Insert("tmp", "'submitted_link', '".time()."', '$submitted_link' ");
+		  $submitted_link     = intval($_POST['cat_id'])."^".$link_name."^".$link_url."^".$link_description."^".$link_button."^".$username;
+		  $sql->db_Insert("tmp", "'submitted_link', '".time()."', '$submitted_link' ");
 
-                $edata_ls = array("link_category" => $_POST['cat_id'], "link_name" => $link_name, "link_url" => $link_url, "link_description" => $link_description, "link_button" => $link_button, "username" => $username, "submitted_link" => $submitted_link);
-                $e_event->trigger("linksub", $edata_ls);
-                //header("location:".e_SELF."?s");
-                js_location(e_SELF."?s");
-            }
-        }else{
+		  $edata_ls = array("link_category" => $_POST['cat_id'], "link_name" => $link_name, "link_url" => $link_url, "link_description" => $link_description, "link_button" => $link_button, "username" => $username, "submitted_link" => $submitted_link);
+		  $e_event->trigger("linksub", $edata_ls);
+		  //header("location:".e_SELF."?s");
+		  js_location(e_SELF."?s");
+        }
+		else
+		{
             $link_t = $sql->db_Count("links_page", "(*)", "WHERE link_category='".intval($_POST['cat_id'])."'");
             $time   = ($_POST['update_datestamp'] ? time() : ($_POST['link_datestamp'] != "0" ? $_POST['link_datestamp'] : time()) );
 
@@ -638,6 +646,7 @@
         $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', 'blank*');
         $iconpath = e_PLUGIN."links_page/link_images/";
         $iconlist = $fl->get_files($iconpath,"",$rejectlist);
+        $iconpath = e_PLUGIN_ABS."links_page/link_images/";			// Absolute paths now we've got the files
 
         $text .= "
         <tr>
@@ -656,7 +665,7 @@
                 $img = $iconpath.$row['link_button'];
             }else{
                 $blank_display = 'display: none';
-                $img = e_PLUGIN."links_page/images/blank.gif";
+                $img = e_PLUGIN_ABS."links_page/images/blank.gif";
             }
             $text .= "</td><td><img id='iconview' src='".$img."' style='width:".$link_resize_value."px; border:0; ".$blank_display."' /><br /><br /></td></tr></table>";
             $text .= "</div>
@@ -756,7 +765,7 @@
                         }
 						else
 						{
-                            $img = "<img style='border:0' src='".e_PLUGIN."links_page/link_images/".$row['link_button']."' alt='".$LINK_CAT_NAME."' />";
+                            $img = "<img style='border:0' src='".e_PLUGIN_ABS."links_page/link_images/".$row['link_button']."' alt='".$LINK_CAT_NAME."' />";
                         }
                     }
                 }
@@ -774,7 +783,7 @@
                 <tr>
                 <td class='forumheader3' style='width:5%; text-align: center; vertical-align: middle'>".$img."</td>
                 <td style='width:65%' class='forumheader3'>
-                    <a href='".e_PLUGIN."links_page/links.php?".$row['link_id']."' rel='external'>".LINK_ICON_LINK."</a> ".$row['link_name']."
+                    <a href='".e_PLUGIN_ABS."links_page/links.php?".$row['link_id']."' rel='external'>".LINK_ICON_LINK."</a> ".$row['link_name']."
                 </td>
                 <td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>
                     <a href='".e_SELF."?link.edit.".$linkid."' title='".LCLAN_ITEM_31."'>".LINK_ICON_EDIT."</a>
@@ -922,7 +931,7 @@
             while ($row = $sql->db_Fetch()) {
                 $linkcatid = $row['link_category_id'];
                 if ($row['link_category_icon']) {
-                    $img = (strstr($row['link_category_icon'], "/") ? "<img src='".e_BASE.$row['link_category_icon']."' alt='' style='vertical-align:middle' />" : "<img src='".e_PLUGIN."links_page/cat_images/".$row['link_category_icon']."' alt='' style='vertical-align:middle' />");
+                    $img = (strstr($row['link_category_icon'], "/") ? "<img src='".e_BASE.$row['link_category_icon']."' alt='' style='vertical-align:middle' />" : "<img src='".e_PLUGIN_ABS."links_page/cat_images/".$row['link_category_icon']."' alt='' style='vertical-align:middle' />");
                 } else {
                     $img = "&nbsp;";
                 }
@@ -930,7 +939,7 @@
                 <tr>
                 <td style='width:5%; text-align:center' class='forumheader3'>".$img."</td>
                 <td class='forumheader3'>
-                    <a href='".e_PLUGIN."links_page/links.php?cat.".$linkcatid."' rel='external'>".LINK_ICON_LINK."</a>
+                    <a href='".e_PLUGIN_ABS."links_page/links.php?cat.".$linkcatid."' rel='external'>".LINK_ICON_LINK."</a>
                     ".$row['link_category_name']."<br /><span class='smalltext'>".$row['link_category_description']."</span>
                 </td>";
                 if($mode == "cat"){
diff -x .svn -aruN 0.7.11.src/e107_plugins/links_page/link_shortcodes.php 0.7.12.src/e107_plugins/links_page/link_shortcodes.php
--- 0.7.11.src/e107_plugins/links_page/link_shortcodes.php	2007-05-28 11:52:42.000000000 -0500
+++ 0.7.12.src/e107_plugins/links_page/link_shortcodes.php	2008-07-28 15:15:57.000000000 -0500
@@ -4,30 +4,6 @@
 $link_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
 /*
 
-//SC_BEGIN LINK_NAVIGATOR
-//global $LINK_NAVIGATOR, $linkspage_pref, $qs;
-//$main = "";
-//if(isset($linkspage_pref['link_navigator_frontpage']) && $linkspage_pref['link_navigator_frontpage']){
-//	$main .= "<a href='".e_PLUGIN."links_page/links.php'>".LAN_LINKS_14."</a> >><br />";
-//}
-//if(isset($linkspage_pref['link_navigator_submit']) && $linkspage_pref['link_navigator_submit'] && isset($linkspage_pref['link_submit']) && $linkspage_pref['link_submit'] && check_class($linkspage_pref['link_submit_class'])){
-//	$main .= "<a href='".e_PLUGIN."links_page/links.php?submit'>".LAN_LINKS_27."</a> >><br />";
-//}
-//if(isset($linkspage_pref['link_navigator_manager']) && $linkspage_pref['link_navigator_manager'] && isset($linkspage_pref['link_manager']) && $linkspage_pref['link_manager'] && check_class($linkspage_pref['link_manager_class'])){
-//	$main .= "<a href='".e_PLUGIN."links_page/links.php?manage'>".LCLAN_ITEM_35."</a> >><br />";
-//}
-//if(isset($linkspage_pref['link_navigator_refer']) && $linkspage_pref['link_navigator_refer']){
-//	$main .= "<a href='".e_PLUGIN."links_page/links.php?top'>".LAN_LINKS_12."</a> >><br />";
-//}
-//if(isset($linkspage_pref['link_navigator_rated']) && $linkspage_pref['link_navigator_rated']){
-//	$main .= "<a href='".e_PLUGIN."links_page/links.php?rated'>".LAN_LINKS_13."</a> >><br />";
-//}
-//if(isset($linkspage_pref['link_navigator_category']) && $linkspage_pref['link_navigator_category']){
-//	$main .= "<a href='".e_PLUGIN."links_page/links.php?cat'>".LAN_LINKS_43."</a> >><br />";
-//}
-//return $main;
-//SC_END
-
 SC_BEGIN LINK_NAVIGATOR
 global $LINK_NAVIGATOR, $rs, $linkspage_pref, $qs;
 $mains = "";
@@ -191,7 +167,7 @@
 			}
 		}else{
 			if(file_exists(e_PLUGIN."links_page/cat_images/".$rowl['link_category_icon'])){
-			$LINK_MAIN_ICON = "<img src='".e_PLUGIN."links_page/cat_images/".$rowl['link_category_icon']."' alt='' style='border:0; vertical-align:middle' />";
+			$LINK_MAIN_ICON = "<img src='".e_PLUGIN_ABS."links_page/cat_images/".$rowl['link_category_icon']."' alt='' style='border:0; vertical-align:middle' />";
 			} else {
 				if(isset($linkspage_pref['link_cat_icon_empty']) && $linkspage_pref['link_cat_icon_empty']){
 				$LINK_MAIN_ICON = "<img src='".THEME_ABS."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' style='border:0; vertical-align:middle;' />";
@@ -222,7 +198,7 @@
 
 SC_BEGIN LINK_MAIN_SHOWALL
 global $LINK_MAIN_SHOWALL, $linkspage_pref;
-return (isset($linkspage_pref['link_cat_total']) && $linkspage_pref['link_cat_total'] ? "<a href='".e_PLUGIN."links_page/links.php?cat.all'>".LAN_LINKS_25."</a>" : "");
+return (isset($linkspage_pref['link_cat_total']) && $linkspage_pref['link_cat_total'] ? "<a href='".e_PLUGIN_ABS."links_page/links.php?cat.all'>".LAN_LINKS_25."</a>" : "");
 SC_END
 
 
@@ -246,27 +222,27 @@
 					$LINK_BUTTON = $LINK_APPEND."\n<img class='linkspage_button' src='".e_BASE.$rowl['link_button']."' alt='' /></a>";
 				} else {
 					if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
-						$LINK_BUTTON = $LINK_APPEND."\n<img class='linkspage_button' style='width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='' /></a>";
+						$LINK_BUTTON = $LINK_APPEND."\n<img class='linkspage_button' style='width: 88px; height: 31px;' src='".e_PLUGIN_ABS."links_page/images/generic.png' alt='' /></a>";
 					}
 				}
 			}else{
 				if(file_exists(e_PLUGIN."links_page/link_images/".$rowl['link_button'])){
-					$LINK_BUTTON = $LINK_APPEND."\n<img class='linkspage_button' src='".e_PLUGIN."links_page/link_images/".$rowl['link_button']."' alt='' /></a>";
+					$LINK_BUTTON = $LINK_APPEND."\n<img class='linkspage_button' src='".e_PLUGIN_ABS."links_page/link_images/".$rowl['link_button']."' alt='' /></a>";
 				}else{
 					if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
-					$LINK_BUTTON = $LINK_APPEND."\n<img class='linkspage_button' style='width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='' /></a>";
+					$LINK_BUTTON = $LINK_APPEND."\n<img class='linkspage_button' style='width: 88px; height: 31px;' src='".e_PLUGIN_ABS."links_page/images/generic.png' alt='' /></a>";
 					}
 				}
 			}
 		}
 	} else {
 		if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
-			$LINK_BUTTON = $LINK_APPEND."\n<img class='linkspage_button' style='width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='' /></a>";
+			$LINK_BUTTON = $LINK_APPEND."\n<img class='linkspage_button' style='width: 88px; height: 31px;' src='".e_PLUGIN_ABS."links_page/images/generic.png' alt='' /></a>";
 		}
 	}
 }else{
 	if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
-		$LINK_BUTTON = $LINK_APPEND."\n<img class='linkspage_button' style='width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='' /></a>";
+		$LINK_BUTTON = $LINK_APPEND."\n<img class='linkspage_button' style='width: 88px; height: 31px;' src='".e_PLUGIN_ABS."links_page/images/generic.png' alt='' /></a>";
 	}
 }
 return $LINK_BUTTON;
@@ -379,14 +355,14 @@
 $two = round($tmp[1],1);
 $rating = $one.".".$two." ";
 for($c=1; $c<= $one; $c++){
-	$rating .= "<img src='".e_IMAGE."rate/box.png' alt='' style='height:8px; vertical-align:middle' />";
+	$rating .= "<img src='".e_IMAGE_ABS."rate/box.png' alt='' style='height:8px; vertical-align:middle' />";
 }
 if($one < 10){
 	for($c=9; $c>=$one; $c--){
-		$rating .= "<img src='".e_IMAGE."rate/empty.png' alt='' style='height:8px; vertical-align:middle' />";
+		$rating .= "<img src='".e_IMAGE_ABS."rate/empty.png' alt='' style='height:8px; vertical-align:middle' />";
 	}
 }
-$rating .= "<img src='".e_IMAGE."rate/boxend.png' alt='' style='height:8px; vertical-align:middle' />";
+$rating .= "<img src='".e_IMAGE_ABS."rate/boxend.png' alt='' style='height:8px; vertical-align:middle' />";
 return $rating;
 SC_END
 
@@ -400,19 +376,19 @@
 			if(strstr($rowl['link_button'], "/")){
 				$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0;' src='".e_BASE.$rowl['link_button']."' alt='".$LINK_RATED_NAME."' /></a>";
 			}else{
-				$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0' src='".e_PLUGIN."links_page/link_images/".$rowl['link_button']."' alt='".$LINK_RATED_NAME."' /></a>";
+				$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0' src='".e_PLUGIN_ABS."links_page/link_images/".$rowl['link_button']."' alt='".$LINK_RATED_NAME."' /></a>";
 			}
 		}
 	} else {
 		if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
-			$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0; width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='".$LINK_RATED_NAME."' /></a>";
+			$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0; width: 88px; height: 31px;' src='".e_PLUGIN_ABS."links_page/images/generic.png' alt='".$LINK_RATED_NAME."' /></a>";
 		}else{
 			$LINK_RATED_BUTTON = "";
 		}
 	}
 }else{
 	if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
-		$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0; width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='".$LINK_RATED_NAME."' /></a>";
+		$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0; width: 88px; height: 31px;' src='".e_PLUGIN_ABS."links_page/images/generic.png' alt='".$LINK_RATED_NAME."' /></a>";
 	}else{
 		$LINK_RATED_BUTTON = "";
 	}
diff -x .svn -aruN 0.7.11.src/e107_plugins/links_page/links.php 0.7.12.src/e107_plugins/links_page/links.php
--- 0.7.11.src/e107_plugins/links_page/links.php	2007-09-26 15:05:58.000000000 -0500
+++ 0.7.12.src/e107_plugins/links_page/links.php	2008-02-25 14:11:10.000000000 -0600
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/links.php,v $
-|     $Revision: 1.46 $
-|     $Date: 2007/09/26 20:05:58 $
+|     $Revision: 1.47 $
+|     $Date: 2008/02/25 20:11:10 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -106,6 +106,9 @@
 	}
 	if($qs[0] == "manage"){
 		if(check_class($linkspage_pref['link_manager_class'])){
+			
+			$lc->verify_link_manage($qs[2]);
+			
 			if(isset($linkspage_pref['link_directpost']) && $linkspage_pref['link_directpost']){
 				$lc -> dbLinkCreate();
 			}else{
@@ -167,7 +170,7 @@
 //submit link
 if (isset($qs[0]) && $qs[0] == "submit")
 {
-  if (check_class($linkspage_pref['link_submit_class'])) 
+  if (check_class($linkspage_pref['link_submit_class']))
   {
 	echo displayNavigator('');
 	displayLinkSubmit();
@@ -286,8 +289,14 @@
 	  }
 	  if (isset($delete) && $delete == 'main') 
 	  {
-		$sql->db_Select("links_page", "link_category, link_order", "link_id='".intval($del_id)."'");		// Get the position of target in the order
+		$sql->db_Select("links_page", "link_category, link_order, link_author", "link_id='".intval($del_id)."'");		// Get the position of target in the order
+		
 		$row = $sql->db_Fetch();
+	    if($row['link_author'] != USERID) {
+			header('Location: '.SITEURL);
+			exit;
+	    }
+			
 		if (!is_object($sql2)){ $sql2 = new db; }
 		$sql->db_Select("links_page", "link_id", "link_order>'".$row['link_order']."' && link_category='".intval($row['link_category'])."'");
 		while ($row = $sql->db_Fetch()) 
@@ -517,8 +526,8 @@
 				$text .= $link_table_start.$link_table_string.$link_table_end;
 
 			}
-
-				$ns->tablerender($link_table_caption, $text);
+			$nav = $tp->parseTemplate("{NAVIGATOR}", FALSE, $link_shortcodes);
+			$ns->tablerender($link_table_caption, $nav.$text);
 		}
 	}
 	return;
@@ -529,4 +538,4 @@
 
 
 
-?>
\ No newline at end of file
+?>
diff -x .svn -aruN 0.7.11.src/e107_plugins/links_page/search/search_comments.php 0.7.12.src/e107_plugins/links_page/search/search_comments.php
--- 0.7.11.src/e107_plugins/links_page/search/search_comments.php	2005-12-14 13:28:44.000000000 -0600
+++ 0.7.12.src/e107_plugins/links_page/search/search_comments.php	2008-07-16 15:45:18.000000000 -0500
@@ -10,7 +10,7 @@
 	global $con;
 	$datestamp = $con -> convert_date($row['comment_datestamp'], "long");
 	$res['link'] = e_PLUGIN."links_page/links.php?comment.".$row['link_id'];
-	$res['pre_title'] = 'Posted in reply to link: ';
+	$res['pre_title'] = LAN_LINKS_SCH_1.': ';
 	$res['title'] = $row['link_name'];
 	$res['summary'] = $row['comment_comment'];
 	preg_match("/([0-9]+)\.(.*)/", $row['comment_author'], $user);
diff -x .svn -aruN 0.7.11.src/e107_plugins/log/admin_config.php 0.7.12.src/e107_plugins/log/admin_config.php
--- 0.7.11.src/e107_plugins/log/admin_config.php	2006-10-30 07:46:31.000000000 -0600
+++ 0.7.12.src/e107_plugins/log/admin_config.php	2008-04-25 14:17:04.000000000 -0500
@@ -11,14 +11,14 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/log/admin_config.php,v $
-|     $Revision: 1.17 $
-|     $Date: 2006/10/30 13:46:31 $
-|     $Author: e107coders $
+|     $Revision: 1.18 $
+|     $Date: 2008/04/25 19:17:04 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("../../class2.php");
 if (!getperms("P")) {
-	header("location:../index.php");
+	header("location:../../index.php");
 	 exit;
 }
 
diff -x .svn -aruN 0.7.11.src/e107_plugins/log/stats.php 0.7.12.src/e107_plugins/log/stats.php
--- 0.7.11.src/e107_plugins/log/stats.php	2007-08-14 14:26:55.000000000 -0500
+++ 0.7.12.src/e107_plugins/log/stats.php	2008-04-25 14:24:42.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/log/stats.php,v $
-|     $Revision: 1.40 $
-|     $Date: 2007/08/14 19:26:55 $
+|     $Revision: 1.41 $
+|     $Date: 2008/04/25 19:24:42 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -21,8 +21,6 @@
 @include_once(e_PLUGIN."log/languages/".e_LANGUAGE.".php");
 @include_once(e_PLUGIN."log/languages/English.php");
 
-$stat = new siteStats();
-
 function core_head() {
 	$bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_IMAGE."generic/bar.png");
 	return "<style type='text/css'>
@@ -52,11 +50,13 @@
 $qs = explode('.', e_QUERY, 3);
 $action = varset($qs[0],1);
 $sec_action = varset($qs[1],FALSE);
-$order = varset($qs[2],0);
+$order = varset($qs[1],0);
 
-$toremove = $order;
+$toremove = varset($qs[2],'');
 $order = intval($order);
 
+$stat = new siteStats();
+
 if($stat -> error) 
 {
 	$ns->tablerender(ADSTAT_L6, $stat -> error);
diff -x .svn -aruN 0.7.11.src/e107_plugins/newforumposts_main/newforumposts_main.php 0.7.12.src/e107_plugins/newforumposts_main/newforumposts_main.php
--- 0.7.11.src/e107_plugins/newforumposts_main/newforumposts_main.php	2007-12-22 13:18:30.000000000 -0600
+++ 0.7.12.src/e107_plugins/newforumposts_main/newforumposts_main.php	2008-07-28 15:15:57.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newforumposts_main/newforumposts_main.php,v $
-|     $Revision: 1.26 $
-|     $Date: 2007/12/22 19:18:30 $
+|     $Revision: 1.27 $
+|     $Date: 2008/07/28 20:15:57 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -81,7 +81,7 @@
 }
 else
 {
-  $ICON = "<img src='".e_PLUGIN."forum/images/".IMODE."/new_small.png' alt='' />";
+  $ICON = "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/new_small.png' alt='' />";
 }
 $TOTAL_TOPICS = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent='0' ");
 $TOTAL_REPLIES = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent!='0' ");
diff -x .svn -aruN 0.7.11.src/e107_plugins/newsfeed/admin_config.php 0.7.12.src/e107_plugins/newsfeed/admin_config.php
--- 0.7.11.src/e107_plugins/newsfeed/admin_config.php	2006-06-07 23:02:47.000000000 -0500
+++ 0.7.12.src/e107_plugins/newsfeed/admin_config.php	2008-06-27 14:41:01.000000000 -0500
@@ -11,15 +11,16 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/admin_config.php,v $
-|     $Revision: 1.9 $
-|     $Date: 2006/06/08 04:02:47 $
-|     $Author: e107coders $
+|     $Revision: 1.10 $
+|     $Date: 2008/06/27 19:41:01 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("../../class2.php");
-if (!getperms("E")) {
-	header("location:".e_BASE."index.php");
-	 exit;
+if (!getperms("P")) 
+{
+  header("location:".e_BASE."index.php");
+  exit;
 }
 
 require_once(e_ADMIN."auth.php");
diff -x .svn -aruN 0.7.11.src/e107_plugins/newsfeed/newsfeed.php 0.7.12.src/e107_plugins/newsfeed/newsfeed.php
--- 0.7.11.src/e107_plugins/newsfeed/newsfeed.php	2006-11-04 12:26:47.000000000 -0600
+++ 0.7.12.src/e107_plugins/newsfeed/newsfeed.php	2008-05-30 15:36:47.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/newsfeed.php,v $
-|     $Revision: 1.13 $
-|     $Date: 2006/11/04 18:26:47 $
-|     $Author: e107coders $
+|     $Revision: 1.14 $
+|     $Date: 2008/05/30 20:36:47 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("../../class2.php");
@@ -132,6 +132,7 @@
 			else
 			{
 				$FEEDITEMLINK = "<a href='".$item['link']."' rel='external'>".$tp -> toHTML($item['title'], TRUE)."</a>\n";
+				$FEEDITEMLINK = str_replace('&', '&amp;', $FEEDITEMLINK);
 				$feeditemtext = preg_replace("#\[[a-z0-9=]+\]|\[\/[a-z]+\]|\{[A-Z_]+\}#si", "", $item['description']);
 				$FEEDITEMTEXT = $tp -> toHTML($feeditemtext, TRUE)."\n";
 			}
diff -x .svn -aruN 0.7.11.src/e107_plugins/newsfeed/newsfeed_functions.php 0.7.12.src/e107_plugins/newsfeed/newsfeed_functions.php
--- 0.7.11.src/e107_plugins/newsfeed/newsfeed_functions.php	2007-02-07 17:27:32.000000000 -0600
+++ 0.7.12.src/e107_plugins/newsfeed/newsfeed_functions.php	2008-05-30 15:36:47.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/newsfeed_functions.php,v $
-|     $Revision: 1.18 $
-|     $Date: 2007/02/07 23:27:32 $
-|     $Author: e107coders $
+|     $Revision: 1.19 $
+|     $Date: 2008/05/30 20:36:47 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -169,6 +169,7 @@
 				{
 					$item = $item_total[$i];
 					$FEEDITEMLINK = "<a href='".$item['link']."' rel='external'>".$tp -> toHTML($item['title'], TRUE)."</a>\n";
+					$FEEDITEMLINK = str_replace('&', '&amp;', $FEEDITEMLINK);
 					$feeditemtext = preg_replace("#\[[a-z0-9=]+\]|\[\/[a-z]+\]|\{[A-Z_]+\}#si", "", strip_tags($item['description']));
 					$FEEDITEMTEXT = $tp->text_truncate($feeditemtext, $truncate, $truncate_string);
 
diff -x .svn -aruN 0.7.11.src/e107_plugins/newsfeed/templates/newsfeed_template.php 0.7.12.src/e107_plugins/newsfeed/templates/newsfeed_template.php
--- 0.7.11.src/e107_plugins/newsfeed/templates/newsfeed_template.php	2006-11-13 06:25:00.000000000 -0600
+++ 0.7.12.src/e107_plugins/newsfeed/templates/newsfeed_template.php	2008-05-30 15:36:47.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/templates/newsfeed_template.php,v $
-|     $Revision: 1.7 $
-|     $Date: 2006/11/13 12:25:00 $
-|     $Author: e107coders $
+|     $Revision: 1.8 $
+|     $Date: 2008/05/30 20:36:47 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -52,11 +52,11 @@
 </tr>
 
 <tr>
-<td class='forumheader3' style='text-align: right;'><span class='smalltext'>{FEEDCOPYRIGHT} | {FEEDLASTBUILDDATE}</td>
+<td class='forumheader3' style='text-align: right;'><span class='smalltext'>{FEEDCOPYRIGHT} | {FEEDLASTBUILDDATE}</span></td>
 </tr>
 
 <tr>
-<td class='forumheader3' style='text-align: center;'><span class='smalltext'>{BACKLINK}</td>
+<td class='forumheader3' style='text-align: center;'><span class='smalltext'>{BACKLINK}</span></td>
 </tr>
 </table>\n";
 
diff -x .svn -aruN 0.7.11.src/e107_plugins/online_menu/online_menu.php 0.7.12.src/e107_plugins/online_menu/online_menu.php
--- 0.7.11.src/e107_plugins/online_menu/online_menu.php	2007-05-28 11:52:42.000000000 -0500
+++ 0.7.12.src/e107_plugins/online_menu/online_menu.php	2008-08-01 14:23:38.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/online_menu/online_menu.php,v $
-|     $Revision: 1.15 $
-|     $Date: 2007/05/28 16:52:42 $
+|     $Revision: 1.16 $
+|     $Date: 2008/08/01 19:23:38 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -30,13 +30,14 @@
 
 	global $e107cache;
 	$members_totals = $e107cache->retrieve("online_menu_totals", 120);
-	if($members_totals == false) {
-		$total_members = $sql->db_Count("user");
-		$newest_member = $sql->db_Select("user", "user_id, user_name", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1");
-		$row = $sql->db_Fetch();
-		extract($row);
-		$members_totals = "<br />".ONLINE_L5.": ".$total_members.", ".ONLINE_L6.": <a href='".e_HTTP."user.php?id.{$user_id}'>{$user_name}</a>";
-		$e107cache->set("online_menu_totals", $members_totals);
+	if($members_totals == false) 
+	{
+	  $total_members = $sql->db_Count("user","(*)","where user_ban = 0");
+	  $newest_member = $sql->db_Select("user", "user_id, user_name", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1");
+	  $row = $sql->db_Fetch();
+	  extract($row);
+	  $members_totals = "<br />".ONLINE_L5.": ".$total_members.", ".ONLINE_L6.": <a href='".e_HTTP."user.php?id.{$user_id}'>{$user_name}</a>";
+	  $e107cache->set("online_menu_totals", $members_totals);
 	}
 	$text .= $members_totals;
 
diff -x .svn -aruN 0.7.11.src/e107_plugins/pdf/e107pdf.php 0.7.12.src/e107_plugins/pdf/e107pdf.php
--- 0.7.11.src/e107_plugins/pdf/e107pdf.php	2007-09-26 14:10:48.000000000 -0500
+++ 0.7.12.src/e107_plugins/pdf/e107pdf.php	2008-08-08 16:13:41.000000000 -0500
@@ -1,5 +1,23 @@
 <?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pdf/e107pdf.php,v $
+|     $Revision: 1.19 $
+|     $Date: 2008/08/08 21:13:41 $
+|     $Author: e107steved $
++----------------------------------------------------------------------------+
+*/
 
+// Debug option - adds entries to rolling log (only works in 0.8)
 //define ('PDF_DEBUG', TRUE);
 define ('PDF_DEBUG', FALSE);
 
@@ -241,7 +259,7 @@
 
 	if (PDF_DEBUG) 
 	{
-	  $admin_log->e_log_event(10,'split_vars',"DEBUG","PDF Trace","Write text: : ".$tp->toHTML('[code]'.$html.'[/code]',TRUE),FALSE,LOG_TO_ROLLING);
+//	  $admin_log->e_log_event(10,'split_vars',"DEBUG","PDF Trace","Write text: : ".$tp->toHTML('[code]'.$html.'[/code]',TRUE),FALSE,LOG_TO_ROLLING);
 	  $acc = array();
 	  foreach ($a as $ef) { $acc[] = strlen($ef); }
 	  $admin_log->e_log_event(10,'no_vars',"DEBUG","PDF Trace","Lengths:: ".implode(',',$acc),FALSE,LOG_TO_ROLLING);
@@ -255,46 +273,12 @@
 			if($i%2==0)
 			{
 				//Text between tags
-				if($this->HREF){
+				if($this->HREF)
+				{
 					$this->PutLink($this->HREF,$e);
 					$this->HREF='';
-				}elseif(0 && $this->IMG){		// This bit shouldn't happen now
-					//correct url
-					if(is_readable($this->SRC)){
-						$file = trim($this->SRC);
-						$pos=strrpos($file,'.');
-						$type=substr($file,$pos+1);
-						$type=strtolower($type);
-						//for now only jpg, jpeg and png are supported
-						if($type=='jpg' || $type=='jpeg' || $type=='png')
-						{
-						  if ((strpos($file,'http') !== 0) && (strpos($file,'www.') !== 0))
-						  {  // Its a local file - possibly don't need to do anything at all!
-						    $url = $tp->replaceConstants($file);
-						  }
-/*							Old path-related stuff confused things
-							$url = str_replace("../", "", $this->SRC);
-							$imgsearch = array(e_IMAGE, e_THEME, e_PLUGIN, e_FILE, e_HANDLER);
-							//e_BASE and e_ADMIN are not taken into account !
-							foreach($imgsearch as $p){
-								$p = str_replace("../", "", $p);
-								$l = strpos($url, $p);
-								if ($l !== false) {
-									$url = SITEURL.$url;
-								}
-							}  */
-							$this->Ln();		// Newline with 'default' height to avoid overlaying text
-							$this->PutImage($url,$scale);
-							$this->Ln(2);
-							$this->SetX($this->lMargin);
-						}
-					}
-					$this->IMG='';
-					$this->SRC='';
-					$this->WIDTH='';
-					$this->HEIGHT='';
-
-				}elseif($this->CENTER){
+				}
+				elseif($this->CENTER){
 					$this->Cell(0,5,$e,0,1,'C');
 				}elseif($this->ALIGN == 'center'){
 					$this->Cell(0,5,$e,0,1,'C');
@@ -347,7 +331,7 @@
 
 	function OpenTag($tag,$attr,$scale)
 	{
-	  global $tp;
+	  global $tp, $e107;
 	  global $admin_log;
 	  
 		$tag = strtoupper($tag);
@@ -407,17 +391,19 @@
 			case 'IMG':
 				if (PDF_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","PDF Trace","Image tag found: ".$attr['SRC'],FALSE,LOG_TO_ROLLING);
 				$this->IMG=true;
-				$this->SRC=$attr['SRC'];
+				$this->SRC= e_BASE.str_replace($e107->http_path,'',$attr['SRC']);
 				$this->WIDTH=$attr['WIDTH'];
 				$this->HEIGHT=$attr['HEIGHT'];
 				// Its a 'closed' tag - so need to process it immediately
 				
+				if (PDF_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","PDF Trace","Image tag noted: ".$this->SRC." W={$this->WIDTH}, H={$this->HEIGHT}",FALSE,LOG_TO_ROLLING);
 				if(is_readable($this->SRC))
 				{
 				  $file = trim($this->SRC);
 				  $pos=strrpos($file,'.');
 				  $type=substr($file,$pos+1);
 				  $type=strtolower($type);
+				if (PDF_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","PDF Trace","Image file: {$file} Type: {$type}",FALSE,LOG_TO_ROLLING);
 					//for now only jpg, jpeg and png are supported
 				  if($type=='jpg' || $type=='jpeg' || $type=='png')
 				  {
@@ -426,6 +412,7 @@
 					  $url = $tp->replaceConstants($file);
 					}
 					$this->Ln();		// Newline with 'default' height to avoid overlaying text
+				if (PDF_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","PDF Trace","Process Image file: {$url} Scale: {$scale}",FALSE,LOG_TO_ROLLING);
 					$this->PutImage($url,$scale);
 					$this->Ln(2);
 					$this->SetX($this->lMargin);
diff -x .svn -aruN 0.7.11.src/e107_plugins/pm/languages/admin/English.php 0.7.12.src/e107_plugins/pm/languages/admin/English.php
--- 0.7.11.src/e107_plugins/pm/languages/admin/English.php	2007-02-04 09:36:54.000000000 -0600
+++ 0.7.12.src/e107_plugins/pm/languages/admin/English.php	2008-02-02 16:29:17.000000000 -0600
@@ -18,8 +18,8 @@
 define('ADLAN_PM_16', "Plugin Title");
 define('ADLAN_PM_17', "Show new PM animation");
 define('ADLAN_PM_18', "Show user dropdown");
-define('ADLAN_PM_19', "READ message timeout");
-define('ADLAN_PM_20', "UNREAD message timeout");
+define('ADLAN_PM_19', "READ message timeout (days)");
+define('ADLAN_PM_20', "UNREAD message timeout (days)");
 define('ADLAN_PM_21', "Popup notification on new PM");
 define('ADLAN_PM_22', "Popup delay timeout");
 define('ADLAN_PM_23', "Restrict PM use to");
diff -x .svn -aruN 0.7.11.src/e107_plugins/pm/pm.php 0.7.12.src/e107_plugins/pm/pm.php
--- 0.7.11.src/e107_plugins/pm/pm.php	2007-09-22 12:41:29.000000000 -0500
+++ 0.7.12.src/e107_plugins/pm/pm.php	2008-02-02 16:29:16.000000000 -0600
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/pm.php,v $
-|     $Revision: 1.26 $
-|     $Date: 2007/09/22 17:41:29 $
-|     $Author: e107steved $
+|     $Revision: 1.27 $
+|     $Date: 2008/02/02 22:29:16 $
+|     $Author: mcfly_e107 $
 +----------------------------------------------------------------------------+
 */
 
@@ -55,12 +55,12 @@
 $unread_timeout = intval($pm_prefs['unread_timeout']);
 if($read_timeout > 0)
 {
-	$timeout = time()-($read_timeout * 60);
+	$timeout = time()-($read_timeout * 86400);
 	$del_qry[] = "(pm_sent < {$timeout} AND pm_read > 0)";
 }
 if($unread_timeout > 0)
 {
-	$timeout = time()-($unread_timeout * 60);
+	$timeout = time()-($unread_timeout * 86400);
 	$del_qry[] = "(pm_sent < {$timeout} AND pm_read = 0)";
 }
 if(count($del_qry) > 0)
diff -x .svn -aruN 0.7.11.src/e107_plugins/pm/pm_template.php 0.7.12.src/e107_plugins/pm/pm_template.php
--- 0.7.11.src/e107_plugins/pm/pm_template.php	2006-10-30 08:01:47.000000000 -0600
+++ 0.7.12.src/e107_plugins/pm/pm_template.php	2008-07-28 15:15:58.000000000 -0500
@@ -11,17 +11,17 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/pm_template.php,v $
-|     $Revision: 1.13 $
-|     $Date: 2006/10/30 14:01:47 $
-|     $Author: e107coders $
+|     $Revision: 1.14 $
+|     $Date: 2008/07/28 20:15:58 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 if (!defined('e107_INIT')) { exit; }
 
 global $sc_style;
 
-define("PM_READ_ICON", "<img src='".e_PLUGIN."/pm/images/read.png' style='height:16px; width:16px; border:0px' alt='".LAN_PM_111."' />");
-define("PM_UNREAD_ICON", "<img src='".e_PLUGIN."/pm/images/unread.png' style='height:16px; width:16px; border:0px' alt='".LAN_PM_27."' />");
+define("PM_READ_ICON", "<img src='".e_PLUGIN_ABS."/pm/images/read.png' style='height:16px; width:16px; border:0px' alt='".LAN_PM_111."' />");
+define("PM_UNREAD_ICON", "<img src='".e_PLUGIN_ABS."/pm/images/unread.png' style='height:16px; width:16px; border:0px' alt='".LAN_PM_27."' />");
 
 $sc_style['PM_ATTACHMENT_ICON']['pre'] = " ";
 
diff -x .svn -aruN 0.7.11.src/e107_plugins/pm/private_msg_menu.php 0.7.12.src/e107_plugins/pm/private_msg_menu.php
--- 0.7.11.src/e107_plugins/pm/private_msg_menu.php	2007-05-28 06:18:11.000000000 -0500
+++ 0.7.12.src/e107_plugins/pm/private_msg_menu.php	2008-07-28 15:15:58.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/private_msg_menu.php,v $
-|     $Revision: 1.12 $
-|     $Date: 2007/05/28 11:18:11 $
+|     $Revision: 1.13 $
+|     $Date: 2008/07/28 20:15:58 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -26,10 +26,10 @@
 require_once(e_PLUGIN."pm/pm_func.php");
 pm_getInfo('clear');
 
-define("PM_INBOX_ICON", "<img src='".e_PLUGIN."pm/images/mail_get.png' style='height:16px; width:16px; border:0px;' alt='".LAN_PM_25."' title='".LAN_PM_25."' />");
-define("PM_OUTBOX_ICON", "<img src='".e_PLUGIN."pm/images/mail_send.png' style='height:16px; width:16px; border:0px;' alt='".LAN_PM_26."' title='".LAN_PM_26."' />");
+define("PM_INBOX_ICON", "<img src='".e_PLUGIN_ABS."pm/images/mail_get.png' style='height:16px; width:16px; border:0px;' alt='".LAN_PM_25."' title='".LAN_PM_25."' />");
+define("PM_OUTBOX_ICON", "<img src='".e_PLUGIN_ABS."pm/images/mail_send.png' style='height:16px; width:16px; border:0px;' alt='".LAN_PM_26."' title='".LAN_PM_26."' />");
 define("PM_SEND_LINK", LAN_PM_35);
-define("NEWPM_ANIMATION", "<img src='".e_PLUGIN."pm/images/newpm.gif' alt='' style='border:0' />");
+define("NEWPM_ANIMATION", "<img src='".e_PLUGIN_ABS."pm/images/newpm.gif' alt='' style='border:0' />");
 
 $sc_style['SEND_PM_LINK']['pre'] = "<br /><br />[ ";
 $sc_style['SEND_PM_LINK']['post'] = " ]";
diff -x .svn -aruN 0.7.11.src/e107_plugins/poll/poll_class.php 0.7.12.src/e107_plugins/poll/poll_class.php
--- 0.7.11.src/e107_plugins/poll/poll_class.php	2007-11-01 17:47:27.000000000 -0500
+++ 0.7.12.src/e107_plugins/poll/poll_class.php	2008-08-04 15:31:30.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/poll/poll_class.php,v $
-|     $Revision: 1.55 $
-|     $Date: 2007/11/01 22:47:27 $
+|     $Revision: 1.58 $
+|     $Date: 2008/08/04 20:31:30 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -53,21 +53,32 @@
 		*/
 
 		global $tp, $sql;
-		extract($_POST);
 
-		$poll_title = $tp->toDB($poll_title);
+		$poll_title = $tp->toDB($_POST['poll_title']);
+		$poll_comment= $tp -> toDB($_POST['poll_comment']);
+		$multipleChoice = intval($_POST['multipleChoice']);
+		$showResults = intval($_POST['showResults']);
+		$pollUserclass =intval($_POST['pollUserclass']);
+		$storageMethod = intval($_POST['storageMethod']);
 		$active_start = (!$_POST['startmonth'] || !$_POST['startday'] || !$_POST['startyear'] ? 0 : mktime (0, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear']));
 		$active_end = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear']));
 		$poll_options = "";
 
-		foreach($poll_option as $key => $value)
+		foreach($_POST['poll_option'] as $key => $value)
 		{
-			$poll_options .= $tp->toDB($poll_option[$key]).chr(1);
+			$poll_options .= $tp->toDB($value).chr(1);
 		}
 
 		if(POLLACTION == "edit")
 		{
-			$sql -> db_Update("polls", "poll_title='$poll_title', poll_options='$poll_options', poll_comment='".$tp -> toDB($poll_comment)."', poll_allow_multiple=".intval($multipleChoice).", poll_result_type=".intval($showResults).", poll_vote_userclass=".intval($pollUserclass).", poll_storage_method=".intval($storageMethod)." WHERE poll_id=".intval(POLLID));
+		  $sql -> db_Update("polls", "poll_title='{$poll_title}', 
+									  poll_options='{$poll_options}', 
+									  poll_comment='{$poll_comment}', 
+									  poll_allow_multiple={$multipleChoice}, 
+									  poll_result_type={$showResults}, 
+									  poll_vote_userclass={$pollUserclass}, 
+									  poll_storage_method={$storageMethod}
+										WHERE poll_id=".intval(POLLID));
 
 			/* update poll results - bugtracker #1124 .... */
 			$sql -> db_Select("polls", "poll_votes", "poll_id='".intval(POLLID)."' ");
@@ -233,16 +244,24 @@
 	function render_poll($pollArray = "", $type = "menu", $POLLMODE = "", $returnMethod=FALSE)
 	{
 		global $POLLSTYLE, $sql, $tp, $ns;
-		if($POLLMODE == "query")
+		switch ($POLLMODE)
 		{
+		  case "query" :	// Show poll, register any vote
 			$this->get_poll($pollArray);
 			$pollArray = $this->pollRow;
 			$POLLMODE = $this->pollmode;
+			break;
+		  case 'results' :
+			if ($sql->db_Select_gen($pollArray))
+			{
+			  $pollArray = $sql -> db_Fetch();
+			}
+			break;
 		}
 
-		$barl = (file_exists(THEME."images/barl.png") ? THEME_ABS."images/barl.png" : e_PLUGIN."poll/images/barl.png");
-		$barr = (file_exists(THEME."images/barr.png") ? THEME_ABS."images/barr.png" : e_PLUGIN."poll/images/barr.png");
-		$bar = (file_exists(THEME."images/bar.png") ? THEME_ABS."images/bar.png" : e_PLUGIN."poll/images/bar.png");
+		$barl = (file_exists(THEME."images/barl.png") ? THEME_ABS."images/barl.png" : e_PLUGIN_ABS."poll/images/barl.png");
+		$barr = (file_exists(THEME."images/barr.png") ? THEME_ABS."images/barr.png" : e_PLUGIN_ABS."poll/images/barr.png");
+		$bar = (file_exists(THEME."images/bar.png") ? THEME_ABS."images/bar.png" : e_PLUGIN_ABS."poll/images/bar.png");
 
 		if($type == "preview")
 		{
@@ -272,10 +291,10 @@
 //			$voteArray = array_slice($voteArray, 0, -1);
 		}
 		else
-		{
-			$optionArray = explode(chr(1), $pollArray['poll_options']);
-			$optionArray = array_slice($optionArray, 0, -1);
-			$voteArray = explode(chr(1), $pollArray['poll_votes']);
+		{  // Get existing results
+		  $optionArray = explode(chr(1), $pollArray['poll_options']);
+		  $optionArray = array_slice($optionArray, 0, -1);
+		  $voteArray = explode(chr(1), $pollArray['poll_votes']);
 //			$voteArray = array_slice($voteArray, 0, -1);
 		}
 
@@ -311,10 +330,11 @@
 		$preview = FALSE;
 		if ($type == "preview")
 		{
-			$POLLMODE = "notvoted";
+		  $POLLMODE = "notvoted";
 		}
-		else if($type == "forum") {
-			$preview = TRUE;
+		elseif($type == "forum") 
+		{
+		  $preview = TRUE;
 		}
 
 		$comment_total = $sql->db_Select("comments", "*", "comment_item_id='".intval($pollArray['poll_id'])."' AND comment_type=4");
@@ -327,82 +347,80 @@
 
 		switch ($POLLMODE)
 		{
-			case "notvoted":
-				$text = "<form method='post' action='".e_SELF.(e_QUERY ? "?".e_QUERY : "")."'>\n".preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_START : $POLL_NOTVOTED_START));
-				$count = 1;
-				$alt = 0; // alternate style.
-				foreach($optionArray as $option) {
+		  case "notvoted":
+			$text = "<form method='post' action='".e_SELF.(e_QUERY ? "?".e_QUERY : "")."'>\n".preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_START : $POLL_NOTVOTED_START));
+			$count = 1;
+			$alt = 0; // alternate style.
+			foreach($optionArray as $option) 
+			{
 				//	$MODE = ($mode) ? $mode : "";		/* debug */
-					$OPTIONBUTTON = ($pollArray['poll_allow_multiple'] ? "<input type='checkbox' name='votea[]' value='$count' />" : "<input type='radio' name='votea' value='$count' />");
-					$OPTION = $tp->toHTML($option, TRUE);
-					if(isset($POLL_NOTVOTED_LOOP_ALT) && $POLL_NOTVOTED_LOOP_ALT && $type != "forum"){ // alternating style
-						$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($alt == 0 ? $POLL_NOTVOTED_LOOP : $POLL_NOTVOTED_LOOP_ALT));
-						$alt = ($alt ==0) ? 1 : 0;
-					}else{
-						$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_LOOP : $POLL_NOTVOTED_LOOP));
-					}
-					$count ++;
-				}
-				$SUBMITBUTTON = "<input class='button' type='submit' name='pollvote' value='".POLLAN_30."' />";
-				if(('preview' == $type || $preview == TRUE) && strpos(e_SELF, "viewtopic") === FALSE)
-				{
-					$SUBMITBUTTON = "[".POLLAN_30."]";
-				}
+			  $OPTIONBUTTON = ($pollArray['poll_allow_multiple'] ? "<input type='checkbox' name='votea[]' value='$count' />" : "<input type='radio' name='votea' value='$count' />");
+			  $OPTION = $tp->toHTML($option, TRUE);
+			  if(isset($POLL_NOTVOTED_LOOP_ALT) && $POLL_NOTVOTED_LOOP_ALT && $type != "forum")
+			  { // alternating style
+				$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($alt == 0 ? $POLL_NOTVOTED_LOOP : $POLL_NOTVOTED_LOOP_ALT));
+				$alt = ($alt ==0) ? 1 : 0;
+			  }
+			  else
+			  {
+				$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_LOOP : $POLL_NOTVOTED_LOOP));
+			  }
+			  $count ++;
+			}
+			$SUBMITBUTTON = "<input class='button' type='submit' name='pollvote' value='".POLLAN_30."' />";
+			if(('preview' == $type || $preview == TRUE) && strpos(e_SELF, "viewtopic") === FALSE)
+			{
+			  $SUBMITBUTTON = "[".POLLAN_30."]";
+			}
 
-				$text .= "\n".preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_END : $POLL_NOTVOTED_END))."\n</form>";
+			$text .= "\n".preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_END : $POLL_NOTVOTED_END))."\n</form>";
 			break;
 
-			case "voted":
-
-				if($pollArray['poll_result_type'] && !strstr(e_SELF, "comment.php"))
-				{
-					$text = "<div style='text-align: center;'><br /><br />".POLLAN_39."<br /><br /><a href='".e_BASE."comment.php?comment.poll.".$pollArray['poll_id']."'>".POLLAN_40."</a></div><br /><br />";
-
-				}
-				else
-				{
-
-
-					$text = preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_START : $POLL_VOTED_START));
-					$count = 0;
-					foreach($optionArray as $option)
-					{
-						$OPTION = $tp->toHTML($option, TRUE);
-
-						$BAR = ($percentage[$count] ? "<div style='width: 100%'><div style='background-image: url($barl); width: 5px; height: 14px; float: left;'></div><div style='background-image: url($bar); width: ".(floor($percentage[$count]) != 100 ? floor($percentage[$count]) : 90)."%; height: 14px; float: left;'></div><div style='background-image: url($barr); width: 5px; height: 14px; float: left;'></div></div>" : "");
-
-						$PERCENTAGE = $percentage[$count]."%";
-						$VOTES = POLLAN_31.": ".$voteArray[$count];
-						$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_LOOP : $POLL_VOTED_LOOP));
-						$count ++;
-					}
-				}
-				$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_END : $POLL_VOTED_END));
-
+		  case "voted":
+		  case 'results' :
+			if($pollArray['poll_result_type'] && !strstr(e_SELF, "comment.php"))
+			{
+			  $text = "<div style='text-align: center;'><br /><br />".POLLAN_39."<br /><br /><a href='".e_BASE."comment.php?comment.poll.".$pollArray['poll_id']."'>".POLLAN_40."</a></div><br /><br />";
+			}
+			else
+			{
+			  $text = preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_START : $POLL_VOTED_START));
+			  $count = 0;
+			  foreach($optionArray as $option)
+			  {
+				$OPTION = $tp->toHTML($option, TRUE);
+				$BAR = ($percentage[$count] ? "<div style='width: 100%'><div style='background-image: url($barl); width: 5px; height: 14px; float: left;'></div><div style='background-image: url($bar); width: ".(floor($percentage[$count]) != 100 ? floor($percentage[$count]) : 90)."%; height: 14px; float: left;'></div><div style='background-image: url($barr); width: 5px; height: 14px; float: left;'></div></div>" : "");
+				$PERCENTAGE = $percentage[$count]."%";
+				$VOTES = POLLAN_31.": ".$voteArray[$count];
+				$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_LOOP : $POLL_VOTED_LOOP));
+				$count ++;
+			  }
+			}
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_END : $POLL_VOTED_END));
 			break;
 
-			case "disallowed":
-				$text = preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_START);
-				foreach($optionArray as $option)
-				{
-					$MODE = $mode;		/* debug */
-					$OPTION = $tp->toHTML($option, TRUE);
-					$text .= preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_LOOP);
-					$count ++;
-				}
-				if($pollArray['poll_vote_userclass'] == 253)
-				{
-					$DISALLOWMESSAGE = POLLAN_41;
-				}
-				else if($pollArray['poll_vote_userclass'] == 254)
-				{
-					$DISALLOWMESSAGE = POLLAN_42;
-				}
-				else
-				{
-					$DISALLOWMESSAGE = POLLAN_43;
-				}
-				$text .= preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_END);
+		  case "disallowed":
+			$text = preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_START);
+			foreach($optionArray as $option)
+			{
+			  $MODE = $mode;		/* debug */
+			  $OPTION = $tp->toHTML($option, TRUE);
+			  $text .= preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_LOOP);
+			  $count ++;
+			}
+			if($pollArray['poll_vote_userclass'] == 253)
+			{
+			  $DISALLOWMESSAGE = POLLAN_41;
+			}
+			elseif($pollArray['poll_vote_userclass'] == 254)
+			{
+			  $DISALLOWMESSAGE = POLLAN_42;
+			}
+			else
+			{
+			  $DISALLOWMESSAGE = POLLAN_43;
+			}
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_END);
 			break;
 		}
 
diff -x .svn -aruN 0.7.11.src/e107_plugins/poll/poll_menu.php 0.7.12.src/e107_plugins/poll/poll_menu.php
--- 0.7.11.src/e107_plugins/poll/poll_menu.php	2006-02-18 08:02:17.000000000 -0600
+++ 0.7.12.src/e107_plugins/poll/poll_menu.php	2008-06-03 16:31:19.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/poll/poll_menu.php,v $
-|     $Revision: 1.10 $
-|     $Date: 2006/02/18 14:02:17 $
-|     $Author: mcfly_e107 $
+|     $Revision: 1.11 $
+|     $Date: 2008/06/03 21:31:19 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -41,12 +41,25 @@
 	@include_once(e_PLUGIN."poll/languages/English.php");
 }
 
+if (empty($poll_to_show))
+{
+  $poll_to_show = ' AND p.`poll_vote_userclass`!=255';
+  $pollType = 'menu';
+  $pollMode = 'query';
+}
+else
+{
+  $poll_to_show = ' AND p.`poll_id`='.$poll_to_show;
+  $pollType = 'menu';
+  $pollMode = 'results';
+}
+
 $query = "SELECT p.*, u.user_name FROM #polls AS p 
 LEFT JOIN #user AS u ON p.poll_admin_id = u.user_id
-WHERE p.poll_vote_userclass!=255 AND p.poll_type=1
+WHERE  p.poll_type=1{$poll_to_show}
 ORDER BY p.poll_datestamp DESC LIMIT 0,1
 ";
 
-$poll->render_poll($query, "menu", "query");
+$poll->render_poll($query, $pollType, $pollMode);
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/e107_plugins/rss_menu/rss.php 0.7.12.src/e107_plugins/rss_menu/rss.php
--- 0.7.11.src/e107_plugins/rss_menu/rss.php	2007-05-30 14:25:13.000000000 -0500
+++ 0.7.12.src/e107_plugins/rss_menu/rss.php	2008-08-06 14:10:46.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/rss_menu/rss.php,v $
-|     $Revision: 1.58 $
-|     $Date: 2007/05/30 19:25:13 $
+|     $Revision: 1.60 $
+|     $Date: 2008/08/06 19:10:46 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -401,7 +401,7 @@
 						echo "
 							<item>
 							<title>".$tp->toRss($value['title'])."</title>
-							<description>".$tp->toRss(substr($value['description'],0,150))."</description>
+							<description>".substr($tp->toRss($value['description']),0,150)."</description>
 							<author>".$value['author']."&lt;".$this->nospam($value['author_email'])."&gt;</author>
 							<link>".$link."</link>
 							</item>";
@@ -416,7 +416,6 @@
 				echo "<?xml version=\"1.0\" encoding=\"".CHARSET."\"?>
 				<!-- generator=\"e107\" -->
 				<!-- content type=\"".$this -> contentType."\" -->
-				<!-- test=\"".SITEDISCLAIMER."\" -->
 				<rss {$rss_namespace} version=\"2.0\">
 				<channel>
 				<title>".$tp->toRss($rss_title)."</title>
diff -x .svn -aruN 0.7.11.src/e107_plugins/rss_menu/rss_shortcodes.php 0.7.12.src/e107_plugins/rss_menu/rss_shortcodes.php
--- 0.7.11.src/e107_plugins/rss_menu/rss_shortcodes.php	2007-11-27 15:47:14.000000000 -0600
+++ 0.7.12.src/e107_plugins/rss_menu/rss_shortcodes.php	2008-07-28 15:15:59.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: rss_shortcodes.php,v 1.6 2007/11/27 21:47:14 e107steved Exp $
+// $Id: rss_shortcodes.php,v 1.7 2008/07/28 20:15:59 e107steved Exp $
 if (!defined('e107_INIT')) { exit; }   
 
 include_once(e_HANDLER.'shortcode_handler.php');
@@ -31,10 +31,10 @@
 $url4 = e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".4".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
 
 $text = "
-<a href='".$url1."'><img src='".e_PLUGIN."rss_menu/images/rss1.png' alt='RSS 0.92' /></a>
-<a href='".$url2."'><img src='".e_PLUGIN."rss_menu/images/rss2.png' alt='RSS 2.0' /></a>
-<a href='".$url3."'><img src='".e_PLUGIN."rss_menu/images/rss3.png' alt='RDF' /></a>
-<a href='".$url4."'><img src='".e_PLUGIN."rss_menu/images/rss4.png' alt='ATOM' /></a>
+<a href='".$url1."'><img src='".e_PLUGIN_ABS."rss_menu/images/rss1.png' alt='RSS 0.92' /></a>
+<a href='".$url2."'><img src='".e_PLUGIN_ABS."rss_menu/images/rss2.png' alt='RSS 2.0' /></a>
+<a href='".$url3."'><img src='".e_PLUGIN_ABS."rss_menu/images/rss3.png' alt='RDF' /></a>
+<a href='".$url4."'><img src='".e_PLUGIN_ABS."rss_menu/images/rss4.png' alt='ATOM' /></a>
 ";
 return $text;
 SC_END
@@ -66,7 +66,7 @@
 
 SC_BEGIN RSS_ADMIN_URL
 global $row;
-return "<a href='".e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$row['rss_url']."'>".$row['rss_url']."</a>";
+return "<a href='".e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$row['rss_url']."'>".$row['rss_url']."</a>";
 SC_END
 
 SC_BEGIN RSS_ADMIN_TOPICID
diff -x .svn -aruN 0.7.11.src/e107_plugins/trackback/modtrackback.php 0.7.12.src/e107_plugins/trackback/modtrackback.php
--- 0.7.11.src/e107_plugins/trackback/modtrackback.php	2007-12-07 14:38:21.000000000 -0600
+++ 0.7.12.src/e107_plugins/trackback/modtrackback.php	2008-08-04 15:31:31.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/trackback/modtrackback.php,v $
-|     $Revision: 1.3 $
-|     $Date: 2007/12/07 20:38:21 $
+|     $Revision: 1.4 $
+|     $Date: 2008/08/04 20:31:31 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -24,16 +24,17 @@
 	exit;
 }
 require_once(e_ADMIN."auth.php");
-if (IsSet($_POST['moderate'])) {
-	extract($_POST);
-
-	if (is_array($trackback_delete)) {
-		while (list ($key, $cid) = each ($trackback_delete)) {
-			$sql->db_Delete("trackback", "trackback_id='$cid' ");
-		}
+if (IsSet($_POST['moderate'])) 
+{
+  if (is_array($_POST['trackback_delete'])) 
+  {
+	while (list ($key, $cid) = each ($_POST['trackback_delete'])) 
+	{
+	  $sql->db_Delete("trackback", "trackback_id='".intval($cid)."' ");
 	}
-	$ns->tablerender("", "<div style='text-align:center'><b>".TRACKBACK_L15."</b></div>");
-	$e107cache->clear("news.php");
+  }
+  $ns->tablerender("", "<div style='text-align:center'><b>".TRACKBACK_L15."</b></div>");
+  $e107cache->clear("news.php");
 }
 	
 $text = "<div style='text-align:center'>
diff -x .svn -aruN 0.7.11.src/e107_plugins/tree_menu/tree_menu.php 0.7.12.src/e107_plugins/tree_menu/tree_menu.php
--- 0.7.11.src/e107_plugins/tree_menu/tree_menu.php	2007-05-31 16:17:00.000000000 -0500
+++ 0.7.12.src/e107_plugins/tree_menu/tree_menu.php	2008-03-04 16:14:07.000000000 -0600
@@ -12,8 +12,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/tree_menu/tree_menu.php,v $
-|     $Revision: 1.28 $
-|     $Date: 2007/05/31 21:17:00 $
+|     $Revision: 1.29 $
+|     $Date: 2008/03/04 22:14:07 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -74,7 +74,7 @@
 
 			$mainLinkArray[$link_parent]['sublink'][$link_id]['parent_name'] = $link_parent;
 			$mainLinkArray[$link_parent]['sublink'][$link_id]['id'] = $link_id;
-			$mainLinkArray[$link_parent]['sublink'][$link_id]['name'] = $tp->toHtml(strip_tags($submenu_name));
+			$mainLinkArray[$link_parent]['sublink'][$link_id]['name'] = $tp->toHtml(strip_tags($submenu_name),"","defs");
 			$mainLinkArray[$link_parent]['sublink'][$link_id]['url'] = $link_url;
 			$mainLinkArray[$link_parent]['sublink'][$link_id]['description'] = $links['link_description'];
 			$mainLinkArray[$link_parent]['sublink'][$link_id]['image'] = $link_button;
diff -x .svn -aruN 0.7.11.src/e107_themes/human_condition/theme.php 0.7.12.src/e107_themes/human_condition/theme.php
--- 0.7.11.src/e107_themes/human_condition/theme.php	2005-12-14 13:28:52.000000000 -0600
+++ 0.7.12.src/e107_themes/human_condition/theme.php	2008-07-20 12:08:44.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_themes/human_condition/theme.php,v $
-|     $Revision: 1.12 $
-|     $Date: 2005/12/14 19:28:52 $
-|     $Author: sweetas $
+|     $Revision: 1.13 $
+|     $Date: 2008/07/20 17:08:44 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -157,7 +157,7 @@
 <br />
 {JOINED}
 </span>
-<br/>
+<br />
 {REPLY}
 </td>
 <td style='width:70%; vertical-align:top'>
diff -x .svn -aruN 0.7.11.src/e107_themes/jayya/theme.php 0.7.12.src/e107_themes/jayya/theme.php
--- 0.7.11.src/e107_themes/jayya/theme.php	2007-06-04 14:42:37.000000000 -0500
+++ 0.7.12.src/e107_themes/jayya/theme.php	2008-07-18 14:50:13.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_themes/jayya/theme.php,v $
-|     $Revision: 1.57 $
-|     $Date: 2007/06/04 19:42:37 $
-|     $Author: e107steved $
+|     $Revision: 1.58 $
+|     $Date: 2008/07/18 19:50:13 $
+|     $Author: e107coders $
 +----------------------------------------------------------------------------+
 */
 
@@ -22,8 +22,7 @@
 
 
 // Get language definition files for this theme
-@include_once(e_THEME."jayya/languages/".e_LANGUAGE.".php");
-@include_once(e_THEME."jayya/languages/English.php");
+include_lan(e_THEME."jayya/languages/".e_LANGUAGE.".php");
 
 
 // [theme]
diff -x .svn -aruN 0.7.11.src/e107_themes/khatru/theme.php 0.7.12.src/e107_themes/khatru/theme.php
--- 0.7.11.src/e107_themes/khatru/theme.php	2007-06-04 14:42:37.000000000 -0500
+++ 0.7.12.src/e107_themes/khatru/theme.php	2008-07-20 12:08:44.000000000 -0500
@@ -121,7 +121,7 @@
 	<div id='footer'>
 		{SITEDISCLAIMER}<br />{THEME_DISCLAIMER}
 		<br />
-		<a href='http://www.spreadfirefox.com/?q=affiliates&amp;id=0&amp;t=86'><img alt='e107 recommends Firefox' title='e107 recommends Firefox' src=' http://sfx-images.mozilla.org/affiliates/Buttons/125x50/takebacktheweb_125x50.png' style='border: 0;' /></a>
+		<a href='http://www.spreadfirefox.com/?q=affiliates&amp;id=0&amp;t=86'><img alt='e107 recommends Firefox' title='e107 recommends Firefox' src='http://sfx-images.mozilla.org/affiliates/Buttons/125x50/takebacktheweb_125x50.png' style='border: 0;' /></a>
 	</div>
 </div>
 ";
@@ -223,7 +223,7 @@
 <br />
 {JOINED}
 </span>
-<br/>
+<br />
 {REPLY}
 </td>
 <td style='width:70%; vertical-align:top'>
diff -x .svn -aruN 0.7.11.src/e107_themes/lamb/forum_viewtopic_template.php 0.7.12.src/e107_themes/lamb/forum_viewtopic_template.php
--- 0.7.11.src/e107_themes/lamb/forum_viewtopic_template.php	2007-07-27 14:08:33.000000000 -0500
+++ 0.7.12.src/e107_themes/lamb/forum_viewtopic_template.php	2008-05-26 11:05:17.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_themes/lamb/forum_viewtopic_template.php,v $
-|     $Revision: 1.14 $
-|     $Date: 2007/07/27 19:08:33 $
+|     $Revision: 1.15 $
+|     $Date: 2008/05/26 16:05:17 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -70,7 +70,9 @@
 </td>
 </tr>	
 <tr>
-<td class='nforumthread' style='vertical-align:top'>\n{AVATAR}\n<span class='smalltext'>\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{POSTS}\n</span>\n</td>
+<td class='nforumthread' style='vertical-align:top'>\n
+	{CUSTOMTITLE}
+{AVATAR}\n<span class='smalltext'>\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{POSTS}\n</span>\n</td>
 <td class='nforumthread' style='vertical-align:top'>{POLL}\n{POST}\n{LASTEDIT}\n{SIGNATURE}\n</td>
 </tr>		
 <tr>
diff -x .svn -aruN 0.7.11.src/e107_themes/templates/banner_template.php 0.7.12.src/e107_themes/templates/banner_template.php
--- 0.7.11.src/e107_themes/templates/banner_template.php	2007-12-06 15:36:02.000000000 -0600
+++ 0.7.12.src/e107_themes/templates/banner_template.php	2008-05-03 14:40:15.000000000 -0500
@@ -1,10 +1,11 @@
 <?php
-// $Id: banner_template.php,v 1.6 2007/12/06 21:36:02 e107steved Exp $
+// $Id: banner_template.php,v 1.7 2008/05/03 19:40:15 e107steved Exp $
 
 if (!defined('e107_INIT')) { exit; }
 if (!defined("USER_WIDTH")){ define("USER_WIDTH","width:98%"); }
 
 // ##### LOGIN TABLE -------------------------------------------------------------------------------
+global $BANNER_LOGIN_TABLE;
 if(!isset($BANNER_LOGIN_TABLE))
 {
 		$BANNER_LOGIN_TABLE = "
diff -x .svn -aruN 0.7.11.src/e107_themes/templates/email_template.php 0.7.12.src/e107_themes/templates/email_template.php
--- 0.7.11.src/e107_themes/templates/email_template.php	2007-11-11 15:52:49.000000000 -0600
+++ 0.7.12.src/e107_themes/templates/email_template.php	2008-07-17 14:24:51.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/email_template.php,v $
-|     $Revision: 1.10 $
-|     $Date: 2007/11/11 21:52:49 $
+|     $Revision: 1.11 $
+|     $Date: 2008/07/17 19:24:51 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -55,13 +55,13 @@
 ".LAN_EMAIL_01." {USERNAME},<br />
 <br />".
 LAN_403." {SITENAME}<br />
-".LAN_SIGNUP_21." ...<br />
+".LAN_SIGNUP_21.":<br />
 <br />
 {ACTIVATION_LINK}<br />
 <br />
 ".LAN_SIGNUP_59."<br />
 <br />
-".LAN_SIGNUP_18."...<br />
+".LAN_SIGNUP_18.":<br />
 <br />
 ".LAN_LOGINNAME.": <b> {LOGINNAME} </b><br />
 ".LAN_PASSWORD.": <b> {PASSWORD} </b><br />
diff -x .svn -aruN 0.7.11.src/e107_themes/templates/signup_template.php 0.7.12.src/e107_themes/templates/signup_template.php
--- 0.7.11.src/e107_themes/templates/signup_template.php	2007-12-03 15:03:14.000000000 -0600
+++ 0.7.12.src/e107_themes/templates/signup_template.php	2008-07-30 15:14:02.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/signup_template.php,v $
-|     $Revision: 1.13 $
-|     $Date: 2007/12/03 21:03:14 $
+|     $Revision: 1.14 $
+|     $Date: 2008/07/30 20:14:02 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -23,6 +23,15 @@
 
 define("REQUIRED_FIELD_MARKER", "<span style='text-align:right;font-size:15px; color:red'> *</span>");
 
+// Given an email address, returns a link including js-based obfuscation
+function js_obfuscate($email)
+{
+  list($name,$address) = explode('@',$email,2);
+  $reassembled = '"'.$name.'"+"@"+"'.$address.'"';
+  return "<a rel='external' href='javascript:window.location=\"mai\"+\"lto:\"+".$reassembled.";self.close();' onmouseover='window.status=\"mai\"+\"lto:".$reassembled."; return true;' onmouseout='window.status=\"\";return true;'>";
+}
+
+
 $sc_style['SIGNUP_DISPLAYNAME']['pre'] = "
 <tr>
 <td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_7."<span style='font-size:15px; color:red'> *</span><br /><span class='smalltext'>".LAN_8."</span></td>
@@ -156,7 +165,7 @@
 
 if(!isset($COPPA_TEMPLATE))
 {
-$COPPA_TEMPLATE = LAN_109." <a href='http://www.cdt.org/legislation/105th/privacy/coppa.html'>".LAN_SIGNUP_14."</a>. ".LAN_SIGNUP_15." <a href='mailto:".SITEADMINEMAIL."'>".LAN_SIGNUP_14."</a> ".LAN_SIGNUP_16."
+$COPPA_TEMPLATE = LAN_109." <a href='http://www.cdt.org/legislation/105th/privacy/coppa.html'>".LAN_SIGNUP_14."</a>. ".LAN_SIGNUP_15." ".js_obfuscate(SITEADMINEMAIL).LAN_SIGNUP_14."</a> ".LAN_SIGNUP_16."
 <br />
 <br />
 <div style='text-align:center'><b>".LAN_SIGNUP_17."</b>
diff -x .svn -aruN 0.7.11.src/error.php 0.7.12.src/error.php
--- 0.7.11.src/error.php	2007-10-05 00:46:44.000000000 -0500
+++ 0.7.12.src/error.php	2008-07-25 15:12:44.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/error.php,v $
-|     $Revision: 1.15 $
-|     $Date: 2007/10/05 05:46:44 $
-|     $Author: e107coders $
+|     $Revision: 1.16 $
+|     $Date: 2008/07/25 20:12:44 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -21,56 +21,76 @@
 
 require_once("class2.php");
 
-if(!e_QUERY || (e_QUERY != 401 && e_QUERY != 403 && e_QUERY != 404 && e_QUERY != 500))
-{
-	echo "<script type='text/javascript'>document.location.href='{$base_path}index.php'</script>\n";
-	header("location: ".e_HTTP."index.php");
-	exit;
-}
-
-require_once(HEADERF);
-
+if (!defined('PAGE_NAME')) define('PAGE_NAME','Unknown page');
+$errorHeader = '';
+$errorText = '';
+$errorNumber = 999;
 $errFrom = $_SERVER['HTTP_REFERER'];
 $errTo = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
+$errorQuery = htmlentities($_SERVER['QUERY_STRING']);
 $base_path = e_HTTP;
+if (is_numeric(e_QUERY)) $errorNumber = e_QUERY;
 
-switch(e_QUERY) {
-	case 401:
+switch($errorNumber) 
+{
+  case 400 :
+	$errorHeader = "HTTP/1.1 400 Bad Request";
+	$errorText = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_35."</div><br /><div class='installh'>".LAN_ERROR_36."</div><br /><div class='smalltext'>".LAN_ERROR_3."</div>
+		<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
+	break;
+  case 401:
 	header("HTTP/1.1 401 Unauthorized");
-	$text = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='Error Icon'> ".LAN_ERROR_1."</div><br /><div class='installh'>".LAN_ERROR_2."</div><br /><div class='smalltext'>".LAN_ERROR_3."</div>
+	$errorText = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_1."</div><br /><div class='installh'>".LAN_ERROR_2."</div><br /><div class='smalltext'>".LAN_ERROR_3."</div>
 		<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
 	break;
-	case 403:
+  case 403:
 	header("HTTP/1.1 403 Forbidden");
-	$text = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='Error Icon'> ".LAN_ERROR_4."</div><br /><div class='installh'>".LAN_ERROR_5."</div><br /><div class='smalltext'>".LAN_ERROR_6."</div>
+	$errorText = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_4."</div><br /><div class='installh'>".LAN_ERROR_5."</div><br /><div class='smalltext'>".LAN_ERROR_6."</div>
 		<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
 	break;
-
-	case 404:
+  case 404:
 	header("HTTP/1.1 404 Not Found");
-	$text = "<h3><img src='".e_IMAGE_ABS."icons/icon3.png' alt='Error Icon'> ".LAN_ERROR_7."</h3><br />".LAN_ERROR_21."<br /><br />".LAN_ERROR_23."<b>{$errTo}</b>".LAN_ERROR_24."<br /><br />";
+	$errorText = "<h3><img src='".e_IMAGE_ABS."icons/icon3.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_7."</h3><br />".LAN_ERROR_21."<br /><br />".LAN_ERROR_23."<b>{$errTo}</b>".LAN_ERROR_24."<br /><br />";
 
 	if (strlen($errFrom)) $text .= LAN_ERROR_9." ( <a href='{$errFrom}' rel='external'>{$errFrom}</a> ) -- ".LAN_ERROR_19."<br />";
 
 
-	$text .= "<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a><br />";
-	$text .= "<a href='{$base_path}search.php'>".LAN_ERROR_22."</a></p>";
+	$errorText .= "<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a><br />";
+	$errorText .= "<a href='{$base_path}search.php'>".LAN_ERROR_22."</a>";
 	break;
-
-
-	case 500:
+  case 500:
 	header("HTTP/1.1 500 Internal Server Error");
-	$text = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='Error Icon'> ".LAN_ERROR_10."</div><br /><div class='installh'>".LAN_ERROR_11."</div><br /><div class='smalltext'>".LAN_ERROR_12."</div>
+	$errorText = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_10."</div><br /><div class='installh'>".LAN_ERROR_11."</div><br /><div class='smalltext'>".LAN_ERROR_12."</div>
 		<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
 	break;
-	$text = "<div class='installe'>".LAN_ERROR_13." (".$_SERVER['QUERY_STRING'].")</div><br /><div class='installh'>".LAN_ERROR_14."</div><br /><div class='smalltext'>".LAN_ERROR_15."</div>
-		<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
-
-	default:
-	$text = LAN_ERROR_34." e_QUERY = '".e_QUERY."'<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a>";
+  case 999:
+	if (E107_DEBUG_LEVEL)
+	{
+	  echo LAN_ERROR_33."<br/><pre>\n";
+	  print_r($_SERVER);
+	  print_r($_REQUEST);
+	  echo "\n</pre>\n";
+	}
+	else
+	{
+	  echo "<script type='text/javascript'>document.location.href='index.php'</script>\n";
+	  header("location: ".e_HTTP."index.php");
+	  exit;
+	}
 	break;
+  default :
+	$errorText = "<div class='installe'>".LAN_ERROR_13." (".$errorQuery.")</div><br /><div class='installh'>".LAN_ERROR_14."</div><br /><div class='smalltext'>".LAN_ERROR_15."</div>
+		<br /><div class='installh'><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
+/*
+  default:
+	$errorText = LAN_ERROR_34." e_QUERY = '".e_QUERY."'<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a>";
+	break; */
 }
 
-$ns->tablerender(PAGE_NAME, $text);
+if ($errorHeader) header($errorHeader);
+
+require_once(HEADERF);
+
+$ns->tablerender(PAGE_NAME, $errorText);
 require_once(FOOTERF);
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.11.src/install.php 0.7.12.src/install.php
--- 0.7.11.src/install.php	2007-03-05 15:13:17.000000000 -0600
+++ 0.7.12.src/install.php	2008-07-09 16:38:14.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/install_.php,v $
-|     $Revision: 1.61 $
-|     $Date: 2007/03/05 21:13:17 $
+|     $Revision: 1.65 $
+|     $Date: 2008/07/09 21:38:14 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -260,20 +260,25 @@
 		$this->template->SetTag("stage_content", $page_info.$e_forms->return_form());
 	}
 
-	function stage_3(){
+
+	function stage_3()
+	{
 		global $e_forms;
+		$success = true;
 		$this->stage = 3;
 		$this->get_lan_file();
 		$this->template->SetTag("installation_heading", LANINS_001);
 		$this->template->SetTag("stage_pre", LANINS_002);
 		$this->template->SetTag("stage_num", LANINS_036);
-		$this->previous_steps['mysql']['server'] = $_POST['server'];
-		$this->previous_steps['mysql']['user'] = $_POST['name'];
+		$this->previous_steps['mysql']['server'] = trim($_POST['server']);
+		$this->previous_steps['mysql']['user'] = trim($_POST['name']);
 		$this->previous_steps['mysql']['password'] = $_POST['password'];
-		$this->previous_steps['mysql']['db'] = $_POST['db'];
+		$this->previous_steps['mysql']['db'] = trim($_POST['db']);
 		$this->previous_steps['mysql']['createdb'] = (isset($_POST['createdb']) && $_POST['createdb'] == true ? true : false);
-		$this->previous_steps['mysql']['prefix'] = $_POST['prefix'];
-		if($this->previous_steps['mysql']['server'] == "" || $this->previous_steps['mysql']['user'] == "" | $this->previous_steps['mysql']['db'] == "") {
+		$this->previous_steps['mysql']['prefix'] = trim($_POST['prefix']);
+		$success = $this->check_name($this->previous_steps['mysql']['db'],FALSE) && $this->check_name($this->previous_steps['mysql']['prefix'],TRUE);
+		if(!$success || $this->previous_steps['mysql']['server'] == "" || $this->previous_steps['mysql']['user'] == "") 
+		{
 			$this->stage = 3;
 			$this->template->SetTag("stage_num", LANINS_021);
 			$e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : ""));
@@ -307,42 +312,57 @@
 			      <td class='row-border'><label for='prefix'>".LANINS_029."</label></td>
 			      <td class='row-border'><input type='text' name='prefix' id='prefix' size='20' value='{$this->previous_steps['mysql']['prefix']}'  maxlength='100' /></td>
 				  <td class='row-border'>".LANINS_034."</td>
-			    </tr>
+			    </tr>";
+			if (!$success)
+			{
+			  $output .= "<tr><td class='row-border' colspan='3'>".LANINS_105."</td></tr>";
+			}
+			$output .= "
 			  </table>
 			</div>
 			<br /><br />\n";
 			$e_forms->add_plain_html($output);
 			$e_forms->add_button("submit", LANINS_035);
 			$this->template->SetTag("stage_title", LANINS_040);
-		} else {
-			$success = true;
-			$this->template->SetTag("stage_title", LANINS_037.($this->previous_steps['mysql']['createdb'] == 1 ? LANINS_038 : ""));
-			if (!@mysql_connect($this->previous_steps['mysql']['server'], $this->previous_steps['mysql']['user'], $this->previous_steps['mysql']['password'])) {
+		} 
+		else 
+		{
+		  $this->template->SetTag("stage_title", LANINS_037.($this->previous_steps['mysql']['createdb'] == 1 ? LANINS_038 : ""));
+		  if (!@mysql_connect($this->previous_steps['mysql']['server'], $this->previous_steps['mysql']['user'], $this->previous_steps['mysql']['password'])) 
+		  {
+			$success = false;
+			$page_content = LANINS_041.nl2br("\n\n<b>".LANINS_083."\n</b><i>".mysql_error()."</i>");
+		  } 
+		  else 
+		  {
+			$page_content = LANINS_042;
+			if($this->previous_steps['mysql']['createdb'] == 1) 
+			{
+			  if (!mysql_query("CREATE DATABASE ".$this->previous_steps['mysql']['db'])) 
+			  {
 				$success = false;
-				$page_content = LANINS_041.nl2br("\n\n<b>".LANINS_083."\n</b><i>".mysql_error()."</i>");
-			} else {
-				$page_content = LANINS_042;
-				if($this->previous_steps['mysql']['createdb'] == 1) {
-					if (!mysql_query("CREATE DATABASE ".$this->previous_steps['mysql']['db'])) {
-						$success = false;
-						$page_content .= "<br /><br />".LANINS_043.nl2br("\n\n<b>".LANINS_083."\n</b><i>".mysql_error()."</i>");
-					} else {
-						$page_content .= "<br /><br />".LANINS_044;
-					}
-				}
+				$page_content .= "<br /><br />".LANINS_043.nl2br("\n\n<b>".LANINS_083."\n</b><i>".mysql_error()."</i>");
+			  } 
+			  else 
+			  {
+				$page_content .= "<br /><br />".LANINS_044;
+			  }
 			}
-			if($success){
-				$e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : ""));
-				$page_content .= "<br /><br />".LANINS_045."<br /><br />";
-				$e_forms->add_button("submit", LANINS_035);
-			}
-			$head = $page_content;
+		  }
+		  if($success)
+		  {
+			$e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : ""));
+			$page_content .= "<br /><br />".LANINS_045."<br /><br />";
+			$e_forms->add_button("submit", LANINS_035);
+		  }
+		  $head = $page_content;
 		}
-		$this->finish_form();
+		if ($success) $this->finish_form(); else $this->finish_form(3);
 		$this->template->SetTag("stage_content", $head.$e_forms->return_form());
 	}
 
-	function stage_4(){
+	function stage_4()
+	{
 		global $e_forms;
 		$this->stage = 4;
 		$this->get_lan_file();
@@ -350,35 +370,57 @@
 		$this->template->SetTag("stage_pre", LANINS_002);
 		$this->template->SetTag("stage_num", LANINS_007);
 		$this->template->SetTag("stage_title", LANINS_008);
-		$not_writable = $this->check_writable_perms();
+		$not_writable = $this->check_writable_perms('must_write');		// Some directories MUST be writable
+		$opt_writable = $this->check_writable_perms('can_write');		// Some directories CAN optionally be writable
 		$version_fail = false;
 		$perms_errors = "";
-		if(count($not_writable)) {
-			$perms_pass = false;
-			foreach ($not_writable as $file) {
-				$perms_errors .= (substr($file, -1) == "/" ? LANINS_010a : LANINS_010)."...<br /><b>{$file}</b><br />\n";
-			}
-			$perms_notes = LANINS_018;
-		} else {
-			$perms_pass = true;
-			$perms_errors = "&nbsp;";
-			$perms_notes = LANINS_017;
+		if(count($not_writable)) 
+		{
+		  $perms_pass = false;
+		  foreach ($not_writable as $file) 
+		  {
+			$perms_errors .= (substr($file, -1) == "/" ? LANINS_010a : LANINS_010)."...<br /><b>{$file}</b><br />\n";
+		  }
+		  $perms_notes = LANINS_018;
+		} 
+		elseif (count($opt_writable))
+		{
+		  $perms_pass = true;
+		  foreach ($opt_writable as $file) 
+		  {
+			$perms_errors .= (substr($file, -1) == "/" ? LANINS_010a : LANINS_010)."...<br /><b>{$file}</b><br />\n";
+		  }
+		  $perms_notes = LANINS_106;
+		}
+		else
+		{
+		  $perms_pass = true;
+		  $perms_errors = "&nbsp;";
+		  $perms_notes = LANINS_017;
 		}
-		if(!function_exists("mysql_connect")) {
+
+		if(!function_exists("mysql_connect")) 
+		{
 			$version_fail = true;
 			$mysql_note = LANINS_011;
 			$mysql_help = LANINS_012;
-		} elseif (!@mysql_connect($this->previous_steps['mysql']['server'], $this->previous_steps['mysql']['user'], $this->previous_steps['mysql']['password'])) {
+		} elseif (!@mysql_connect($this->previous_steps['mysql']['server'], $this->previous_steps['mysql']['user'], $this->previous_steps['mysql']['password'])) 
+		{
 			$mysql_note = LANINS_011;
 			$mysql_help = LANINS_013;
-		} else {
+		} 
+		else 
+		{
 			$mysql_note = mysql_get_server_info();
 			$mysql_help = LANINS_017;
 		}
-		if(!function_exists("utf8_encode")) {
-			$xml_installed = false;
-		} else {
-			$xml_installed = true;
+		if(!function_exists("utf8_encode")) 
+		{
+		  $xml_installed = false;
+		} 
+		else 
+		{
+		  $xml_installed = true;
 		}
 
 		$php_version = phpversion();
@@ -585,6 +627,18 @@
 		$this->template->SetTag("stage_content", $page.$e_forms->return_form());
 	}
 
+
+	// Check a DB name or table prefix - anything starting with a numeric followed by 'e' causes problems.
+	// Return TRUE if acceptable, FALSE if unacceptable
+	// Empty string returns the value of $blank_ok (caller should set TRUE for prefix, FALSE for DB name)
+	function check_name($str,$blank_ok = FALSE)
+	{
+	  if ($str == '') return $blank_ok;
+	  if (preg_match("#^\d+[e|E]#",$str)) return FALSE;
+	  return TRUE;
+	}
+
+
 	function get_lan_file(){
 		if(!isset($this->previous_steps['language'])) {
 			$this->previous_steps['language'] = "English";
@@ -620,19 +674,25 @@
 		$e_forms->add_hidden_data("stage", ($force_stage ? $force_stage : ($this->stage + 1)));
 	}
 
-	function check_writable_perms(){
+	function check_writable_perms($list = 'must_write')
+	{
 		$bad_files = array();
-		$data = 'e107_config.php|{$FILES_DIRECTORY}cache/|{$FILES_DIRECTORY}public/|{$FILES_DIRECTORY}public/avatars/|{$PLUGINS_DIRECTORY}|{$THEMES_DIRECTORY}';
-		foreach ($this->e107->e107_dirs as $dir_name => $value) {
-			$find[] = "{\${$dir_name}}";
-			$replace[] = "./$value";
-		}
-		$data = str_replace($find, $replace, $data);
-		$files = explode("|", trim($data));
-		foreach ($files as $file) {
-			if(!is_writable($file)) {
-				$bad_files[] = str_replace("./", "", $file);
-			}
+		$data['must_write'] = 'e107_config.php';
+		$data['can_write'] = '{$FILES_DIRECTORY}cache/|{$FILES_DIRECTORY}public/|{$FILES_DIRECTORY}public/avatars/|{$PLUGINS_DIRECTORY}|{$THEMES_DIRECTORY}';
+		if (!isset($data[$list])) return $bad_files;
+		foreach ($this->e107->e107_dirs as $dir_name => $value) 
+		{
+		  $find[] = "{\${$dir_name}}";
+		  $replace[] = "./$value";
+		}
+		$data[$list] = str_replace($find, $replace, $data[$list]);
+		$files = explode("|", trim($data[$list]));
+		foreach ($files as $file) 
+		{
+		  if(!is_writable($file)) 
+		  {
+			$bad_files[] = str_replace("./", "", $file);
+		  }
 		}
 		return $bad_files;
 	}
@@ -746,7 +806,7 @@
 		}
 		mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}core VALUES ('search_prefs', '{$search_prefs}') ");
 
-		$notify_prefs = mysql_escape_string("array ('event' => array ('usersup' => array ('type' => 'off', 'class' => '254', 'email' => '',),'userveri' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'login' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'logout' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'flood' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'subnews' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'newspost' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'newsupd' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'newsdel' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), ), )");
+		$notify_prefs = mysql_real_escape_string("array ('event' => array ('usersup' => array ('type' => 'off', 'class' => '254', 'email' => '',),'userveri' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'login' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'logout' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'flood' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'subnews' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'newspost' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'newsupd' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), 'newsdel' => array ( 'type' => 'off', 'class' => '254', 'email' => '', ), ), )");
 		mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}core VALUES ('notify_prefs', '{$notify_prefs}') ");
 
 		mysql_query("INSERT INTO {$this->previous_steps['mysql']['prefix']}banner VALUES (0, 'e107', 'e107login', 'e107password', 'banner1.png', 'http://e107.org', 0, 0, 0, 0, 0, 0, '', 'campaign_one') ");
diff -x .svn -aruN 0.7.11.src/login.php 0.7.12.src/login.php
--- 0.7.11.src/login.php	2007-03-05 15:35:01.000000000 -0600
+++ 0.7.12.src/login.php	2008-08-20 07:34:50.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/login.php,v $
-|     $Revision: 1.12 $
-|     $Date: 2007/03/05 21:35:01 $
-|     $Author: e107steved $
+|     $Revision: 1.13 $
+|     $Date: 2008/08/20 12:34:50 $
+|     $Author: mcfly_e107 $
 +----------------------------------------------------------------------------+
 */
 
@@ -45,6 +45,7 @@
 	$LOGIN_TABLE_AUTOLOGIN_LAN = LAN_LOGIN_8;
 	$LOGIN_TABLE_SUBMIT = "<input class='button' type='submit' name='userlogin' value=\"".LAN_LOGIN_9."\" />";
 
+	$login_message = LAN_LOGIN_3." | ".SITENAME;
 	if (!$LOGIN_TABLE)
 	{
 		if (file_exists(THEME."login_template.php"))
@@ -59,7 +60,6 @@
 	$text = preg_replace("/\{(.*?)\}/e", 'varset($\1,"\1")', $LOGIN_TABLE);
 	echo preg_replace("/\{(.*?)\}/e", 'varset($\1,"\1")', $LOGIN_TABLE_HEADER);
 
-	$login_message = LAN_LOGIN_3." | ".SITENAME;
 	$ns->tablerender($login_message, $text, 'login_page');
 
 	$LOGIN_TABLE_FOOTER_USERREG = '&nbsp;';		// In case no registration system enabled
diff -x .svn -aruN 0.7.11.src/online.php 0.7.12.src/online.php
--- 0.7.11.src/online.php	2007-10-08 15:15:23.000000000 -0500
+++ 0.7.12.src/online.php	2008-08-01 14:23:38.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/online.php,v $
-|     $Revision: 1.16 $
-|     $Date: 2007/10/08 20:15:23 $
+|     $Revision: 1.17 $
+|     $Date: 2008/08/01 19:23:38 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -261,7 +261,7 @@
 $ONLINE_TABLE_MOST_GUESTS_ONLINE = strtolower(ONLINE_EL1).$menu_pref['most_guests_online'];
 $ONLINE_TABLE_DATESTAMP = $datestamp;
 	
-$total_members = $sql->db_Count("user");
+$total_members = $sql->db_Count("user","(*)","where user_ban = 0");
 	
 if ($total_members > 1)
 {
diff -x .svn -aruN 0.7.11.src/page.php 0.7.12.src/page.php
--- 0.7.11.src/page.php	2007-12-19 15:38:22.000000000 -0600
+++ 0.7.12.src/page.php	2008-04-07 15:18:25.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/page.php,v $
-|     $Revision: 1.47 $
-|     $Date: 2007/12/19 21:38:22 $
-|     $Author: mcfly_e107 $
+|     $Revision: 1.48 $
+|     $Date: 2008/04/07 20:18:25 $
+|     $Author: secretr $
 |
 +----------------------------------------------------------------------------+
 */
@@ -48,32 +48,32 @@
 	}
 	else
 	{
-		$tmp = $page -> showPage();
-		define("e_PAGETITLE", $tmp['title']);
+		$e107_core_custom_pages = $page -> showPage();
+		define("e_PAGETITLE", $e107_core_custom_pages['title']);
 		require_once(HEADERF);
-		if ($tmp['err'])        // Need to display error block after header defined
+		if ($e107_core_custom_pages['err'])        // Need to display error block after header defined
 		{
-			$ns -> tablerender($tmp['title'], $tmp['text'],"cpage");
+			$ns -> tablerender($e107_core_custom_pages['title'], $e107_core_custom_pages['text'],"cpage");
 			require_once(FOOTERF);
 			exit;
 		}
-		if ($tmp['cachecontrol'] == TRUE)
+		if ($e107_core_custom_pages['cachecontrol'] == TRUE)
 		{
 			ob_start();
-			$ns -> tablerender($tmp['title'], $tmp['text']);
+			$ns -> tablerender($e107_core_custom_pages['title'], $e107_core_custom_pages['text']);
 			$cache_data = ob_get_flush();
 			$e107cache->set($cacheString, $cache_data);
-			$e107cache->set($cachePageTitle, $tmp['title']."^".$tmp['comment_flag']);
-			$comment_flag = $tmp['comment_flag'];
+			$e107cache->set($cachePageTitle, $e107_core_custom_pages['title']."^".$e107_core_custom_pages['comment_flag']);
+			$comment_flag = $e107_core_custom_pages['comment_flag'];
 		}
 		else
 		{
-			$ns -> tablerender($tmp['title'], $tmp['text'],"cpage");
-			$comment_flag = $tmp['comment_flag'];
+			$ns -> tablerender($e107_core_custom_pages['title'], $e107_core_custom_pages['text'],"cpage");
+			$comment_flag = $e107_core_custom_pages['comment_flag'];
 		}
 	}
 
-	$page -> title = $tmp['title'];
+	$page -> title = $e107_core_custom_pages['title'];
 	if($com = $page -> pageComment($comment_flag))
 	{
 		echo $com['comment'].$com['comment_form'];
diff -x .svn -aruN 0.7.11.src/request.php 0.7.12.src/request.php
--- 0.7.11.src/request.php	2007-10-28 17:19:22.000000000 -0500
+++ 0.7.12.src/request.php	2008-07-04 15:23:11.000000000 -0500
@@ -12,8 +12,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/request.php,v $
-|     $Revision: 1.43 $
-|     $Date: 2007/10/28 22:19:22 $
+|     $Revision: 1.44 $
+|     $Date: 2008/07/04 20:23:11 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -112,9 +112,19 @@
 if ($type == "file")
 {
 	$qry = "SELECT d.*, dc.download_category_class FROM #download as d LEFT JOIN #download_category AS dc ON dc.download_category_id = d.download_category WHERE d.download_id = {$id}";
-	if ($sql->db_Select_gen($qry)) {
-		$row = $sql->db_Fetch();
-		if (check_class($row['download_category_class']) && check_class($row['download_class'])) {
+	if ($sql->db_Select_gen($qry)) 
+	{
+	  $row = $sql->db_Fetch();
+	  if (check_class($row['download_category_class']) && check_class($row['download_class'])) 
+	  {
+		if ($row['download_active'] == 0)
+		{  // Inactive download - don't allow
+		  require_once(HEADERF);
+		  $ns -> tablerender(LAN_dl_61, "<div style='text-align:center'>".str_replace('--LINK--',"<a href='".e_HTTP.'download.php'."'>",LAN_dl_78).'</div>');
+		  require_once(FOOTERF);
+		  exit();
+		}
+
 			if($pref['download_limits'] && $row['download_active'] == 1) {
 				check_download_limits();
 			}
diff -x .svn -aruN 0.7.11.src/search.php 0.7.12.src/search.php
--- 0.7.11.src/search.php	2007-07-03 14:25:37.000000000 -0500
+++ 0.7.12.src/search.php	2008-03-27 16:14:30.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/search.php,v $
-|     $Revision: 1.60 $
-|     $Date: 2007/07/03 19:25:37 $
+|     $Revision: 1.61 $
+|     $Date: 2008/03/27 21:14:30 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -272,46 +272,6 @@
 	}
 }
 
-// standard search config
-if ($search_prefs['selector'] == 2) {
-	$SEARCH_DROPDOWN = "<select name='t' id='t' class='tbox' onchange=\"ab()\">";
-	if ($search_prefs['multisearch']) {
-		$SEARCH_DROPDOWN .= "<option value='all'>".LAN_SEARCH_22."</option>";
-	}
-} else {
-	$SEARCH_MAIN_CHECKBOXES = '';
-}
-
-foreach($search_info as $key => $value) {
-	if ($search_prefs['selector'] == 2) {
-		$sel = (isset($searchtype[$key]) && $searchtype[$key]) ? " selected='selected'" : "";
-	} else {
-		$sel = (isset($searchtype[$key]) && $searchtype[$key]) ? " checked='checked'" : "";
-	}
-	$google_js = check_class($search_prefs['google']) ? "onclick=\"uncheckG();\" " : "";
-	if ($search_prefs['selector'] == 2) {
-		$SEARCH_DROPDOWN .= "<option value='".$key."' ".$sel.">".$value['qtype']."</option>";
-	} else if ($search_prefs['selector'] == 1) {
-		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input ".$google_js." type='checkbox' name='t[".$key."]' ".$sel." />".$value['qtype'].$POST_CHECKBOXES;
-	} else {
-		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input type='radio' name='t' value='".$key."' ".$sel." />".$value['qtype'].$POST_CHECKBOXES;
-	}
-}
-
-if (check_class($search_prefs['google'])) {
-	if ($search_prefs['selector'] == 2) {
-		$SEARCH_DROPDOWN .= "<option value='".$google_id."'>Google</option>";
-	} else if ($search_prefs['selector'] == 1) {
-		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input id='google' type='checkbox' name='t[".$google_id."]' onclick='uncheckAll(this)' />Google".$POST_CHECKBOXES;
-	} else {
-		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input id='google' type='radio' name='t' value='".$google_id."' />Google".$POST_CHECKBOXES;
-	}
-}
-
-if ($search_prefs['selector'] == 2) {
-	$SEARCH_DROPDOWN .= "</select>";
-}
-
 $value = isset($_GET['q']) ? $tp -> post_toForm($_GET['q']) : "";
 $SEARCH_MAIN_SEARCHFIELD = "<input class='tbox m_search' type='text' id='q' name='q' size='35' value='".$value."' maxlength='50' />";
 if ($search_prefs['selector'] == 1) {
@@ -395,6 +355,49 @@
 	}
 }
 
+
+// standard search config
+if ($search_prefs['selector'] == 2) {
+	$SEARCH_DROPDOWN = "<select name='t' id='t' class='tbox' onchange=\"ab()\">";
+	if ($search_prefs['multisearch']) {
+		$SEARCH_DROPDOWN .= "<option value='all'>".LAN_SEARCH_22."</option>";
+	}
+} else {
+	$SEARCH_MAIN_CHECKBOXES = '';
+}
+
+foreach($search_info as $key => $value) {
+	if ($search_prefs['selector'] == 2) {
+		$sel = (isset($searchtype[$key]) && $searchtype[$key]) ? " selected='selected'" : "";
+	} else {
+		$sel = (isset($searchtype[$key]) && $searchtype[$key]) ? " checked='checked'" : "";
+	}
+	$google_js = check_class($search_prefs['google']) ? "onclick=\"uncheckG();\" " : "";
+	if ($search_prefs['selector'] == 2) {
+		$SEARCH_DROPDOWN .= "<option value='".$key."' ".$sel.">".$value['qtype']."</option>";
+	} else if ($search_prefs['selector'] == 1) {
+		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input ".$google_js." type='checkbox' name='t[".$key."]' ".$sel." />".$value['qtype'].$POST_CHECKBOXES;
+	} else {
+		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input type='radio' name='t' value='".$key."' ".$sel." />".$value['qtype'].$POST_CHECKBOXES;
+	}
+}
+
+if (check_class($search_prefs['google'])) {
+	if ($search_prefs['selector'] == 2) {
+		$SEARCH_DROPDOWN .= "<option value='".$google_id."'>Google</option>";
+	} else if ($search_prefs['selector'] == 1) {
+		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input id='google' type='checkbox' name='t[".$google_id."]' onclick='uncheckAll(this)' />Google".$POST_CHECKBOXES;
+	} else {
+		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input id='google' type='radio' name='t' value='".$google_id."' />Google".$POST_CHECKBOXES;
+	}
+}
+
+if ($search_prefs['selector'] == 2) {
+	$SEARCH_DROPDOWN .= "</select>";
+}
+// End of standard search config
+
+
 $text = preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_TOP_TABLE);
 foreach ($enhanced_types as $en_id => $ENHANCED_TEXT) {
 	$ENHANCED_DISPLAY_ID = "en_".$en_id;
diff -x .svn -aruN 0.7.11.src/signup.php 0.7.12.src/signup.php
--- 0.7.11.src/signup.php	2007-10-11 14:46:05.000000000 -0500
+++ 0.7.12.src/signup.php	2008-07-16 17:12:24.000000000 -0500
@@ -3,7 +3,7 @@
 + ----------------------------------------------------------------------------+
 |     e107 website system
 |
-|     Steve Dunstan 2001-2002
+|     ©Steve Dunstan 2001-2002
 |     http://e107.org
 |     jalist@e107.org
 |
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/signup.php,v $
-|     $Revision: 1.114 $
-|     $Date: 2007/10/11 19:46:05 $
-|     $Author: e107steved $
+|     $Revision: 1.117 $
+|     $Date: 2008/07/16 22:12:24 $
+|     $Author: e107coders $
 +----------------------------------------------------------------------------+
 */
 
@@ -338,6 +338,12 @@
 		}
 	}
 
+	if($invalid = $e_event->trigger("usersup_veri", $_POST))
+	{
+    	$error_message .= $invalid."\\n";
+        $error = TRUE;
+	}
+
 	if($_POST['xupexist'])
 	{
 		require_once(e_HANDLER."xml_class.php");
@@ -522,6 +528,25 @@
 	}
 
 
+// Split up an email address to check for banned domains.
+// Return false if invalid address
+function make_email_query($email, $fieldname = 'banlist_ip')
+{
+  global $tp;
+  $tmp = strtolower($tp -> toDB(trim(substr($email, strrpos($email, "@")+1))));
+  if ($tmp == '') return FALSE;
+  if (strpos($tmp,'.') === FALSE) return FALSE;
+  $em = array_reverse(explode('.',$tmp));
+  $line = '';
+  $out = array();
+  foreach ($em as $e)
+  {
+    $line = '.'.$e.$line;
+	$out[] = $fieldname."='*{$line}'";
+  }
+  return implode(' OR ',$out);
+}
+
 	//--------------------------------------
 	// Email address checks
 	//--------------------------------------
@@ -534,8 +559,10 @@
 	}
 
 	// Check Email against banlist.
-	$wc = $tp -> toDB("*".trim(substr($_POST['email'], strpos($_POST['email'], "@"))));
-	if ($do_email_validate && $sql->db_Select("banlist", "*", "banlist_ip='".$_POST['email']."' OR banlist_ip='{$wc}'"))
+	$wc = make_email_query($_POST['email']);
+	if ($wc) $wc = ' OR '.$wc;
+	
+	if (($wc === FALSE) || ($do_email_validate && $sql->db_Select("banlist", "*", "banlist_ip='".$_POST['email']."'".$wc)))
 	{
 	  $email_address_OK = FALSE;
 	  $brow = $sql -> db_Fetch();
@@ -599,7 +626,7 @@
 		if(isset($_POST['ue']['user_'.$ext['user_extended_struct_name']]))
 		{
 			$newval = trim($_POST['ue']['user_'.$ext['user_extended_struct_name']]);
-			if($ext['user_extended_struct_required'] == 1 && $newval == "" )
+			if($ext['user_extended_struct_required'] == 1 && (($newval == "") || (($ext['user_extended_struct_type'] == 7) && ($newval == '0000-00-00')) ))
 			{
 				$_ftext = (defined($ext['user_extended_struct_text']) ? constant($ext['user_extended_struct_text']) : $ext['user_extended_struct_text']);
 				$error_message .= LAN_SIGNUP_6.$_ftext.LAN_SIGNUP_7."\\n";
diff -x .svn -aruN 0.7.11.src/submitnews.php 0.7.12.src/submitnews.php
--- 0.7.11.src/submitnews.php	2007-10-26 06:43:57.000000000 -0500
+++ 0.7.12.src/submitnews.php	2008-06-02 13:29:09.000000000 -0500
@@ -11,12 +11,15 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/submitnews.php,v $
-|     $Revision: 1.20 $
-|     $Date: 2007/10/26 11:43:57 $
-|     $Author: e107coders $
+|     $Revision: 1.22 $
+|     $Date: 2008/06/02 18:29:09 $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("class2.php");
+
+$e_wysiwyg = varsettrue($pref['subnews_htmlarea']) ? 'e107_submitnews_item' : '';
+
 require_once(HEADERF);
 
 if (!isset($pref['subnews_class']))
@@ -48,7 +51,7 @@
             exit;
         }
         $itemtitle = $tp->toDB($_POST['itemtitle']);
-        $item = $tp->toDB($_POST['item']);
+        $item = $tp->toDB($_POST['e107_submitnews_item']);
         $item = str_replace("src=&quot;e107_images", "src=&quot;" . SITEURL . "e107_images", $item);
         // Process File Upload    =================================================
         if ($_FILES['file_userfile'] && $pref['subnews_attach'] && $pref['upload_enabled'] && check_class($pref['upload_class']) && FILE_UPLOADS)
@@ -149,7 +152,7 @@
     while (list($cat_id, $cat_name, $cat_icon) = $sql->db_Fetch())
     {
 		$sel = ($_POST['cat_id'] == $cat_id) ? "selected='selected'" : "";
-        $text .= "<option value='$cat_id' $sel>" . $tp->toHTML($cat_name,FALSE,"defs") . "</option>";
+        $text .= "<option value='{$cat_id}' {$sel}>" . $tp->toHTML($cat_name,FALSE,"defs") . "</option>";
     }
     $text .= "</select>";
 }
@@ -157,28 +160,28 @@
 	</tr><tr>
 	<td style='width:20%' class='forumheader3'>" . LAN_62 . "</td>
 	<td style='width:80%' class='forumheader3'>
-	<input class='tbox' type='text' id='itemtitle' name='itemtitle' size='60' value='$itemtitle' maxlength='200' style='width:90%' />
+	<input class='tbox' type='text' id='itemtitle' name='itemtitle' size='60' value='{$itemtitle}' maxlength='200' style='width:90%' />
 	</td>
 	</tr>";
-if ($pref['subnews_htmlarea'])
+
+
+if (e_WYSIWYG)
 {
-    require_once(e_HANDLER . "tiny_mce/wysiwyg.php");
-    echo wysiwyg("item");
+  $insertjs = "rows='25' ";
 }
 else
 {
-	require_once(e_HANDLER."ren_help.php");
+  require_once(e_HANDLER."ren_help.php");
+  $insertjs = "rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'";
 }
 
-$insertjs = (!$pref['subnews_htmlarea']) ? "rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'" : "rows='25' ";
 $text .= "
-
 	<tr>
 	<td style='width:20%' class='forumheader3'>" . LAN_135 . "</td>
 	<td style='width:80%' class='forumheader3'>
-	<textarea class='tbox' id='item' name='item'  cols='80'  style='max-width:95%' $insertjs></textarea><br />";
+	<textarea class='tbox' id='e107_submitnews_item' name='e107_submitnews_item'  cols='80'  style='max-width:95%' {$insertjs}></textarea><br />";
 
-if (!$pref['subnews_htmlarea'])
+if (!e_WYSIWYG)
 {
   $text .= display_help("helpb","submitnews");
 }
@@ -206,21 +209,26 @@
 	</div>";
 $ns->tablerender(LAN_136, $text);
 require_once(FOOTERF);
+
 function headerjs()
 {
-    $script = "<script type=\"text/javascript\">
+  $adder = '';
+  if (e_WYSIWYG) $adder = 'tinyMCE.triggerSave();';
+  $script = "<script type=\"text/javascript\">
 		function frmVerify()
 		{
-			if(document.getElementById('itemtitle').value == \"\")
-			{
-				alert('" . SUBNEWSLAN_1 . "');
-				return false;
-			}
-			if(document.getElementById('item').value == \"\")
-			{
-				alert('" . SUBNEWSLAN_2 . "');
-				return false;
-			}
+		  {$adder}
+		  if(document.getElementById('itemtitle').value == \"\")
+		  {
+			alert('" . SUBNEWSLAN_1 . "');
+			return false;
+		  }
+
+		  if(document.getElementById('e107_submitnews_item').value == \"\")
+		  {
+			alert('" . SUBNEWSLAN_2 . "');
+			return false;
+		  }
 		}
 		</script>";
     return $script;
diff -x .svn -aruN 0.7.11.src/upload.php 0.7.12.src/upload.php
--- 0.7.11.src/upload.php	2007-11-23 15:52:34.000000000 -0600
+++ 0.7.12.src/upload.php	2008-01-02 13:47:08.000000000 -0600
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/upload.php,v $
-|     $Revision: 1.17 $
-|     $Date: 2007/11/23 21:52:34 $
+|     $Revision: 1.18 $
+|     $Date: 2008/01/02 19:47:08 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -45,7 +45,7 @@
   {
 	require_once(e_HANDLER."upload_handler.php");
 //	$uploaded = file_upload(e_FILE."public/", "unique");
-	$uploaded = process_uploaded_files(e_FILE."public/", "unique", array('max_file_count' => 2));
+	$uploaded = process_uploaded_files(e_FILE."public/", "unique", array('max_file_count' => 2, 'extra_file_types' => TRUE));
 
 // First, see what errors the upload handler picked up
 	if ($uploaded === FALSE)
diff -x .svn -aruN 0.7.11.src/user.php 0.7.12.src/user.php
--- 0.7.11.src/user.php	2007-12-19 14:34:28.000000000 -0600
+++ 0.7.12.src/user.php	2008-06-05 14:57:52.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/user.php,v $
-|     $Revision: 1.45 $
-|     $Date: 2007/12/19 20:34:28 $
+|     $Revision: 1.47 $
+|     $Date: 2008/06/05 19:57:52 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -87,7 +87,7 @@
 	{
 		if ($qs[0] == "id")
 		{
-			$id = $qs[1];
+			$id = intval($qs[1]);
 		}
 		else
 		{
@@ -160,7 +160,7 @@
 {
 	$userList = $sql->db_getList();
 
-	$text .= $tp->parseTemplate($USER_SHORT_TEMPLATE_START, TRUE, $user_shortcodes);
+	$text = $tp->parseTemplate($USER_SHORT_TEMPLATE_START, TRUE, $user_shortcodes);
 	foreach ($userList as $row)
 	{
 		$loop_uid = $row['user_id'];
diff -x .svn -aruN 0.7.11.src/userposts.php 0.7.12.src/userposts.php
--- 0.7.11.src/userposts.php	2007-10-28 10:01:35.000000000 -0500
+++ 0.7.12.src/userposts.php	2008-07-03 15:06:56.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/userposts.php,v $
-|     $Revision: 1.28 $
-|     $Date: 2007/10/28 15:01:35 $
+|     $Revision: 1.30 $
+|     $Date: 2008/07/03 20:06:56 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -83,7 +83,8 @@
 		$sql->db_Select("user", "user_comments", "user_id=".$id);
 		list($user_comments) = $sql->db_Fetch();
 		$ctotal = $user_comments;
-		$data = $cobj->getCommentData($amount='10', $from, "comment_author = '".$user_id."'");
+//		$data = $cobj->getCommentData($amount='10', $from, "comment_author = '".$user_id."'");
+		$data = $cobj->getCommentData($amount='10', $from, "SUBSTRING_INDEX(comment_author,'.',1) = '".$id."'");
 	}
 	else
 	{
@@ -259,7 +260,7 @@
 	}
 
 	$tmp = $thread_id;
-	$thread_thread = $tp->toHTML($thread_thread, TRUE, "", $id);
+	$thread_thread = $tp->toHTML($thread_thread, TRUE, "USER_BODY", $id);
 
 	$USERPOSTS_FORUM_ICON = "<img src='".e_PLUGIN."forum/images/".IMODE."/new_small.png' alt='' />";
 	$USERPOSTS_FORUM_TOPIC_HREF_PRE = "<a href='".e_PLUGIN."forum/forum_viewtopic.php?".$tmp.".post'>";
diff -x .svn -aruN 0.7.11.src/usersettings.php 0.7.12.src/usersettings.php
--- 0.7.11.src/usersettings.php	2007-12-21 14:43:39.000000000 -0600
+++ 0.7.12.src/usersettings.php	2008-06-10 14:30:03.000000000 -0500
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/usersettings.php,v $
-|     $Revision: 1.98 $
-|     $Date: 2007/12/21 20:43:39 $
+|     $Revision: 1.102 $
+|     $Date: 2008/06/10 19:30:03 $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -130,6 +130,9 @@
 	{	// Current user logged in - use their ID
 	  $inp = USERID;
 	}
+	$udata = get_user_data($inp);				// Get all the user data, including any extended fields
+	$peer = ($inp == USERID ? false : true);
+	$udata['user_classlist'] = addCommonClasses($udata);
 
 
 	// Check external avatar
@@ -198,12 +201,14 @@
 
 	if(isset($pref['signup_disallow_text']))
 	{
-		$tmp = explode(",", $pref['signup_disallow_text']);
-		foreach($tmp as $disallow){
-			if(strstr($_POST['username'], $disallow)){
-				$error .= LAN_USET_11."\\n";
-			}
+	  $tmp = explode(",", $pref['signup_disallow_text']);
+	  foreach($tmp as $disallow)
+	  {
+		if (($disallow != '') && strstr($_POST['username'], $disallow))
+		{
+		  $error .= LAN_USET_11."\\n";
 		}
+	  }
 	}
 
 	if (strlen(trim($_POST['password1'])) < $pref['signup_pass_len'] && trim($_POST['password1']) != "") {
@@ -213,22 +218,57 @@
 	}
 
 
-	if (isset($pref['disable_emailcheck']) && $pref['disable_emailcheck']==1)
+
+//--------------------------------------------
+//		Email address checks
+//--------------------------------------------
+// Split up an email address to check for banned domains.
+// Return false if invalid address
+function make_email_query($email, $fieldname = 'banlist_ip')
+{
+  global $tp;
+  $tmp = strtolower($tp -> toDB(trim(substr($email, strrpos($email, "@")+1))));
+  if ($tmp == '') return FALSE;
+  if (strpos($tmp,'.') === FALSE) return FALSE;
+  $em = array_reverse(explode('.',$tmp));
+  $line = '';
+  $out = array();
+  foreach ($em as $e)
+  {
+    $line = '.'.$e.$line;
+	$out[] = $fieldname."='*{$line}'";
+  }
+  return implode(' OR ',$out);
+}
+
+
+	// Always validate an email address if entered. If its blank, that's OK if checking disabled
+	$_POST['email'] = $tp->toDB(trim(varset($_POST['email'],'')));
+	$do_email_validate = !varset($pref['disable_emailcheck'],FALSE) || ($_POST['email'] !='');
+	if ($do_email_validate && !check_email($_POST['email']))
 	{
-	} else {
-		if (!check_email($_POST['email']))
-		{
-	  		$error .= LAN_106."\\n";
-		}
+	  $error .= LAN_106."\\n";
+	}
+
+	// Check Email address against banlist.
+	$wc = make_email_query($_POST['email']);
+	if ($wc) $wc = ' OR '.$wc;
+	
+	if (($wc === FALSE) || ($do_email_validate && $sql->db_Select("banlist", "*", "banlist_ip='".$_POST['email']."'".$wc)))
+	{
+	  $error .= LAN_106."\\n";
 	}
 
-	// Check for duplicate of email address
-	if ($sql->db_Select("user", "user_name, user_email", "user_email='".$tp -> toDB($_POST['email'])."' AND user_id !='".intval($inp)."' "))
+
+	// Check for duplicate of email address (always)
+	if ($sql->db_Select("user", "user_name, user_email", "user_email='".$_POST['email']."' AND user_id !='".intval($inp)."' "))
 	{
-	  	$error .= LAN_408."\\n";
+	  $error .= LAN_408."\\n";
 	}
 
 
+
+
 // Display name checks
 	if (isset($_POST['username']))
 	{
@@ -258,7 +298,7 @@
 		require_once(e_HANDLER."upload_handler.php");
 		require_once(e_HANDLER."resize_handler.php");
 
-		if ($uploaded = file_upload(e_FILE."public/avatars/", "avatar"))
+		if ($uploaded = file_upload(e_FILE."public/avatars/", "avatar=".$udata['user_id']))
 		{
 		  foreach ($uploaded as $upload)
 		  {	// Needs the latest upload handler (with legacy and 'future' interfaces) to work
@@ -266,9 +306,9 @@
 			{
 				// avatar uploaded - give it a reference which identifies it as server-stored
 				$_POST['image'] = "-upload-".$upload['name'];
-				if ($_POST['image'] != $currentUser['user_image'])
+				if ($_POST['image'] != $udata['user_image'])
 				{
-				  $avatar_to_delete = str_replace("-upload-", "", $currentUser['user_image']);
+				  $avatar_to_delete = str_replace("-upload-", "", $udata['user_image']);
 //				  echo "Avatar change; deleting {$avatar_to_delete}<br />";
 				}
 				if (!resize_image(e_FILE."public/avatars/".$upload['name'], e_FILE."public/avatars/".$upload['name'], "avatar"))
@@ -299,21 +339,21 @@
 // See if user just wants to delete existing photo
 	if (isset($_POST['user_delete_photo']))
 	{
-	  $photo_to_delete = $currentUser['user_sess'];
+	  $photo_to_delete = $udata['user_sess'];
 	  $sesschange = "user_sess = '', ";
 //	  echo "Just delete old photo: {$photo_to_delete}<br />";
 	}
 	elseif ($user_sess != "")
 	{	// Update DB with photo
 	  $sesschange = "user_sess = '".$tp->toDB($user_sess)."', ";
-	  if ($currentUser['user_sess'] == $tp->toDB($user_sess))
+	  if ($udata['user_sess'] == $tp->toDB($user_sess))
 	  {
 		$sesschange = '';			// Same photo - do nothing
 //		echo "Photo not changed<br />";
 	  }
 	  else
 	  {
-		$photo_to_delete = $currentUser['user_sess'];
+		$photo_to_delete = $udata['user_sess'];
 //		echo "New photo: {$user_sess} Delete old photo: {$photo_to_delete}<br />";
 	  }
 	}
@@ -322,40 +362,33 @@
     // Validate Extended User Fields.
 	if($_POST['ue'])
 	{
-		if($sql->db_Select('user_extended_struct'))	{
-			while($row = $sql->db_Fetch())
-			{
-				$extList["user_".$row['user_extended_struct_name']] = $row;
-			}
+	  if($sql->db_Select('user_extended_struct'))	
+	  {
+		while($row = $sql->db_Fetch())
+		{
+		  $extList["user_".$row['user_extended_struct_name']] = $row;
 		}
+	  }
 
 		$ue_fields = "";
 		foreach($_POST['ue'] as $key => $val)
 		{
-			$err = false;
-			$parms = explode("^,^", $extList[$key]['user_extended_struct_parms']);
-			$regex = $tp->toText($parms[1]);
-			$regexfail = $tp->toText($parms[2]);
-    		if(defined($regexfail)) {$regexfail = constant($regexfail);}
-	  		if($val == '' && $extList[$key]['user_extended_struct_required'] == 1 && !$_uid)
-			{
-         		$error .= LAN_SIGNUP_6.($tp->toHtml($extList[$key]['user_extended_struct_text'],FALSE,"defs"))." ".LAN_SIGNUP_7."\\n";
-	    		$err = TRUE;
+			$err = $ue->user_extended_validate_entry($val,$extList[$key]);
+	  		if($err === TRUE && !$_uid)
+			{  // General error - usually empty field; could be unacceptable value, or regex fail and no error message defined
+         	  $error .= LAN_SIGNUP_6.($tp->toHtml($extList[$key]['user_extended_struct_text'],FALSE,"defs"))." ".LAN_SIGNUP_7."\\n";
 			}
-			if($regex != "" && $val != "")
-			{
-				if(!preg_match($regex, $val))
-				{
-               		$error .= $regexfail."\\n";
-         			$err = TRUE;
-	         	}
+			elseif ($err)
+			{	// Specific error message returned - usually regex fail
+			  $error .= $err."\\n";
+			  $err = TRUE;
 			}
 			if(!$err)
 			{
-				$val = $tp->toDB($val);
-				$ue_fields .= ($ue_fields) ? ", " : "";
-				$ue_fields .= $key."='".$val."'";
-				}
+			  $val = $tp->toDB($val);
+			  $ue_fields .= ($ue_fields) ? ", " : "";
+			  $ue_fields .= $key."='".$val."'";
+			}
 		}
     }
 
@@ -386,15 +419,9 @@
 
 	  if ($ret == '')
 	  {
-		$udata = get_user_data($inp);				// Get all the user data, including any extended fields
-		$peer = ($inp == USERID ? false : true);
-		$udata['user_classlist'] = addCommonClasses($udata);
-
 		$loginname = strip_tags($_POST['loginname']);
 		if (!$loginname)
 		{
-//		  $sql->db_Select("user", "user_loginname", "user_id='".intval($inp)."'");
-//		  $row = $sql -> db_Fetch();
 		  $loginname = $udata['user_loginname'];
 		}
 		else
@@ -473,15 +500,10 @@
 
 
 		// Update Userclass - only if its the user changing their own data (admins can do it another way)
-//		if (!$_uid && $sql->db_Select("userclass_classes", "*", "userclass_editclass IN (".USERCLASS_LIST.")"))
 		if (!$_uid && $sql->db_Select("userclass_classes", "userclass_id", "userclass_editclass IN (".USERCLASS_LIST.")"))
 		{
 		  $ucList = $sql->db_getList();			// List of classes which this user can edit
 		  if (US_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","Usersettings test","Read editable list. Current user classes: ".$udata['user_class'],FALSE,LOG_TO_ROLLING);
-//		  if ($sql->db_Select("user", "user_class", "user_id = '".intval($inp)."'"))
-//		  {
-//			$row = $sql->db_Fetch();
-//			$cur_classes = explode(",", $row['user_class']);
 			$cur_classes = explode(",", $udata['user_class']);			// Current class membership
 			$newclist = array_flip($cur_classes);						// Array keys are now the class IDs
 
@@ -505,7 +527,6 @@
 			  if (US_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","Usersettings test","Write back classes; new list: ".$nid,FALSE,LOG_TO_ROLLING);
 			  $sql->db_Update("user", "user_class='".$nid."' WHERE user_id=".intval($inp));
 			}
-//		  }
 		}
 
 
