diff -ruN 0.761/admin.php 0.762/admin.php
--- 0.761/admin.php	2005-02-04 00:30:16.000000000 -0600
+++ 0.762/admin.php	2006-01-13 13:16:15.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: admin.php,v 1.21 2005/02/04 06:30:16 jorg Exp $
+// File: $Id: admin.php,v 1.28 2006/01/13 19:16:15 jorg Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -33,56 +33,87 @@
 // start PN
 pnInit();
 
-// Get variables
-list($module,
-     $func,
+// Get module
+$module = pnVarCleanFromInput('module');
+
+if (empty($module)) {
+    // call for admin.php without module parameter
+    pnRedirect(pnModURL('Admin', 'admin','adminpanel'));
+    exit;
+} else if (!pnModAvailable($module) || !pnSecAuthAction(0, "$module::", '::', ACCESS_EDIT)) {
+    // call for an unavailable module - either not available or not authorized
+    header('HTTP/1.0 403 Access Denied');
+    include ('header.php');
+    echo 'Module <strong>' . pnVarPrepForDisplay($module) . '</strong> not available';
+    include ('footer.php');
+    exit;
+}
+
+// get the module information
+$modinfo = pnModGetInfo(pnModGetIDFromName($module));
+
+if ($modinfo['type'] == 2 || $modinfo['type'] == 3) {
+    // Redirect to new style admin panel
+    pnRedirect(pnModURL($module, 'admin'));
+    exit;
+}
+
+
+if (!file_exists($adminfile='modules/' . pnVarPrepForOS($modinfo['directory']) . '/admin.php')) {
+    // Module claims to be old-style, but no admin.php present - quit here
+    header('HTTP/1.0 404 Not Found');
+    include ('header.php');
+    echo 'Wrong call for Adminfunction in Module <strong>' . pnVarPrepForDisplay($module) . '</strong>';
+    include ('footer.php');
+    exit;
+}
+
+
+/**
+ * old style module administration
+ */
+
+list($func,
      $op,
      $name,
      $file,
-     $type) = pnVarCleanFromInput('module',
-                                  'func',
+     $type) = pnVarCleanFromInput('func',
                                   'op',
                                   'name',
                                   'file',
                                   'type');
 
-// get the module information
-$modinfo = pnModGetInfo(pnModGetIDFromName($module));
-if (file_exists($file='modules/' . pnVarPrepForOS($modinfo['directory']) . '/admin.php')) 
-{
-	/* load the legacy includes */
-	include_once('modules/Admin/pnlegacy/tools.php');
-
-	 // set a constant so we can check the corrct entry point later
-	define('LOADED_AS_MODULE','1');
-
-    $ModName = $module;
-    include $file;
- 
- 	// each individual module admin panel loads it language - markwest
-	//modules_get_language();
-	modules_get_manual();
- 
-    if (substr($module,0,3)=='NS-') {
-        $function = substr($module,3).'_admin_';
-    } else {
-        $function = $module.'_admin_';
-    }
- 
-    $function_op = $function.$op;
-    $function_main = $function.'main';
-    $var = array_merge($_GET,$_POST);
-
-    if (function_exists($function_op)) {
-        $function_op($var);
-    } elseif (function_exists($function_main)) {
-        $function_main($var);
-    } else {
-    	pnSessionSetVar('errormsg', "error : admin_execute($file,$function_op)");
-		pnRedirect(pnModURL('Admin', 'admin','adminpanel'));
-    }
-} else {
-	pnRedirect(pnModURL('Admin', 'admin','adminpanel'));
-}
+// load the legacy includes
+include_once('modules/Admin/pnlegacy/tools.php'); 
+
+// set a constant so we can check the correct entry point later
+define('LOADED_AS_MODULE', '1');
+
+$ModName = $module;
+include $adminfile;
+modules_get_manual();
 
+if (substr($module, 0, 3) == 'NS-') {
+    $function = substr($module, 3) . '_admin_';
+} else {
+    $function = $module . '_admin_';
+} 
+if (empty($op)) {
+    $op = 'main';
+} 
+$function_op = $function . $op;
+$function_main = $function . 'main';
+
+if (function_exists($function_op)) {
+    $function_op($_REQUEST);
+} elseif (function_exists($function_main)) {
+    $function_main($_REQUEST);
+} else {
+    // neither function_admin_op nor function_admin_main are available
+    header('HTTP/1.0 404 Not Found');
+    include ('header.php');
+    echo 'Adminfunction <strong>' . pnVarPrepForDisplay($function_op) . '</strong> in Module <strong>' . pnVarPrepForDisplay($module) . '</strong> not available';
+    include ('footer.php');
+    exit;
+} 
 ?>
\ No newline at end of file
diff -ruN 0.761/backend.php 0.762/backend.php
--- 0.761/backend.php	2005-05-13 06:09:25.000000000 -0500
+++ 0.762/backend.php	2006-01-07 09:42:52.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: backend.php,v 1.13 2005/05/13 11:09:25 markwest Exp $
+// File: $Id: backend.php,v 1.16 2006/01/07 15:42:52 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -54,6 +54,10 @@
 } else {
 	$charset = 'ISO-8859-1';
 }
+// get the short urls extensions
+$urlsok = pnModGetVar('Xanthia', 'shorturlsok');
+$urlextension = pnModGetVar('Xanthia', 'shorturlsextension');
+$baseurl = pnGetBaseURL();
 
 // Base query
 $storiescolumn = $pntable['stories_column'];
@@ -92,7 +96,14 @@
 		$mostrecentdate = $time;
 	}
 	$title = pnVarPrepForDisplay($title);
-	$link = pnVarPrepForDisplay(pnGetBaseURL() . "index.php?name=News&file=article&sid=$sid");
+
+    // form the url
+    if($urlsok == 1) {
+       $link =  pnVarPrepForDisplay("{$baseurl}Article$sid.$urlextension");
+    } else {
+       $link =  pnVarPrepForDisplay("{$baseurl}index.php?name=News&file=article&sid=$sid");
+    }
+
 	$content = pnVarPrepForDisplay(strip_tags($hometext));
 
 	// check author id
diff -ruN 0.761/error.php 0.762/error.php
--- 0.761/error.php	2005-02-22 06:53:51.000000000 -0600
+++ 0.762/error.php	2005-12-23 02:54:00.000000000 -0600
@@ -1,6 +1,6 @@
 <?php
 /**
- * File: $Id: error.php,v 1.15 2005/02/22 12:53:51 jorg Exp $
+ * File: $Id: error.php,v 1.16 2005/12/23 08:54:00 larsneo Exp $
  *  ----------------------------------------------------------------------
  *  PostNuke Content Management System
  *  Copyright (C) 2001 by the PostNuke Development Team.
@@ -45,6 +45,8 @@
 $reportlevel = pnConfigGetVar('reportlevel');
 $funtext = pnConfigGetVar('funtext');
 
+header('HTTP/1.1 404 Not Found');
+
 include('header.php');
         
 if ($funtext == 0) {
diff -ruN 0.761/includes/blocks/button.php 0.762/includes/blocks/button.php
--- 0.761/includes/blocks/button.php	2005-02-22 06:39:28.000000000 -0600
+++ 0.762/includes/blocks/button.php	2005-12-20 03:15:52.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: button.php,v 1.12 2005/02/22 12:39:28 jorg Exp $
+// File: $Id: button.php,v 1.14 2005/12/20 09:15:52 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -114,7 +114,7 @@
         '$vars[button_name]', '$vars[button_url]', '$vars[button_image]')");
     }
     // update link name
-    if ((isset($vars['name'])) && (count($vars['bname']))) {
+    if ((isset($vars['bname'])) && (count($vars['bname']))) {
         foreach ($vars['bname'] as $k=>$v) {
             if (!empty($v)) {
                 $column = &$pntable['blocks_buttons_column'];
@@ -125,7 +125,7 @@
         }
     }
     // update link url
-    if ((isset($vars['name'])) && (count($vars['bname']))) {
+    if ((isset($vars['burl'])) && (count($vars['burl']))) {
         foreach ($vars['burl'] as $k=>$v) {
             if (!empty($v)) {
                 $column = &$pntable['blocks_buttons_column'];
@@ -241,7 +241,7 @@
         $output .= "<tr>
 		<td valign=\"top\"><input type=\"text\" name=\"bname[$brow[id]]\" size=\"30\" maxlength=\"255\" value=\"$brow[title]\" /></td>
 		<td valign=\"top\"><input type=\"text\" name=\"burl[$brow[id]]\" size=\"30\" maxlength=\"255\" value=\"$brow[url]\" /></td>
-		<td valign=\"top\">$img<input type=\"text\" name=\"images[brow[id]]\" size=\"10\" maxlength=\"255\" /></td>
+		<td valign=\"top\">$img<input type=\"text\" name=\"images[$brow[id]]\" size=\"10\" maxlength=\"255\" /></td>
 		<td valign=\"top\"><input type=\"checkbox\" name=\"delete_link[]\" value=\"$brow[id]\" /></td></tr>\n";
     }
     $output .= "<tr>
diff -ruN 0.761/includes/blocks/login.php 0.762/includes/blocks/login.php
--- 0.761/includes/blocks/login.php	2005-08-28 09:30:54.000000000 -0500
+++ 0.762/includes/blocks/login.php	2005-10-19 10:55:38.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: login.php,v 1.27 2005/08/28 14:30:54 markwest Exp $
+// File: $Id: login.php,v 1.29 2005/10/19 15:55:38 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -28,7 +28,7 @@
 // ----------------------------------------------------------------------
 
 if (strpos($_SERVER['PHP_SELF'], 'login.php')) {
-	die ("You can't access this file directly...");
+  die ("You can't access this file directly...");
 }
 
 $blocks_modules['login'] = array(
@@ -55,27 +55,27 @@
     }
 
 	// get the current uri so we can return the user to the correct place
-	$path = pnServerGetVar('HTTP_REFERER');
+	$path = pnGetCurrentURI();
 
     if (!pnUserLoggedIn()) {
     // prettified a little with a table for inputs and button to avoid bugs like #493456 (Andy Varganov)
         $boxstuff  = '<form action="user.php" method="post"><div>' . "\n";
         $boxstuff .= '<label for="uname">'._BLOCKNICKNAME.'</label><br />' . "\n";
         $boxstuff .= '<input type="text" name="uname" id="uname" size="14" maxlength="25" tabindex="0"
-										value="'._BLOCKNICKNAME.'"
-										onblur="if(this.value==\'\')this.value=\''._BLOCKNICKNAME.'\';"
-										onfocus="if(this.value==\''._BLOCKNICKNAME.'\')this.value=\'\';" /><br />';
-		$boxstuff .= '<label for="pass">'._BLOCKPASSWORD.'</label><br />' . "\n";
+                    value="'._BLOCKNICKNAME.'"
+                    onblur="if(this.value==\'\')this.value=\''._BLOCKNICKNAME.'\';"
+                    onfocus="if(this.value==\''._BLOCKNICKNAME.'\')this.value=\'\';" /><br />';
+	    $boxstuff .= '<label for="pass">'._BLOCKPASSWORD.'</label><br />' . "\n";
         $boxstuff .= '<input type="password" name="pass" id="pass" size="14" maxlength="20" tabindex="0" /><br />' . "\n";
         if (pnConfigGetVar('seclevel') != 'High') {
 			$boxstuff .= '<input type="checkbox" value="1" name="rememberme" id="rememberme" tabindex="0" />' . "\n";
-            $boxstuff .= '&nbsp;<label for="rememberme">'._REMEMBERME.'</label>' . "\n";
+			$boxstuff .= '&nbsp;<label for="rememberme">'._REMEMBERME.'</label>' . "\n";
 			$boxstuff .= '<br />' . "\n";
         }
         $boxstuff .= '<input type="hidden" name="module" value="User" />' . "\n";
         $boxstuff .= '<input type="hidden" name="op" value="login" />' . "\n";
         $boxstuff .= '<input type="hidden" name="url" value="' .pnVarPrepForDisplay($path) .'" />' . "\n";
-        $boxstuff .= '<input title="' . _COOKIEHINTFORLOGIN . '"type="submit" value="'._LOGIN.'" /><br />' . "\n";
+        $boxstuff .= '<input title="' . _COOKIEHINTFORLOGIN . '" type="submit" value="'._LOGIN.'" /><br />' . "\n";
         $boxstuff .= '<br />'._ASREGISTERED.'</div></form>' . "\n";
         if (empty($row['title'])) {
             $row['title'] = _LOGIN;
diff -ruN 0.761/includes/blocks/menu.php 0.762/includes/blocks/menu.php
--- 0.761/includes/blocks/menu.php	2005-08-02 09:19:19.000000000 -0500
+++ 0.762/includes/blocks/menu.php	2005-11-10 13:37:37.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: menu.php,v 1.38 2005/08/02 14:19:19 markwest Exp $
+// File: $Id: menu.php,v 1.39 2005/11/10 19:37:37 hammerhead Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -132,7 +132,7 @@
     // Waiting content
     if($vars['displaywaiting']==1) {
         $waiting = '';
-        if (pnSecAuthAction(0, "Stories::Story", '::', ACCESS_ADD)) {
+        if (pnSecAuthAction(0, "Stories::Story", '::', ACCESS_ADD) && pnModAvailable('News')) {
             $result =& $dbconn->Execute("SELECT count(1) FROM $pntable[queue]
                                       WHERE {$pntable['queue_column']['arcd']}=0");
             if ($dbconn->ErrorNo() == 0) {
@@ -144,7 +144,7 @@
             }
         }
 
-        if (pnSecAuthAction(0, "Reviews::", '::', ACCESS_ADD)) {
+        if (pnSecAuthAction(0, "Reviews::", '::', ACCESS_ADD) && pnModAvailable('Reviews')) {
             $result =& $dbconn->Execute("SELECT count(1) FROM $pntable[reviews_add]");
             if ($dbconn->ErrorNo() == 0) {
                 list($rnum) = $result->fields;
@@ -155,7 +155,7 @@
             }
         }
 
-        if (pnSecAuthAction(0, "Web Links::Link", '::', ACCESS_ADD)) {
+        if (pnSecAuthAction(0, "Web Links::Link", '::', ACCESS_ADD) && pnModAvailable('Web_Links')) {
             $result =& $dbconn->Execute("SELECT count(1) FROM $pntable[links_newlink]");
             if ($dbconn->ErrorNo() == 0) {
                 list($lnum) = $result->fields;
@@ -166,7 +166,7 @@
             }
         }
 
-        if (pnSecAuthAction(0, "Downloads::Item", '::', ACCESS_ADD)) {
+        if (pnSecAuthAction(0, "Downloads::Item", '::', ACCESS_ADD) && pnModAvailable('Downloads')) {
             $result =& $dbconn->Execute("SELECT count(1) FROM $pntable[downloads_newdownload]");
             if ($dbconn->ErrorNo() == 0) {
                 list($dnum) = $result->fields;
@@ -177,7 +177,7 @@
             }
         }
 
-        if (pnSecAuthAction(0, "FAQ::", '::', ACCESS_ADD)) {
+        if (pnSecAuthAction(0, "FAQ::", '::', ACCESS_ADD) && pnModAvailable('FAQ')) {
             $faqcolumn = &$pntable['faqanswer_column'];
             $result =& $dbconn->Execute("SELECT count(1) FROM $pntable[faqanswer] WHERE $faqcolumn[answer]=''");
             if ($dbconn->ErrorNo() == 0) {
diff -ruN 0.761/includes/blocks/poll.php 0.762/includes/blocks/poll.php
--- 0.761/includes/blocks/poll.php	2005-08-01 05:14:41.000000000 -0500
+++ 0.762/includes/blocks/poll.php	2005-11-04 03:07:41.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: poll.php,v 1.42 2005/08/01 10:14:41 landseer Exp $
+// File: $Id: poll.php,v 1.43 2005/11/04 09:07:41 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -389,7 +389,7 @@
     $result =& $dbconn->Execute($sql);
     while(list($title, $id) = $result->fields) {
         $result->MoveNext();
-        $output .= '<option value="$id"';
+        $output .= '<option value="'.pnVarPrepForDisplay($id).'"';
         if ($pollID == $id) {
            $output .= ' selected="selected"';
         }
diff -ruN 0.761/includes/blocks/thelang.php 0.762/includes/blocks/thelang.php
--- 0.761/includes/blocks/thelang.php	2005-02-04 00:30:17.000000000 -0600
+++ 0.762/includes/blocks/thelang.php	2006-01-20 04:11:40.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: thelang.php,v 1.15 2005/02/04 06:30:17 jorg Exp $
+// File: $Id: thelang.php,v 1.16 2006/01/20 10:11:40 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -77,7 +77,7 @@
        }
     }
     asort($langlist);
-    $content = '<div style="text-align:center">'._SELECTGUILANG.'<br /><br />';
+    $content = '<div>'._SELECTGUILANG.'<br /><br />';
 	if (pnConfigGetVar('useflags'))
 	// eugeniobaldi 2002-02-16 his if give error in useflag
 	//    if (pnConfigGetVar('useflags') || isset($row['url']))
@@ -89,7 +89,7 @@
                 $i = 1;
             }
             $imgsize = @getimagesize("images/flags/flag-$k.png");
-            $content .= "<a href=\"$currentURL".$append."newlang=$k\"><img src=\"images/flags/flag-$k.png\" alt=\"$lang[$k]\" $imgsize[3] /></a>";
+            $content .= "<a href=\"$currentURL".$append."newlang=$k\"><img src=\"images/flags/flag-$k.png\" alt=\"$lang[$k]\" $imgsize[3] /></a> ";
             $i++;
         }
         $content .= '</div>';
diff -ruN 0.761/includes/classes/adodb/adodb-csvlib.inc.php 0.762/includes/classes/adodb/adodb-csvlib.inc.php
--- 0.761/includes/classes/adodb/adodb-csvlib.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-csvlib.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -8,7 +8,7 @@
 
 /* 
 
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
diff -ruN 0.761/includes/classes/adodb/adodb-datadict.inc.php 0.762/includes/classes/adodb/adodb-datadict.inc.php
--- 0.761/includes/classes/adodb/adodb-datadict.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-datadict.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -737,9 +737,14 @@
 			$holdflds = array();
 			foreach($flds as $k=>$v) {
 				if ( isset($cols[$k]) && is_object($cols[$k]) ) {
+					// If already not allowing nulls, then don't change
+					$obj = $cols[$k];
+					if (isset($obj->not_null) && $obj->not_null)
+						$v = str_replace('NOT NULL','',$v);
+
 					$c = $cols[$k];
 					$ml = $c->max_length;
-					$mt = &$this->MetaType($c->type,$ml);
+					$mt = $this->MetaType($c->type,$ml);
 					if ($ml == -1) $ml = '';
 					if ($mt == 'X') $ml = $v['SIZE'];
 					if (($mt != $v['TYPE']) ||  $ml != $v['SIZE']) {
diff -ruN 0.761/includes/classes/adodb/adodb-errorhandler.inc.php 0.762/includes/classes/adodb/adodb-errorhandler.inc.php
--- 0.761/includes/classes/adodb/adodb-errorhandler.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-errorhandler.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ * @version V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license.
  * Whenever there is any discrepancy between the two licenses,
  * the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/adodb-error.inc.php 0.762/includes/classes/adodb/adodb-error.inc.php
--- 0.761/includes/classes/adodb/adodb-error.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-error.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ * @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/adodb-errorpear.inc.php 0.762/includes/classes/adodb/adodb-errorpear.inc.php
--- 0.761/includes/classes/adodb/adodb-errorpear.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-errorpear.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ * @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/adodb-exceptions.inc.php 0.762/includes/classes/adodb/adodb-exceptions.inc.php
--- 0.761/includes/classes/adodb/adodb-exceptions.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-exceptions.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * @version V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ * @version V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license.
  * Whenever there is any discrepancy between the two licenses,
  * the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/adodb.inc.php 0.762/includes/classes/adodb/adodb.inc.php
--- 0.761/includes/classes/adodb/adodb.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -14,7 +14,7 @@
 /**
 	\mainpage 	
 	
-	 @version V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
+	 @version V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
 
 	Released under both BSD license and Lesser GPL library license. You can choose which license
 	you prefer.
@@ -28,8 +28,7 @@
 	ADO, SAP DB, SQLite and ODBC. We have had successful reports of connecting to Progress and
 	other databases via ODBC.
 
-	Latest Download at http://php.weblogs.com/adodb<br>
-	Manual is at http://php.weblogs.com/adodb_manual
+	Latest Download at http://adodb.sourceforge.net/
 	  
  */
  
@@ -172,7 +171,7 @@
 		/**
 		 * ADODB version as a string.
 		 */
-		$ADODB_vers = 'V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';
+		$ADODB_vers = 'V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';
 	
 		/**
 		 * Determines whether recordset->RecordCount() is used. 
@@ -861,7 +860,6 @@
 	
 	function &_Execute($sql,$inputarr=false)
 	{
-
 		if ($this->debug) {
 			global $ADODB_INCLUDED_LIB;
 			if (empty($ADODB_INCLUDED_LIB)) include_once(ADODB_DIR.'/adodb-lib.inc.php');
@@ -1108,7 +1106,7 @@
 					// access includes ties in result
 					if ($isaccess) {
 						$sql = preg_replace(
-						'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
+						'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
 
 						if ($secs2cache>0) {
 							$ret =& $this->CacheExecute($secs2cache, $sql,$inputarr);
@@ -1118,10 +1116,10 @@
 						return $ret; // PHP5 fix
 					} else if ($ismssql){
 						$sql = preg_replace(
-						'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
+						'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
 					} else {
 						$sql = preg_replace(
-						'/(^\s*select\s)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
+						'/(^\s*select\s)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
 					}
 			} else {
 				$nn = $nrows + $offset;
@@ -1358,8 +1356,10 @@
 		$rs =& $this->Execute($sql,$inputarr);
 		$ADODB_COUNTRECS = $savec;
 		if (!$rs) 
-			if (defined('ADODB_PEAR')) return ADODB_PEAR_Error();
-			else {
+			if (defined('ADODB_PEAR')) {
+				$cls = ADODB_PEAR_Error();
+				return $cls;
+			} else {
 				$false = false;
 				return $false;
 			}
@@ -1383,8 +1383,10 @@
 		$ADODB_COUNTRECS = $savec;
 		
 		if (!$rs) 
-			if (defined('ADODB_PEAR')) return ADODB_PEAR_Error();
-			else {
+			if (defined('ADODB_PEAR')) {
+				$cls = ADODB_PEAR_Error();
+				return $cls;
+			} else {
 				$false = false;
 				return $false;
 			}
@@ -1673,7 +1675,7 @@
 	{
 		$sql = 'SELECT * FROM '.$table;  
 		if ($where!==FALSE) $sql .= ' WHERE '.$where;
-		else if ($mode == 'UPDATE') {
+		else if ($mode == 'UPDATE' || $mode == 2 /* DB_AUTOQUERY_UPDATE */) {
 			ADOConnection::outp('AutoExecute: Illegal mode=UPDATE with empty WHERE clause');
 			return false;
 		}
@@ -2587,8 +2589,10 @@
 	 */
 	function &GetArray($nRows = -1) 
 	{
-	global $ADODB_EXTENSION; if ($ADODB_EXTENSION) return adodb_getall($this,$nRows);
-		
+	global $ADODB_EXTENSION; if ($ADODB_EXTENSION) {
+		$results = adodb_getall($this,$nRows);
+		return $results;
+	}
 		$results = array();
 		$cnt = 0;
 		while (!$this->EOF && $nRows != $cnt) {
@@ -2746,7 +2750,9 @@
 				}
 			}
 		}
-		return $results; 
+		
+		$ref =& $results; # workaround accelerator incompat with PHP 4.4 :(
+		return $ref; 
 	}
 	
 	
@@ -3786,6 +3792,7 @@
 		}
 		
 		switch($drivername) {
+		case 'mysqli': $drivername='mysql'; break;
 		case 'firebird15': $drivername = 'firebird'; break;
 		case 'oracle': $drivername = 'oci8'; break;
 		case 'access': if ($perf) $drivername = ''; break;
@@ -3871,6 +3878,7 @@
 		if (empty($ADODB_INCLUDED_LIB)) include_once(ADODB_DIR.'/adodb-lib.inc.php');
 		return _adodb_backtrace($printOrArr,$levels);
 	}
-	
-} // defined
+
+
+}
 ?>
\ No newline at end of file
diff -ruN 0.761/includes/classes/adodb/adodb-iterator.inc.php 0.762/includes/classes/adodb/adodb-iterator.inc.php
--- 0.761/includes/classes/adodb/adodb-iterator.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-iterator.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /*
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/adodb-lib.inc.php 0.762/includes/classes/adodb/adodb-lib.inc.php
--- 0.761/includes/classes/adodb/adodb-lib.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-lib.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -7,7 +7,7 @@
 $ADODB_INCLUDED_LIB = 1;
 
 /* 
- @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim\@natsoft.com.my). All rights reserved.
+ @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim\@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
@@ -584,8 +584,10 @@
 		if ($fieldUpdatedCount > 0 || $forceUpdate) {
 					// Get the table name from the existing query.
 			if (!empty($rs->tableName)) $tableName = $rs->tableName;
-			else preg_match("/FROM\s+".ADODB_TABLE_REGEX."/is", $rs->sql, $tableName);
-	
+			else {
+				preg_match("/FROM\s+".ADODB_TABLE_REGEX."/is", $rs->sql, $tableName);
+				$tableName = $tableName[1];
+			}
 			// Get the full where clause excluding the word "WHERE" from
 			// the existing query.
 			preg_match('/\sWHERE\s(.*)/is', $rs->sql, $whereClause);
@@ -602,11 +604,11 @@
 			if ($discard)
 				$whereClause[1] = substr($whereClause[1], 0, strlen($whereClause[1]) - strlen($discard[1]));
 			
-		$sql = 'UPDATE '.$tableName[1].' SET '.substr($setFields, 0, -2);
-		if (strlen($whereClause[1]) > 0) 
-			$sql .= ' WHERE '.$whereClause[1];
+			$sql = 'UPDATE '.$tableName.' SET '.substr($setFields, 0, -2);
+			if (strlen($whereClause[1]) > 0) 
+				$sql .= ' WHERE '.$whereClause[1];
 
-		return $sql;
+			return $sql;
 
 		} else {
 			return false;
@@ -945,10 +947,10 @@
 	return $qID;
 }
 
-
+# pretty print the debug_backtrace function
 function _adodb_backtrace($printOrArr=true,$levels=9999,$skippy=0)
 {
-	if (PHPVERSION() < 4.3) return '';
+	if (!function_exists('debug_backtrace')) return '';
 	 
 	$html =  (isset($_SERVER['HTTP_USER_AGENT']));
 	$fmt =  ($html) ? "</font><font color=#808080 size=-1> %% line %4d, file: <a href=\"file:/%s\">%s</a></font>" : "%% line %4d, file: %s";
diff -ruN 0.761/includes/classes/adodb/adodb-pager.inc.php 0.762/includes/classes/adodb/adodb-pager.inc.php
--- 0.761/includes/classes/adodb/adodb-pager.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-pager.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /*
-	V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+	V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
 	  Released under both BSD license and Lesser GPL library license. 
 	  Whenever there is any discrepancy between the two licenses, 
 	  the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/adodb-pear.inc.php 0.762/includes/classes/adodb/adodb-pear.inc.php
--- 0.761/includes/classes/adodb/adodb-pear.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-pear.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ * @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/adodb-perf.inc.php 0.762/includes/classes/adodb/adodb-perf.inc.php
--- 0.761/includes/classes/adodb/adodb-perf.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-perf.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
diff -ruN 0.761/includes/classes/adodb/adodb-php4.inc.php 0.762/includes/classes/adodb/adodb-php4.inc.php
--- 0.761/includes/classes/adodb/adodb-php4.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-php4.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /*
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/adodb-time.inc.php 0.762/includes/classes/adodb/adodb-time.inc.php
--- 0.761/includes/classes/adodb/adodb-time.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-time.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 /**
 ADOdb Date Library, part of the ADOdb abstraction library
-Download: http://php.weblogs.com/adodb_date_time_library
+Download: http://phplens.com/phpeverywhere/
 
 PHP native date functions use integer timestamps for computations.
 Because of this, dates are restricted to the years 1901-2038 on Unix 
@@ -241,12 +241,14 @@
 
 
 CHANGELOG
+- 08 Sept 2005 0.22
+In adodb_date2(), $is_gmt not supported properly. Fixed.
 
-- 18 July  2005  0.18
-- In PHP 4.3.11, the 'r' format has changed. Leading 0 in day is added. Changed for compat.
-- Added support for negative months in adodb_mktime().
+- 18 July  2005 0.21
+In PHP 4.3.11, the 'r' format has changed. Leading 0 in day is added. Changed for compat.
+Added support for negative months in adodb_mktime().
 
-- 24 Feb 2005 
+- 24 Feb 2005 0.20
 Added limited strftime/gmstrftime support. x10 improvement in performance of adodb_date().
 
 - 21 Dec 2004 0.17
@@ -359,7 +361,7 @@
 /*
 	Version Number
 */
-define('ADODB_DATE_VERSION',0.18);
+define('ADODB_DATE_VERSION',0.22);
 
 /*
 	This code was originally for windows. But apparently this problem happens 
@@ -695,6 +697,28 @@
 
 */
 
+
+$_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
+$_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31);
+	
+function adodb_validdate($y,$m,$d)
+{
+global $_month_table_normal,$_month_table_leaf;
+
+	if (_adodb_is_leap_year($y)) $marr =& $_month_table_leaf;
+	else $marr =& $_month_table_normal;
+	
+	if ($m > 12 || $m < 1) return false;
+	
+	if ($d > 31 || $d < 1) return false;
+	
+	if ($marr[$m] < $d) return false;
+	
+	if ($y < 1000 && $y > 3000) return false;
+	
+	return true;
+}
+
 /**
 	Low-level function that returns the getdate() array. We have a special
 	$fast flag, which if set to true, will return fewer array values,
@@ -703,6 +727,7 @@
 function _adodb_getdate($origd=false,$fast=false,$is_gmt=false)
 {
 static $YRS;
+global $_month_table_normal,$_month_table_leaf;
 
 	$d =  $origd - ($is_gmt ? 0 : adodb_get_gmt_diff());
 	
@@ -912,8 +937,8 @@
 		if ($rr[1] <= 100 && $rr[2]<= 1) return adodb_date($fmt,false,$is_gmt);
 	
 		// h-m-s-MM-DD-YY
-		if (!isset($rr[5])) $d = adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1]);
-		else $d = @adodb_mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1]);
+		if (!isset($rr[5])) $d = adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1],false,$is_gmt);
+		else $d = @adodb_mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1],false,$is_gmt);
 	}
 	
 	return adodb_date($fmt,$d,$is_gmt);
@@ -1262,11 +1287,11 @@
 			case 'S': $fmtdate .= 's'; break;
 			case 't': $fmtdate .= "\t"; break;
 			case 'T': $fmtdate .= 'H:i:s'; break;
-			case 'u': $fmtdate .= '?u'; $parseu = true; break; // wrong strftime=1-based, date=0-basde
+			case 'u': $fmtdate .= '?u'; $parseu = true; break; // wrong strftime=1-based, date=0-based
 			case 'U': $fmtdate .= '?U'; $parseU = true; break;// wrong strftime=1-based, date=0-based
 			case 'x': $fmtdate .= $ADODB_DATE_LOCALE[0]; break;
 			case 'X': $fmtdate .= $ADODB_DATE_LOCALE[1]; break;
-			case 'w': $fmtdate .= '?w'; $parseu = true; break; // wrong strftime=1-based, date=0-basde
+			case 'w': $fmtdate .= '?w'; $parseu = true; break; // wrong strftime=1-based, date=0-based
 			case 'W': $fmtdate .= '?W'; $parseU = true; break;// wrong strftime=1-based, date=0-based
 			case 'y': $fmtdate .= 'y'; break;
 			case 'Y': $fmtdate .= 'Y'; break;
diff -ruN 0.761/includes/classes/adodb/adodb-xmlschema.inc.php 0.762/includes/classes/adodb/adodb-xmlschema.inc.php
--- 0.761/includes/classes/adodb/adodb-xmlschema.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/adodb-xmlschema.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -12,7 +12,7 @@
  *
  * Last Editor: $Author: markwest $
  * @author Richard Tango-Lowy & Dan Cech
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
  *
  * @package axmls
  * @tutorial getting_started.pkg
@@ -1195,7 +1195,7 @@
 * @tutorial getting_started.pkg
 *
 * @author Richard Tango-Lowy & Dan Cech
-* @version $Revision: 1.7 $
+* @version $Revision: 1.8 $
 *
 * @package axmls
 */
@@ -1702,6 +1702,13 @@
 		return $result;
 	}
 	
+	// compat for pre-4.3 - jlim
+	function _file_get_contents($path)
+	{
+		if (function_exists('file_get_contents')) return file_get_contents($path);
+		return join('',file($path));
+	}
+	
 	/**
 	* Converts an XML schema file to the specified DTD version.
 	*
@@ -1730,7 +1737,7 @@
 		}
 		
 		if( $version == $newVersion ) {
-			$result = file_get_contents( $filename );
+			$result = _file_get_contents( $filename );
 			
 			// remove unicode BOM if present
 			if( substr( $result, 0, 3 ) == sprintf( '%c%c%c', 239, 187, 191 ) ) {
@@ -1769,7 +1776,7 @@
 					return FALSE;
 				}
 				
-				$schema = file_get_contents( $schema );
+				$schema = _file_get_contents( $schema );
 				break;
 			case 'string':
 			default:
@@ -1780,7 +1787,7 @@
 		
 		$arguments = array (
 			'/_xml' => $schema,
-			'/_xsl' => file_get_contents( $xsl_file )
+			'/_xsl' => _file_get_contents( $xsl_file )
 		);
 		
 		// create an XSLT processor
diff -ruN 0.761/includes/classes/adodb/contrib/toxmlrpc.inc.php 0.762/includes/classes/adodb/contrib/toxmlrpc.inc.php
--- 0.761/includes/classes/adodb/contrib/toxmlrpc.inc.php	2005-03-22 11:12:55.000000000 -0600
+++ 0.762/includes/classes/adodb/contrib/toxmlrpc.inc.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,157 +0,0 @@
-<?php
-    /**
-    * Helper functions to convert between ADODB recordset objects and XMLRPC values.
-    * Uses John Lim's AdoDB and Edd Dumbill's phpxmlrpc libs
-    * 
-    * @author Daniele Baroncelli
-    * @author Gaetano Giunta
-    * @copyright (c) 2003 Giunta/Baroncelli. All rights reserved.
-    * 
-    * @todo some more error checking here and there
-    * @todo document the xmlrpc-struct used to encode recordset info
-    */
-
-    /**
-    * Include the main libraries
-    */    
-    require_once('xmlrpc.inc');
-    require_once('adodb.inc.php');
-            
-    /**
-    * Builds an xmlrpc struct value out of an AdoDB recordset
-    */
-    function rs2xmlrpcval(&$adodbrs) {
-
-        $numfields = $adodbrs->FieldCount();
-        $numrecords = $adodbrs->RecordCount();
-
-        // build structure holding recordset information
-        $fieldstruct = array();
-        for ($i = 0; $i < $numfields; $i++) {
-            $fld = $adodbrs->FetchField($i);
-            $fieldarray = array();
-            if (isset($fld->name))
-                $fieldarray["name"] = new xmlrpcval ($fld->name);
-            if (isset($fld->type))
-                $fieldarray["type"] = new xmlrpcval ($fld->type);
-            if (isset($fld->max_length))
-                $fieldarray["max_length"] = new xmlrpcval ($fld->max_length, "int");
-            if (isset($fld->not_null))
-                $fieldarray["not_null"] = new xmlrpcval ($fld->not_null, "boolean");
-            if (isset($fld->has_default))
-                $fieldarray["has_default"] = new xmlrpcval ($fld->has_default, "boolean");
-            if (isset($fld->default_value))
-                $fieldarray["default_value"] = new xmlrpcval ($fld->default_value);
-            $fieldstruct[$i] = new xmlrpcval ($fieldarray, "struct");
-        }
-        $fieldcount = new xmlrpcval ($numfields, "int");
-        $recordcount = new xmlrpcval ($numrecords, "int");
-        $sql = new xmlrpcval ($adodbrs->sql);
-        $fieldinfo = new xmlrpcval ($fieldstruct, "array");
-
-        $header = new xmlrpcval ( array(
-                "fieldcount" => $fieldcount,
-                "recordcount" => $recordcount,
-                "sql" => $sql,
-                "fieldinfo" => $fieldinfo
-                ), "struct");
-
-        // build structure containing recordset data
-        $rows = array();
-        while (!$adodbrs->EOF) {
-            $columns = array();
-            // This should work on all cases of fetch mode: assoc, num, both or default
-            if ($adodbrs->fetchMode == 'ADODB_FETCH_BOTH' || count($adodbrs->fields) == 2 * $adodbrs->FieldCount())
-                for ($i = 0; $i < $numfields; $i++)
-                    if ($columns[$i] === null)
-                        $columns[$i] = new xmlrpcval ('');
-                    else
-                        $columns[$i] = xmlrpc_encode ($adodbrs->fields[$i]);
-            else
-                foreach ($adodbrs->fields as $val)
-                    if ($val === null)
-                        $columns[$i] = new xmlrpcval ('');
-                    else
-                        $columns[] = xmlrpc_encode ($val);
-
-            $rows[] = new xmlrpcval ($columns, "array");
-
-            $adodbrs->MoveNext();
-        }
-        $body = new xmlrpcval ($rows, "array");
-
-        // put it all together and build final xmlrpc struct
-        $xmlrpcrs = new xmlrpcval ( array(
-                "header" => $header,
-                "body" => $body,
-                ), "struct");
-
-        return $xmlrpcrs;
-
-    }
-
-    /**
-    * Returns an xmlrpc struct value as string out of an AdoDB recordset
-    */    
-    function rs2xmlrpcstring (&$adodbrs) {
-        $xmlrpc = rs2xmlrpcval ($adodbrs);
-        if ($xmlrpc)
-          return $xmlrpc->serialize();
-        else
-          return null;
-    }
-
-    /**
-    * Given a well-formed xmlrpc struct object returns an AdoDB object
-    * 
-    * @todo add some error checking on the input value
-    */
-    function xmlrpcval2rs (&$xmlrpcval) {
-
-        $fields_array = array();
-        $data_array = array();
- 
-        // rebuild column information  
-        $header =& $xmlrpcval->structmem('header');
-        
-        $numfields = $header->structmem('fieldcount');
-        $numfields = $numfields->scalarval();
-        $numrecords = $header->structmem('recordcount');
-        $numrecords = $numrecords->scalarval();
-        $sqlstring = $header->structmem('sql');
-        $sqlstring = $sqlstring->scalarval();
-        
-        $fieldinfo =& $header->structmem('fieldinfo');
-        for ($i = 0; $i < $numfields; $i++) {
-            $temp =& $fieldinfo->arraymem($i);
-            $fld = new ADOFieldObject();
-            while (list($key,$value) = $temp->structeach()) {
-                if ($key == "name") $fld->name = $value->scalarval();
-                if ($key == "type") $fld->type = $value->scalarval();
-                if ($key == "max_length") $fld->max_length = $value->scalarval();
-                if ($key == "not_null") $fld->not_null = $value->scalarval();
-                if ($key == "has_default") $fld->has_default = $value->scalarval();
-                if ($key == "default_value") $fld->default_value = $value->scalarval();
-            } // while
-            $fields_array[] = $fld;
-        } // for
-
-        // fetch recordset information into php array
-        $body =& $xmlrpcval->structmem('body');
-        for ($i = 0; $i < $numrecords; $i++) {
-            $data_array[$i]= array();
-            $xmlrpcrs_row =& $body->arraymem($i);
-            for ($j = 0; $j < $numfields; $j++) {
-                $temp =& $xmlrpcrs_row->arraymem($j);
-                $data_array[$i][$j] = $temp->scalarval();
-            } // for j
-        } // for i
-
-        // finally build in-memory recordset object and return it
-        $rs = new ADORecordSet_array();
-        $rs->InitArrayFields($data_array,$fields_array);
-        return $rs;
-
-    }
-
-?>
Files 0.761/includes/classes/adodb/cute_icons_for_site/adodb2.gif and 0.762/includes/classes/adodb/cute_icons_for_site/adodb2.gif differ
Files 0.761/includes/classes/adodb/cute_icons_for_site/adodb2.png and 0.762/includes/classes/adodb/cute_icons_for_site/adodb2.png differ
Files 0.761/includes/classes/adodb/cute_icons_for_site/adodb.gif and 0.762/includes/classes/adodb/cute_icons_for_site/adodb.gif differ
Files 0.761/includes/classes/adodb/cute_icons_for_site/adodb.png and 0.762/includes/classes/adodb/cute_icons_for_site/adodb.png differ
diff -ruN 0.761/includes/classes/adodb/datadict/datadict-access.inc.php 0.762/includes/classes/adodb/datadict/datadict-access.inc.php
--- 0.761/includes/classes/adodb/datadict/datadict-access.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/datadict/datadict-access.inc.php	2005-10-10 09:04:06.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/datadict/datadict-db2.inc.php 0.762/includes/classes/adodb/datadict/datadict-db2.inc.php
--- 0.761/includes/classes/adodb/datadict/datadict-db2.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/datadict/datadict-db2.inc.php	2005-10-10 09:04:06.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -71,7 +71,7 @@
 	}
 	
 	
-	function xChangeTableSQL($tablename, $flds, $tableoptions = false)
+	function ChangeTableSQL($tablename, $flds, $tableoptions = false)
 	{
 		
 		/**
diff -ruN 0.761/includes/classes/adodb/datadict/datadict-firebird.inc.php 0.762/includes/classes/adodb/datadict/datadict-firebird.inc.php
--- 0.761/includes/classes/adodb/datadict/datadict-firebird.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/datadict/datadict-firebird.inc.php	2005-10-10 09:04:06.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/datadict/datadict-generic.inc.php 0.762/includes/classes/adodb/datadict/datadict-generic.inc.php
--- 0.761/includes/classes/adodb/datadict/datadict-generic.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/datadict/datadict-generic.inc.php	2005-10-10 09:04:06.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/datadict/datadict-ibase.inc.php 0.762/includes/classes/adodb/datadict/datadict-ibase.inc.php
--- 0.761/includes/classes/adodb/datadict/datadict-ibase.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/datadict/datadict-ibase.inc.php	2005-10-10 09:04:06.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/datadict/datadict-informix.inc.php 0.762/includes/classes/adodb/datadict/datadict-informix.inc.php
--- 0.761/includes/classes/adodb/datadict/datadict-informix.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/datadict/datadict-informix.inc.php	2005-10-10 09:04:06.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/datadict/datadict-mssql.inc.php 0.762/includes/classes/adodb/datadict/datadict-mssql.inc.php
--- 0.761/includes/classes/adodb/datadict/datadict-mssql.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/datadict/datadict-mssql.inc.php	2005-10-10 09:04:06.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/datadict/datadict-mysql.inc.php 0.762/includes/classes/adodb/datadict/datadict-mysql.inc.php
--- 0.761/includes/classes/adodb/datadict/datadict-mysql.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/datadict/datadict-mysql.inc.php	2005-10-10 09:04:06.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/datadict/datadict-oci8.inc.php 0.762/includes/classes/adodb/datadict/datadict-oci8.inc.php
--- 0.761/includes/classes/adodb/datadict/datadict-oci8.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/datadict/datadict-oci8.inc.php	2005-10-10 09:04:06.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/datadict/datadict-postgres.inc.php 0.762/includes/classes/adodb/datadict/datadict-postgres.inc.php
--- 0.761/includes/classes/adodb/datadict/datadict-postgres.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/datadict/datadict-postgres.inc.php	2005-10-10 09:04:06.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -21,6 +21,7 @@
 	var $addCol = ' ADD COLUMN';
 	var $quote = '"';
 	var $renameTable = 'ALTER TABLE %s RENAME TO %s'; // at least since 7.1
+	var $dropTable = 'DROP TABLE %s CASCADE';
 	
 	function MetaType($t,$len=-1,$fieldobj=false)
 	{
@@ -134,10 +135,11 @@
 			if (($not_null = preg_match('/NOT NULL/i',$v))) {
 				$v = preg_replace('/NOT NULL/i','',$v);
 			}
-			if (preg_match('/^([^ ]+) .*(DEFAULT [^ ]+)/',$v,$matches)) {
+			if (preg_match('/^([^ ]+) .*DEFAULT ([^ ]+)/',$v,$matches)) {
 				list(,$colname,$default) = $matches;
-				$sql[] = $alter . str_replace($default,'',$v);
-				$sql[] = 'ALTER TABLE '.$tabname.' ALTER COLUMN '.$colname.' SET ' . $default;
+				$sql[] = $alter . str_replace('DEFAULT '.$default,'',$v);
+				$sql[] = 'UPDATE '.$tabname.' SET '.$colname.'='.$default;
+				$sql[] = 'ALTER TABLE '.$tabname.' ALTER COLUMN '.$colname.' SET DEFAULT ' . $default;
 			} else {				
 				$sql[] = $alter . $v;
 			}
@@ -214,7 +216,7 @@
 				// we need to explicit convert varchar to a number to be able to do an AlterColumn of a char column to a nummeric one
 				if (preg_match('/'.$fld->name.' (I|I2|I4|I8|N|F)/i',$tableflds,$matches) && 
 					in_array($fld->type,array('varchar','char','text','bytea'))) {
-					$copyflds[] = "to_number($fld->name,'S99D99')";
+					$copyflds[] = "to_number($fld->name,'S9999999999999D99')";
 				} else {
 					$copyflds[] = $fld->name;
 				}
diff -ruN 0.761/includes/classes/adodb/datadict/datadict-sybase.inc.php 0.762/includes/classes/adodb/datadict/datadict-sybase.inc.php
--- 0.761/includes/classes/adodb/datadict/datadict-sybase.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/datadict/datadict-sybase.inc.php	2005-10-10 09:04:06.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/docs/docs-adodb.htm 0.762/includes/classes/adodb/docs/docs-adodb.htm
--- 0.761/includes/classes/adodb/docs/docs-adodb.htm	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/docs/docs-adodb.htm	2005-10-10 09:04:06.000000000 -0500
@@ -15,9 +15,9 @@
 <body bgcolor="#ffffff" text="black">
 
 <h2>ADOdb Library for PHP</h2>
-<p>V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim#natsoft.com)</p>
+<p>V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim#natsoft.com)</p>
 <p><font size="1">This software is dual licensed using BSD-Style and LGPL. This 
-  means you can use it in compiled proprietary and commercial products.</font></p>
+  means you can use it in compiled proprfietary and commercial products.</font></p>
   
 
 	<p>Useful ADOdb links:  <a href="http://adodb.sourceforge.net/#download">Download</a> &nbsp; <a href="http://adodb.sourceforge.net/#docs">Other Docs</a>
@@ -520,7 +520,6 @@
 catch exceptions on errors as they occur.
 <pre>	<b>include("../adodb-exceptions.inc.php");</b> <br>	include("../adodb.inc.php");	 <br>	try { <br>		$db = NewADOConnection("oci8"); <br>		$db-&gt;Connect('','scott','bad-password'); <br>	} catch (exception $e) { <br>		var_dump($e); <br>		adodb_backtrace($e-&gt;gettrace());<br>	} <br></pre>
 <p>Note that reaching EOF is <b>not</b> considered an error nor an exception.
-If you want to use the default ADOdb drivers return false.
 </p></li></ul> 
 <h3><a name="drivers"></a>Databases Supported</h3>
 The <i>name</i> below is the value you pass to NewADOConnection($name) to create a  connection object for that database.
@@ -1051,7 +1050,7 @@
 <pre>
     $record["firstname"] = "Caroline"; 
     $record["lastname"] = "Smith"; # Update Caroline's lastname from Miranda to Smith 
-    $insertSQL = $conn->AutoExecute($rs, $record, 'UPDATE', 'WHERE id = 1'); 
+    $insertSQL = $conn->AutoExecute($rs, $record, 'UPDATE', 'id = 1'); 
 </pre>
 <p>
 The rest of this section is out-of-date:
@@ -2812,7 +2811,24 @@
   PHP</a>. </font></p>
 
 <h2><font>Change Log<a name="Changes"></a><a name="changes"></a><a name="changelog"></a></font></h2>
-<p><a name="4.65"></a><b>4.65 ??  2005</b>
+
+<p><a name="4.66"></a><b>4.66 ?? July  2005</b>
+<p>ExecuteCursor() in oci8 did not clean up properly on failure. Fixed.
+<p>Updated xmlschema.dtd, by "Alec Smecher" asmecher#smecher.bc.ca
+<p>Hardened SelectLimit, typecasting nrows and offset to integer.
+<p>Fixed misc bugs in AutoExecute() and GetInsertSQL().
+<p>Added $conn->database as the property holding the database name. The older $conn->databaseName is retained for backward
+compat.
+<p>Changed _adodb_backtrace() compat check to use function_exists().
+<p>Bug in postgresql MetaIndexes fixed. Thx Kevin Jamieson. 
+<p>Improved OffsetDate for MySQL, reducing rounding error.
+<p>Metacolumns added to sqlite. Thx Mark Newnham.
+<p>PHP 4.4 compat fixes for GetAssoc().
+<p>Added postgresql bind support for php 5.1. Thx Cristiano da Cunha Duarte
+<p>OffsetDate() fixes for postgresql, typecasting strings to date or timestamp.
+<p>DBTimeStamp formats for mssql, odbc_mssql and postgresql made to conform with other db's.
+<p>Changed PDO constants from PDO_ to PDO:: to support latest spec.
+<p><a name="4.65"></a><b>4.65 22 July  2005</b>
 <p>Reverted 'X' in mssql datadict to 'TEXT' to be compat with mssql driver. However now you can 
 set $datadict->typeX = 'varchar(4000)' or 'TEXT' or 'CLOB' for mssql and oci8 drivers. 
 <p>Added charset support when using DSN for Oracle.
@@ -2822,7 +2838,7 @@
 <p>CompleteTrans(false) did not return false. Fixed. Thx to JMF.
 <p>AutoExecute() did not work with Oracle. Fixed. Thx Jos Moreira.
 <p>MetaType() added to connection object.
-<p>More PHP 4.4 reference return fixes.
+<p>More PHP 4.4 reference return fixes. Thx Ryan C Bonham and others.
 
 <p><a name="4.64"></a><b>4.64 20 June 2005</b>
 <p>In datadict, if the default field value is set to '', then it is not applied when the field is created. Fixed by Eugenio.
diff -ruN 0.761/includes/classes/adodb/docs/docs-datadict.htm 0.762/includes/classes/adodb/docs/docs-datadict.htm
--- 0.761/includes/classes/adodb/docs/docs-datadict.htm	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/docs/docs-datadict.htm	2005-10-10 09:04:06.000000000 -0500
@@ -20,7 +20,7 @@
 </head>
 <body style="background-color: rgb(255, 255, 255);">
 <h2>ADOdb Data Dictionary Library for PHP</h2>
-<p>V4.65 22 July 2005 (c) 2000-2005 John Lim (<a
+<p>V4.66 28 Sept 2005 (c) 2000-2005 John Lim (<a
  href="mailto:jlim#natsoft.com.my">jlim#natsoft.com.my</a>).<br>
 AXMLS (c) 2004 ars Cognita, Inc</p>
 <p><font size="1">This software is dual licensed using BSD-Style and
@@ -43,7 +43,7 @@
 generic ODBC.
 </p>
 <h3>Example Usage</h3>
-<pre>  include_once('adodb.inc.php');<br>  <font color="#006600"># First create a normal connection</font><br>  $db-&gt;NewADOConnection('mysql');<br>  $db-&gt;Connect(...);<br><br>  <font
+<pre>  include_once('adodb.inc.php');<br>  <font color="#006600"># First create a normal connection</font><br>  $db = NewADOConnection('mysql');<br>  $db-&gt;Connect(...);<br><br>  <font
  color="#006600"># Then create a data dictionary object, using this connection</font><br>  $dict = <strong>NewDataDictionary</strong>($db);<br><br>  <font
  color="#006600"># We have a portable declarative data dictionary format in ADOdb, similar to SQL.<br>  # Field types use 1 character codes, and fields are separated by commas.<br>  # The following example creates three fields: "col1", "col2" and "col3":</font><br>  $flds = " <br>  <font
  color="#663300"><strong> col1 C(32) NOTNULL DEFAULT 'abc',<br>   col2 I  DEFAULT 0,<br>   col3 N(12.2)</strong></font><br>  ";<br><br>  <font
diff -ruN 0.761/includes/classes/adodb/docs/docs-perf.htm 0.762/includes/classes/adodb/docs/docs-perf.htm
--- 0.761/includes/classes/adodb/docs/docs-perf.htm	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/docs/docs-perf.htm	2005-10-10 09:04:06.000000000 -0500
@@ -18,7 +18,7 @@
 </head>
 <body>
 <h3>The ADOdb Performance Monitoring Library</h3>
-<p>V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim#natsoft.com.my)</p>
+<p>V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim#natsoft.com.my)</p>
 <p><font size="1">This software is dual licensed using BSD-Style and
 LGPL. This means you can use it in compiled proprietary and commercial
 products.</font></p>
diff -ruN 0.761/includes/classes/adodb/docs/docs-session.htm 0.762/includes/classes/adodb/docs/docs-session.htm
--- 0.761/includes/classes/adodb/docs/docs-session.htm	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/docs/docs-session.htm	2005-10-10 09:04:06.000000000 -0500
@@ -21,7 +21,7 @@
 <body style="background-color: rgb(255, 255, 255);">
 <h3>ADODB Session Management Manual</h3>
 <p>
-V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim#natsoft.com.my)
+V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim#natsoft.com.my)
 </p>
 <p> <font size="1">This software is dual licensed using BSD-Style and
 LGPL. This means you can use it in compiled proprietary and commercial
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-access.inc.php 0.762/includes/classes/adodb/drivers/adodb-access.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-access.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-access.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-ado5.inc.php 0.762/includes/classes/adodb/drivers/adodb-ado5.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-ado5.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-ado5.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -561,8 +561,11 @@
 			case 135: // timestamp
 				if (!strlen((string)$f->value)) $this->fields[] = false;
 				else {
-					if (!is_numeric($f->value)) $val = variant_date_to_timestamp($f->value);
-					else $val = $f->value;
+					if (!is_numeric($f->value)) # $val = variant_date_to_timestamp($f->value);
+						// VT_DATE stores dates as (float) fractional days since 1899/12/30 00:00:00
+						$val= (float) variant_cast($f->value,VT_R8)*3600*24-2209161600;
+					else 
+						$val = $f->value;
 					$this->fields[] = adodb_date('Y-m-d H:i:s',$val);
 				}
 				break;			
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-ado_access.inc.php 0.762/includes/classes/adodb/drivers/adodb-ado_access.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-ado_access.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-ado_access.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
 Released under both BSD license and Lesser GPL library license. 
 Whenever there is any discrepancy between the two licenses, 
 the BSD license will take precedence. See License.txt. 
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-ado.inc.php 0.762/includes/classes/adodb/drivers/adodb-ado.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-ado.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-ado.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -553,8 +553,11 @@
 			case 135: // timestamp
 				if (!strlen((string)$f->value)) $this->fields[] = false;
 				else {
-					if (!is_numeric($f->value)) $val = variant_date_to_timestamp($f->value);
-					else $val = $f->value;
+					if (!is_numeric($f->value)) # $val = variant_date_to_timestamp($f->value);
+						// VT_DATE stores dates as (float) fractional days since 1899/12/30 00:00:00
+						$val=(float) variant_cast($f->value,VT_R8)*3600*24-2209161600;
+					else 
+						$val = $f->value;
 					$this->fields[] = adodb_date('Y-m-d H:i:s',$val);
 				}
 				break;			
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-ado_mssql.inc.php 0.762/includes/classes/adodb/drivers/adodb-ado_mssql.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-ado_mssql.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-ado_mssql.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-borland_ibase.inc.php 0.762/includes/classes/adodb/drivers/adodb-borland_ibase.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-borland_ibase.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-borland_ibase.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-csv.inc.php 0.762/includes/classes/adodb/drivers/adodb-csv.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-csv.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-csv.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -9,6 +9,10 @@
   Currently unsupported: MetaDatabases, MetaTables and MetaColumns, and also inputarr in Execute.
   Native types have been converted to MetaTypes.
   Transactions not supported yet.
+  
+  Limitation of url length. For IIS, see MaxClientRequestBuffer registry value.
+  
+	  http://support.microsoft.com/default.aspx?scid=kb;en-us;260694
 */ 
 
 // security - hide paths
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-db2.inc.php 0.762/includes/classes/adodb/drivers/adodb-db2.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-db2.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-db2.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -274,6 +274,7 @@
 	
 	function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputArr=false)
 	{
+		$nrows = (integer) $nrows;
 		if ($offset <= 0) {
 		// could also use " OPTIMIZE FOR $nrows ROWS "
 			if ($nrows >= 0) $sql .=  " FETCH FIRST $nrows ROWS ONLY ";
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-fbsql.inc.php 0.762/includes/classes/adodb/drivers/adodb-fbsql.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-fbsql.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-fbsql.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
- @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
  Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -118,7 +118,7 @@
 	// returns true or false
 	function SelectDB($dbName) 
 	{
-		$this->databaseName = $dbName;
+		$this->database = $dbName;
 		if ($this->_connectionID) {
 			return @fbsql_select_db($dbName,$this->_connectionID);		
 		}
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-firebird.inc.php 0.762/includes/classes/adodb/drivers/adodb-firebird.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-firebird.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-firebird.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -46,6 +46,8 @@
 	//		SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2
 	function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $secs=0)
 	{
+		$nrows = (integer) $nrows;
+		$offset = (integer) $offset;
 		$str = 'SELECT ';
 		if ($nrows >= 0) $str .= "FIRST $nrows "; 
 		$str .=($offset>=0) ? "SKIP $offset " : '';
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-ibase.inc.php 0.762/includes/classes/adodb/drivers/adodb-ibase.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-ibase.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-ibase.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.  
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.  
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-informix72.inc.php 0.762/includes/classes/adodb/drivers/adodb-informix72.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-informix72.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-informix72.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim. All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-informix.inc.php 0.762/includes/classes/adodb/drivers/adodb-informix.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-informix.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-informix.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+* @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
 * Released under both BSD license and Lesser GPL library license.
 * Whenever there is any discrepancy between the two licenses,
 * the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-ldap.inc.php 0.762/includes/classes/adodb/drivers/adodb-ldap.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-ldap.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-ldap.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
    Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-mssql.inc.php 0.762/includes/classes/adodb/drivers/adodb-mssql.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-mssql.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-mssql.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -75,7 +75,7 @@
 	var $dataProvider = "mssql";
 	var $replaceQuote = "''"; // string to use to replace quotes
 	var $fmtDate = "'Y-m-d'";
-	var $fmtTimeStamp = "'Y-m-d h:i:sA'";
+	var $fmtTimeStamp = "'Y-m-d H:i:s'";
 	var $hasInsertID = true;
 	var $substr = "substring";
 	var $length = 'len';
@@ -126,6 +126,7 @@
 		
 		//$row = $this->GetRow("execute sp_server_info 2");
 		
+		
 		if ($this->fetchMode === false) {
 			$ADODB_FETCH_MODE = $savem;
 		} else
@@ -400,13 +401,13 @@
 						 $tmpAr=$ar=array(); 
 						 while($tmpAr=@mssql_fetch_row($rs)) 
 								 $ar[]=$tmpAr[0]; 
-						@mssql_select_db($this->databaseName); 
+						@mssql_select_db($this->database); 
 						 if(sizeof($ar)) 
 								 return($ar); 
 						 else 
 								 return(false); 
 				 } else { 
-						 @mssql_select_db($this->databaseName); 
+						 @mssql_select_db($this->database); 
 						 return(false); 
 				 } 
 		 } 
@@ -457,7 +458,8 @@
  
 	function SelectDB($dbName) 
 	{
-		$this->databaseName = $dbName;
+		$this->database = $dbName;
+		$this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
 		if ($this->_connectionID) {
 			return @mssql_select_db($dbName);		
 		}
@@ -735,6 +737,7 @@
 		if ($mode === false) { 
 			global $ADODB_FETCH_MODE;
 			$mode = $ADODB_FETCH_MODE;
+
 		}
 		$this->fetchMode = $mode;
 		return $this->ADORecordSet($id,$mode);
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-mssqlpo.inc.php 0.762/includes/classes/adodb/drivers/adodb-mssqlpo.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-mssqlpo.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-mssqlpo.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+* @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
 * Released under both BSD license and Lesser GPL library license.
 * Whenever there is any discrepancy between the two licenses,
 * the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-mysqli.inc.php 0.762/includes/classes/adodb/drivers/adodb-mysqli.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-mysqli.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-mysqli.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -85,7 +85,7 @@
 			mysqli_options($this->_connectionID,$arr[0],$arr[1]);
 		}
 
-		if (!empty($this->port)) $argHostname .= ":".$this->port;
+		#if (!empty($this->port)) $argHostname .= ":".$this->port;
 		$ok = mysqli_real_connect($this->_connectionID,
  				    $argHostname,
  				    $argUsername,
@@ -434,39 +434,41 @@
 	
 	// "Innox - Juan Carlos Gonzalez" <jgonzalez#innox.com.mx>
 	function MetaForeignKeys( $table, $owner = FALSE, $upper = FALSE, $asociative = FALSE )
-     {
-         if ( !empty($owner) ) {
-            $table = "$owner.$table";
-         }
-         $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE %s', $table));
-         $create_sql     = $a_create_table[1];
-
-         $matches        = array();
-         $foreign_keys   = array();
-         if ( preg_match_all("/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", $create_sql, $matches) ) {
-             $num_keys = count($matches[0]);
-             for ( $i = 0;  $i < $num_keys;  $i ++ ) {
-                 $my_field  = explode('`, `', $matches[1][$i]);
-                 $ref_table = $matches[2][$i];
-                 $ref_field = explode('`, `', $matches[3][$i]);
-
-                 if ( $upper ) {
-                     $ref_table = strtoupper($ref_table);
-                 }
-
-                 $foreign_keys[$ref_table] = array();
-                 $num_fields               = count($my_field);
-                 for ( $j = 0;  $j < $num_fields;  $j ++ ) {
-                     if ( $asociative ) {
-                         $foreign_keys[$ref_table][$ref_field[$j]] = $my_field[$j];
-                     } else {
-                         $foreign_keys[$ref_table][] = "{$my_field[$j]}={$ref_field[$j]}";
-                     }
-                 }
-             }
-         }
-         return  $foreign_keys;
-     }
+	{
+	    if ( !empty($owner) ) {
+	       $table = "$owner.$table";
+	    }
+	    $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE %s', $table));
+		if ($associative) $create_sql = $a_create_table["Create Table"];
+	    else $create_sql  = $a_create_table[1];
+	
+	    $matches = array();
+	
+	    if (!preg_match_all("/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", $create_sql, $matches)) return false;
+	 	$foreign_keys = array();	 	 
+	    $num_keys = count($matches[0]);
+	    for ( $i = 0;  $i < $num_keys;  $i ++ ) {
+	        $my_field  = explode('`, `', $matches[1][$i]);
+	        $ref_table = $matches[2][$i];
+	        $ref_field = explode('`, `', $matches[3][$i]);
+	
+	        if ( $upper ) {
+	            $ref_table = strtoupper($ref_table);
+	        }
+	
+	        $foreign_keys[$ref_table] = array();
+	        $num_fields               = count($my_field);
+	        for ( $j = 0;  $j < $num_fields;  $j ++ ) {
+	            if ( $asociative ) {
+	                $foreign_keys[$ref_table][$ref_field[$j]] = $my_field[$j];
+	            } else {
+	                $foreign_keys[$ref_table][] = "{$my_field[$j]}={$ref_field[$j]}";
+	            }
+	        }
+	    }
+	    
+	    return  $foreign_keys;
+	}
 	
  	function &MetaColumns($table) 
 	{
@@ -540,7 +542,9 @@
 	function SelectDB($dbName) 
 	{
 //	    $this->_connectionID = $this->mysqli_resolve_link($this->_connectionID);
-	    $this->databaseName = $dbName;
+	    $this->database = $dbName;
+		$this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
+		
 	    if ($this->_connectionID) {
         	$result = @mysqli_select_db($this->_connectionID, $dbName);
 			if (!$result) {
@@ -598,7 +602,7 @@
 				else $a .= 'd';
 			}
 			
-			$fnarr =& array_merge( array($stmt,$a) , $inputarr);
+			$fnarr = array_merge( array($stmt,$a) , $inputarr);
 			$ret = call_user_func_array('mysqli_stmt_bind_param',$fnarr);
 
 			$ret = mysqli_stmt_execute($stmt);
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-mysql.inc.php 0.762/includes/classes/adodb/drivers/adodb-mysql.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-mysql.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-mysql.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -337,7 +337,8 @@
 	function OffsetDate($dayFraction,$date=false)
 	{		
 		if (!$date) $date = $this->sysDate;
-		return "from_unixtime(unix_timestamp($date)+($dayFraction)*24*3600)";
+		$fraction = $dayFraction * 24 * 3600;
+		return "from_unixtime(unix_timestamp($date)+$fraction)";
 	}
 	
 	// returns true or false
@@ -462,6 +463,7 @@
 	function SelectDB($dbName) 
 	{
 		$this->database = $dbName;
+		$this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
 		if ($this->_connectionID) {
 			return @mysql_select_db($dbName,$this->_connectionID);		
 		}
@@ -471,14 +473,14 @@
 	// parameters use PostgreSQL convention, not MySQL
 	function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs=0)
 	{
-		$offsetStr =($offset>=0) ? "$offset," : '';
+		$offsetStr =($offset>=0) ? ((integer)$offset)."," : '';
 		// jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
 		if ($nrows < 0) $nrows = '18446744073709551615'; 
 		
 		if ($secs)
-			$rs =& $this->CacheExecute($secs,$sql." LIMIT $offsetStr$nrows",$inputarr);
+			$rs =& $this->CacheExecute($secs,$sql." LIMIT $offsetStr".((integer)$nrows),$inputarr);
 		else
-			$rs =& $this->Execute($sql." LIMIT $offsetStr$nrows",$inputarr);
+			$rs =& $this->Execute($sql." LIMIT $offsetStr".((integer)$nrows),$inputarr);
 		return $rs;
 	}
 	
@@ -540,34 +542,37 @@
             $table = "$owner.$table";
          }
          $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE %s', $table));
-         $create_sql     = $a_create_table[1];
+		 if ($associative) $create_sql = $a_create_table["Create Table"];
+         else $create_sql  = $a_create_table[1];
 
-         $matches        = array();
-         $foreign_keys   = array();
-         if ( preg_match_all("/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", $create_sql, $matches) ) {
-             $num_keys = count($matches[0]);
-             for ( $i = 0;  $i < $num_keys;  $i ++ ) {
-                 $my_field  = explode('`, `', $matches[1][$i]);
-                 $ref_table = $matches[2][$i];
-                 $ref_field = explode('`, `', $matches[3][$i]);
+         $matches = array();
 
-                 if ( $upper ) {
-                     $ref_table = strtoupper($ref_table);
-                 }
+         if (!preg_match_all("/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", $create_sql, $matches)) return false;
+	     $foreign_keys = array();	 	 
+         $num_keys = count($matches[0]);
+         for ( $i = 0;  $i < $num_keys;  $i ++ ) {
+             $my_field  = explode('`, `', $matches[1][$i]);
+             $ref_table = $matches[2][$i];
+             $ref_field = explode('`, `', $matches[3][$i]);
+
+             if ( $upper ) {
+                 $ref_table = strtoupper($ref_table);
+             }
 
-                 $foreign_keys[$ref_table] = array();
-                 $num_fields               = count($my_field);
-                 for ( $j = 0;  $j < $num_fields;  $j ++ ) {
-                     if ( $asociative ) {
-                         $foreign_keys[$ref_table][$ref_field[$j]] = $my_field[$j];
-                     } else {
-                         $foreign_keys[$ref_table][] = "{$my_field[$j]}={$ref_field[$j]}";
-                     }
+             $foreign_keys[$ref_table] = array();
+             $num_fields = count($my_field);
+             for ( $j = 0;  $j < $num_fields;  $j ++ ) {
+                 if ( $asociative ) {
+                     $foreign_keys[$ref_table][$ref_field[$j]] = $my_field[$j];
+                 } else {
+                     $foreign_keys[$ref_table][] = "{$my_field[$j]}={$ref_field[$j]}";
                  }
              }
          }
+         
          return  $foreign_keys;
      }
+	 
 	
 }
 	
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-mysqlt.inc.php 0.762/includes/classes/adodb/drivers/adodb-mysqlt.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-mysqlt.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-mysqlt.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-netezza.inc.php 0.762/includes/classes/adodb/drivers/adodb-netezza.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-netezza.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-netezza.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
  
   First cut at the Netezza Driver by Josh Eldridge joshuae74#hotmail.com
  Based on the previous postgres drivers.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-oci805.inc.php 0.762/includes/classes/adodb/drivers/adodb-oci805.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-oci805.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-oci805.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ * @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-oci8.inc.php 0.762/includes/classes/adodb/drivers/adodb-oci8.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-oci8.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-oci8.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 /*
 
-  version V4.65 22 July 2005 (c) 2000-2005 John Lim. All rights reserved.
+  version V4.66 28 Sept 2005 (c) 2000-2005 John Lim. All rights reserved.
 
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
@@ -670,7 +670,7 @@
 		if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=EXACT');
 		$commit = $this->autoCommit;
 		if ($commit) $this->BeginTrans();
-		$rs = $this->Execute($sql,$arr);
+		$rs = $this->_Execute($sql,$arr);
 		if ($rez = !empty($rs)) $desc->save($val);
 		$desc->free();
 		if ($commit) $this->CommitTrans();
@@ -803,8 +803,10 @@
 			$hasref = false;
 			
 		$rs =& $this->Execute($stmt);
-		if ($rs->databaseType == 'array') OCIFreeCursor($stmt[4]);
-		else if ($hasref) $rs->_refcursor = $stmt[4];
+		if ($rs) {
+			if ($rs->databaseType == 'array') OCIFreeCursor($stmt[4]);
+			else if ($hasref) $rs->_refcursor = $stmt[4];
+		}
 		return $rs;
 	}
 	
@@ -1156,7 +1158,7 @@
 	 */
 	function qstr($s,$magic_quotes=false)
 	{	
-	$nofixquotes=false;
+		//$nofixquotes=false;
 	
 		if ($this->noNullStrings && strlen($s)==0)$s = ' ';
 		if (!$magic_quotes) {	
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-oci8po.inc.php 0.762/includes/classes/adodb/drivers/adodb-oci8po.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-oci8po.inc.php	2005-07-24 11:58:30.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-oci8po.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim. All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-odbc.inc.php 0.762/includes/classes/adodb/drivers/adodb-odbc.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-odbc.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-odbc.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-odbc_mssql.inc.php 0.762/includes/classes/adodb/drivers/adodb-odbc_mssql.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-odbc_mssql.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-odbc_mssql.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -23,7 +23,7 @@
 class  ADODB_odbc_mssql extends ADODB_odbc {	
 	var $databaseType = 'odbc_mssql';
 	var $fmtDate = "'Y-m-d'";
-	var $fmtTimeStamp = "'Y-m-d h:i:sA'";
+	var $fmtTimeStamp = "'Y-m-d H:i:s'";
 	var $_bindInputArray = true;
 	var $metaTablesSQL="select name,case when type='U' then 'T' else 'V' end from sysobjects where (type='U' or type='V') and (name not in ('sysallocations','syscolumns','syscomments','sysdepends','sysfilegroups','sysfiles','sysfiles1','sysforeignkeys','sysfulltextcatalogs','sysindexes','sysindexkeys','sysmembers','sysobjects','syspermissions','sysprotects','sysreferences','systypes','sysusers','sysalternates','sysconstraints','syssegments','REFERENTIAL_CONSTRAINTS','CHECK_CONSTRAINTS','CONSTRAINT_TABLE_USAGE','CONSTRAINT_COLUMN_USAGE','VIEWS','VIEW_TABLE_USAGE','VIEW_COLUMN_USAGE','SCHEMATA','TABLES','TABLE_CONSTRAINTS','TABLE_PRIVILEGES','COLUMNS','COLUMN_DOMAIN_USAGE','COLUMN_PRIVILEGES','DOMAINS','DOMAIN_CONSTRAINTS','KEY_COLUMN_USAGE'))";
 	var $metaColumnsSQL = "select c.name,t.name,c.length from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='%s'";
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-odbc_oracle.inc.php 0.762/includes/classes/adodb/drivers/adodb-odbc_oracle.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-odbc_oracle.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-odbc_oracle.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-odbtp.inc.php 0.762/includes/classes/adodb/drivers/adodb-odbtp.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-odbtp.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-odbtp.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence. See License.txt.
@@ -264,7 +264,8 @@
 		if (!@odbtp_select_db($dbName, $this->_connectionID)) {
 			return false;
 		}
-		$this->databaseName = $dbName;
+		$this->database = $dbName;
+		$this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
 		return true;
 	}
 	
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-odbtp_unicode.inc.php 0.762/includes/classes/adodb/drivers/adodb-odbtp_unicode.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-odbtp_unicode.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-odbtp_unicode.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-	V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+	V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence. See License.txt.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-oracle.inc.php 0.762/includes/classes/adodb/drivers/adodb-oracle.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-oracle.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-oracle.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-pdo.inc.php 0.762/includes/classes/adodb/drivers/adodb-pdo.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-pdo.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-pdo.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -20,31 +20,31 @@
 
 /*
 enum pdo_param_type {
-PDO_PARAM_NULL, 0
+PDO::PARAM_NULL, 0
 
 /* int as in long (the php native int type).
  * If you mark a column as an int, PDO expects get_col to return
  * a pointer to a long 
-PDO_PARAM_INT, 1
+PDO::PARAM_INT, 1
 
 /* get_col ptr should point to start of the string buffer 
-PDO_PARAM_STR, 2
+PDO::PARAM_STR, 2
 
 /* get_col: when len is 0 ptr should point to a php_stream *,
  * otherwise it should behave like a string. Indicate a NULL field
  * value by setting the ptr to NULL 
-PDO_PARAM_LOB, 3
+PDO::PARAM_LOB, 3
 
 /* get_col: will expect the ptr to point to a new PDOStatement object handle,
  * but this isn't wired up yet 
-PDO_PARAM_STMT, 4 /* hierarchical result set 
+PDO::PARAM_STMT, 4 /* hierarchical result set 
 
 /* get_col ptr should point to a zend_bool 
-PDO_PARAM_BOOL, 5
+PDO::PARAM_BOOL, 5
 
 
 /* magic flag to denote a parameter as being input/output 
-PDO_PARAM_INPUT_OUTPUT = 0x80000000
+PDO::PARAM_INPUT_OUTPUT = 0x80000000
 };
 */
 	
@@ -69,7 +69,7 @@
 	function _init($parentDriver)
 	{
 		$parentDriver->_bindInputArray = false;
-		#$parentDriver->_connectionID->setAttribute(PDO_MYSQL_ATTR_USE_BUFFERED_QUERY,true);
+		#$parentDriver->_connectionID->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
 	}
 	
 	function ServerInfo()
@@ -128,6 +128,7 @@
 		$this->sysTimeStamp = $d->sysTimeStamp;
 		$this->random = $d->random;
 		$this->concat_operator = $d->concat_operator;
+		$this->nameQuote = $d->nameQuote;
 		
 		$d->_init($this);
 	}
@@ -155,17 +156,17 @@
 		
 		if ($this->_connectionID) {
 			switch(ADODB_ASSOC_CASE){
-			case 0: $m = PDO_CASE_LOWER; break;
-			case 1: $m = PDO_CASE_UPPER; break;
+			case 0: $m = PDO::CASE_LOWER; break;
+			case 1: $m = PDO::CASE_UPPER; break;
 			default:
-			case 2: $m = PDO_CASE_NATURAL; break;
+			case 2: $m = PDO::CASE_NATURAL; break;
 			}
 			
-			//$this->_connectionID->setAttribute(PDO_ATTR_ERRMODE,PDO_ERRMODE_SILENT );
-			$this->_connectionID->setAttribute(PDO_ATTR_CASE,$m);
+			//$this->_connectionID->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_SILENT );
+			$this->_connectionID->setAttribute(PDO::ATTR_CASE,$m);
 			
 			$class = 'ADODB_pdo_'.$this->dsnType;
-			//$this->_connectionID->setAttribute(PDO_ATTR_AUTOCOMMIT,true);
+			//$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
 			switch($this->dsnType) {
 			case 'oci':
 			case 'mysql':
@@ -265,7 +266,7 @@
 		if ($this->transOff) return true; 
 		$this->transCnt += 1;
 		$this->_autocommit = false;
-		$this->_connectionID->setAttribute(PDO_ATTR_AUTOCOMMIT,false);
+		$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,false);
 		return $this->_connectionID->beginTransaction();
 	}
 	
@@ -278,7 +279,7 @@
 		$this->_autocommit = true;
 		
 		$ret = $this->_connectionID->commit();
-		$this->_connectionID->setAttribute(PDO_ATTR_AUTOCOMMIT,true);
+		$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
 		return $ret;
 	}
 	
@@ -290,7 +291,7 @@
 		$this->_autocommit = true;
 		
 		$ret = $this->_connectionID->rollback();
-		$this->_connectionID->setAttribute(PDO_ATTR_AUTOCOMMIT,true);
+		$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
 		return $ret;
 	}
 	
@@ -440,11 +441,11 @@
 		}
 		$this->adodbFetchMode = $mode;
 		switch($mode) {
-		case ADODB_FETCH_NUM: $mode = PDO_FETCH_NUM; break;
-		case ADODB_FETCH_ASSOC:  $mode = PDO_FETCH_ASSOC; break;
+		case ADODB_FETCH_NUM: $mode = PDO::FETCH_NUM; break;
+		case ADODB_FETCH_ASSOC:  $mode = PDO::FETCH_ASSOC; break;
 		
 		case ADODB_FETCH_BOTH: 
-		default: $mode = PDO_FETCH_BOTH; break;
+		default: $mode = PDO::FETCH_BOTH; break;
 		}
 		$this->fetchMode = $mode;
 		
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-pdo_mysql.inc.php 0.762/includes/classes/adodb/drivers/adodb-pdo_mysql.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-pdo_mysql.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-pdo_mysql.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -2,7 +2,7 @@
 
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -22,7 +22,8 @@
 	
 		$parentDriver->hasTransactions = false;
 		$parentDriver->_bindInputArray = false;
-		$parentDriver->_connectionID->setAttribute(PDO_MYSQL_ATTR_USE_BUFFERED_QUERY,true);
+		$parentDriver->hasInsertID = true;
+		$parentDriver->_connectionID->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
 	}
 	
 	function ServerInfo()
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-pdo_oci.inc.php 0.762/includes/classes/adodb/drivers/adodb-pdo_oci.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-pdo_oci.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-pdo_oci.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -2,7 +2,7 @@
 
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-pdo_pgsql.inc.php 0.762/includes/classes/adodb/drivers/adodb-pdo_pgsql.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-pdo_pgsql.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-pdo_pgsql.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -58,6 +58,7 @@
 	{
 	
 		$parentDriver->hasTransactions = false;
+		$parentDriver->hasInsertID = true;
 	}
 	
 	function ServerInfo()
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-postgres64.inc.php 0.762/includes/classes/adodb/drivers/adodb-postgres64.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-postgres64.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-postgres64.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -94,7 +94,7 @@
 	var $true = 'TRUE';		// string that represents TRUE for a database
 	var $false = 'FALSE';		// string that represents FALSE for a database
 	var $fmtDate = "'Y-m-d'";	// used by DBDate() as the default date format used by the database
-	var $fmtTimeStamp = "'Y-m-d G:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
+	var $fmtTimeStamp = "'Y-m-d H:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
 	var $hasMoveFirst = true;
 	var $hasGenID = true;
 	var $_genIDSQL = "SELECT NEXTVAL('%s')";
@@ -428,6 +428,11 @@
 	function OffsetDate($dayFraction,$date=false)
 	{		
 		if (!$date) $date = $this->sysDate;
+		else if (strncmp($date,"'",1) == 0) {
+			$len = strlen($date);
+			if (10 <= $len && $len <= 12) $date = 'date '.$date;
+			else $date = 'timestamp '.$date;
+		}
 		return "($date+interval'$dayFraction days')";
 	}
 	
@@ -561,14 +566,14 @@
 JOIN pg_catalog.pg_index i ON i.indexrelid=c.oid 
 JOIN pg_catalog.pg_class c2 ON c2.oid=i.indrelid
 	,pg_namespace n 
-WHERE (c2.relname=\'%s\' or c2.relname=lower(\'%s\')) and c.relnamespace=c2.relnamespace and c.relnamespace=n.oid and n.nspname=\'%s\' AND i.indisprimary=false';
+WHERE (c2.relname=\'%s\' or c2.relname=lower(\'%s\')) and c.relnamespace=c2.relnamespace and c.relnamespace=n.oid and n.nspname=\'%s\'';
 				} else {
 	                $sql = '
 SELECT c.relname as "Name", i.indisunique as "Unique", i.indkey as "Columns"
 FROM pg_catalog.pg_class c
 JOIN pg_catalog.pg_index i ON i.indexrelid=c.oid
 JOIN pg_catalog.pg_class c2 ON c2.oid=i.indrelid
-WHERE c2.relname=\'%s\' or c2.relname=lower(\'%s\')';
+WHERE (c2.relname=\'%s\' or c2.relname=lower(\'%s\'))';
     			}
 				            
                 if ($primary == FALSE) {
@@ -752,6 +757,11 @@
 		return $rez;
 	}
 	
+	function _errconnect()
+	{
+		if (defined('DB_ERROR_CONNECT_FAILED')) return DB_ERROR_CONNECT_FAILED;
+		else return 'Database connection failed';
+	}
 
 	/*	Returns: the last error message from previous database operation	*/	
 	function ErrorMsg() 
@@ -765,9 +775,9 @@
 			
 			if (!empty($this->_connectionID)) {
 				$this->_errorMsg = @pg_last_error($this->_connectionID);
-			} else $this->_errorMsg = @pg_last_error();
+			} else $this->_errorMsg = $this->_errconnect();
 		} else {
-			if (empty($this->_connectionID)) $this->_errorMsg = @pg_errormessage();
+			if (empty($this->_connectionID)) $this->_errconnect();
 			else $this->_errorMsg = @pg_errormessage($this->_connectionID);
 		}
 		return $this->_errorMsg;
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-postgres7.inc.php 0.762/includes/classes/adodb/drivers/adodb-postgres7.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-postgres7.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-postgres7.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
+ V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -28,6 +28,7 @@
 		if (ADODB_ASSOC_CASE !== 2) {
 			$this->rsPrefix .= 'assoc_';
 		}
+		$this->_bindInputArray = PHP_VERSION >= 5.1;
 	}
 
 	
@@ -35,8 +36,8 @@
 	// which makes obsolete the LIMIT limit,offset syntax
 	 function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0) 
 	 {
-		 $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
-		 $limitStr  = ($nrows >= 0)  ? " LIMIT $nrows" : '';
+		 $offsetStr = ($offset >= 0) ? " OFFSET ".((integer)$offset) : '';
+		 $limitStr  = ($nrows >= 0)  ? " LIMIT ".((integer)$nrows) : '';
 		 if ($secs2cache)
 		  	$rs =& $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
 		 else
@@ -56,40 +57,68 @@
  	*/
 
 	// from  Edward Jaramilla, improved version - works on pg 7.4
-function MetaForeignKeys($table, $owner=false, $upper=false)
-{
-	$sql = 'SELECT t.tgargs as args
-	FROM
-	pg_trigger t,pg_class c,pg_proc p
-	WHERE
-	t.tgenabled AND
-	t.tgrelid = c.oid AND
-	t.tgfoid = p.oid AND
-	p.proname = \'RI_FKey_check_ins\' AND
-	c.relname = \''.strtolower($table).'\'
-	ORDER BY
-		t.tgrelid';
-	
-	$rs = $this->Execute($sql);
-	
-	if ($rs && !$rs->EOF) {
-		$arr =& $rs->GetArray();
-		$a = array();
-		foreach($arr as $v)
-		{
-			$data = explode(chr(0), $v['args']);
-			if ($upper) {
-				$a[strtoupper($data[2])][] = strtoupper($data[4].'='.$data[5]);
-			} else {
-			$a[$data[2]][] = $data[4].'='.$data[5];
+	function MetaForeignKeys($table, $owner=false, $upper=false)
+	{
+		$sql = 'SELECT t.tgargs as args
+		FROM
+		pg_trigger t,pg_class c,pg_proc p
+		WHERE
+		t.tgenabled AND
+		t.tgrelid = c.oid AND
+		t.tgfoid = p.oid AND
+		p.proname = \'RI_FKey_check_ins\' AND
+		c.relname = \''.strtolower($table).'\'
+		ORDER BY
+			t.tgrelid';
+		
+		$rs =& $this->Execute($sql);
+		
+		if ($rs && !$rs->EOF) {
+			$arr =& $rs->GetArray();
+			$a = array();
+			foreach($arr as $v)
+			{
+				$data = explode(chr(0), $v['args']);
+				if ($upper) {
+					$a[strtoupper($data[2])][] = strtoupper($data[4].'='.$data[5]);
+				} else {
+				$a[$data[2]][] = $data[4].'='.$data[5];
+				}
 			}
+			return $a;
 		}
-		return $a;
+		return false;
 	}
-	return false;
-}
-
 
+	function _query($sql,$inputarr)
+	{
+		if (! $this->_bindInputArray) {
+			// We don't have native support for parameterized queries, so let's emulate it at the parent
+			return ADODB_postgres64::_query($sql, $inputarr);
+		}
+		// -- added Cristiano da Cunha Duarte
+		if ($inputarr) {
+			$sqlarr = explode('?',trim($sql));
+			$sql = '';
+			$i = 1;
+			foreach($sqlarr as $v) {
+				$sql .= $v.' $'.$i;
+				$i++;
+			}
+			$rez = pg_query_params($this->_connectionID,substr($sql, 0, strlen($sql)-2), $inputarr);
+		} else {
+			$rez = pg_query($this->_connectionID,$sql);
+		}
+		// check if no data returned, then no need to create real recordset
+		if ($rez && pg_numfields($rez) <= 0) {
+			if (is_resource($this->_resultid) && get_resource_type($this->_resultid) === 'pgsql result') {
+				pg_freeresult($this->_resultid);
+			}
+			$this->_resultid = $rez;
+			return true;
+		}		
+		return $rez;
+	}
 	
  	 // this is a set of functions for managing client encoding - very important if the encodings
 	// of your database and your output target (i.e. HTML) don't match
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-postgres8.inc.php 0.762/includes/classes/adodb/drivers/adodb-postgres8.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-postgres8.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-postgres8.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-postgres.inc.php 0.762/includes/classes/adodb/drivers/adodb-postgres.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-postgres.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-postgres.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-proxy.inc.php 0.762/includes/classes/adodb/drivers/adodb-proxy.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-proxy.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-proxy.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-sapdb.inc.php 0.762/includes/classes/adodb/drivers/adodb-sapdb.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-sapdb.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-sapdb.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-sqlanywhere.inc.php 0.762/includes/classes/adodb/drivers/adodb-sqlanywhere.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-sqlanywhere.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-sqlanywhere.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-version V4.65 22 July 2005 (c) 2000-2005  John Lim (jlim@natsoft.com.my).  All rights
+version V4.66 28 Sept 2005 (c) 2000-2005  John Lim (jlim@natsoft.com.my).  All rights
 reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-sqlite.inc.php 0.762/includes/classes/adodb/drivers/adodb-sqlite.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-sqlite.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-sqlite.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -76,6 +76,49 @@
 		if ($this->transCnt>0)$this->transCnt -= 1;
 		return !empty($ret);
 	}
+	
+	// mark newnham
+	function &MetaColumns($tab)
+	{
+	  global $ADODB_FETCH_MODE;
+	  $false = false;
+	  $save = $ADODB_FETCH_MODE;
+	  $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	  if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
+	  $rs = $this->Execute("PRAGMA table_info('$tab')");
+	  if (isset($savem)) $this->SetFetchMode($savem);
+	  if (!$rs) {
+	    $ADODB_FETCH_MODE = $save; 
+	    return $false;
+	  }
+	  $arr = array();
+	  while ($r = $rs->FetchRow()) {
+	    $type = explode('(',$r['type']);
+	    $size = '';
+	    if (sizeof($type)==2)
+	    $size = trim($type[1],')');
+	    $fn = strtoupper($r['name']);
+	    $fld = new ADOFieldObject;
+	    $fld->name = $r['name'];
+	    $fld->type = $type[0];
+	    $fld->max_length = $size;
+	    $fld->not_null = $r['notnull'];
+	    $fld->default_value = $r['dflt_value'];
+	    $fld->scale = 0;
+	    if ($save == ADODB_FETCH_NUM) $arr[] = $fld;	
+	    else $arr[strtoupper($fld->name)] = $fld;
+	  }
+	  $rs->Close();
+	  $ADODB_FETCH_MODE = $save;
+	  return $arr;
+	}
+	
+	function _init($parentDriver)
+	{
+	
+		$parentDriver->hasTransactions = false;
+		$parentDriver->hasInsertID = true;
+	}
 
 	function _insertid()
 	{
@@ -236,7 +279,7 @@
 		return @sqlite_close($this->_connectionID);
 	}
 
-	function &MetaIndexes ($table, $primary = FALSE, $owner=false)
+	function &MetaIndexes($table, $primary = FALSE, $owner=false)
 	{
 		$false = false;
 		// save old fetch mode
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-sqlitepo.inc.php 0.762/includes/classes/adodb/drivers/adodb-sqlitepo.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-sqlitepo.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-sqlitepo.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-sybase_ase.inc.php 0.762/includes/classes/adodb/drivers/adodb-sybase_ase.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-sybase_ase.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-sybase_ase.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-sybase.inc.php 0.762/includes/classes/adodb/drivers/adodb-sybase.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-sybase.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-sybase.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim. All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -96,7 +96,8 @@
 		
 	function SelectDB($dbName) 
 	{
-		$this->databaseName = $dbName;
+		$this->database = $dbName;
+		$this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
 		if ($this->_connectionID) {
 			return @sybase_select_db($dbName);		
 		}
@@ -156,6 +157,10 @@
 			$rs =& ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
 			return $rs;
 		}
+		
+		$nrows = (integer) $nrows;
+		$offset = (integer) $offset;
+		
 		$cnt = ($nrows >= 0) ? $nrows : 999999999;
 		if ($offset > 0 && $cnt) $cnt += $offset;
 		
diff -ruN 0.761/includes/classes/adodb/drivers/adodb-vfp.inc.php 0.762/includes/classes/adodb/drivers/adodb-vfp.inc.php
--- 0.761/includes/classes/adodb/drivers/adodb-vfp.inc.php	2005-07-24 11:58:31.000000000 -0500
+++ 0.762/includes/classes/adodb/drivers/adodb-vfp.inc.php	2005-10-10 09:04:07.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/lang/adodb-ar.inc.php 0.762/includes/classes/adodb/lang/adodb-ar.inc.php
--- 0.761/includes/classes/adodb/lang/adodb-ar.inc.php	2004-11-15 15:04:52.000000000 -0600
+++ 0.762/includes/classes/adodb/lang/adodb-ar.inc.php	2005-10-10 09:04:10.000000000 -0500
@@ -22,7 +22,7 @@
 	    DB_ERROR_SYNTAX		=> '  ',
 	    DB_ERROR_UNSUPPORTED	=> ' ',
 	    DB_ERROR_VALUE_COUNT_ON_ROW => '   ',
-	    DB_ERROR_INVALID_DSN	=> 'DNS  ',
+	    DB_ERROR_INVALID_DSN	=> 'DSN  ',
 	    DB_ERROR_CONNECT_FAILED	=> '  ',
 	    0			       => '  ', // DB_OK
 	    DB_ERROR_NEED_MORE_DATA	=> '   ',
diff -ruN 0.761/includes/classes/adodb/pear/Auth/Container/ADOdb.php 0.762/includes/classes/adodb/pear/Auth/Container/ADOdb.php
--- 0.761/includes/classes/adodb/pear/Auth/Container/ADOdb.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/pear/Auth/Container/ADOdb.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,413 +0,0 @@
-<?php
-//
-// +----------------------------------------------------------------------+
-// | PHP Version 4                                                        |
-// +----------------------------------------------------------------------+
-// |                                                                      |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license,      |
-// | that is bundled with this package in the file LICENSE, and is        |
-// | available at through the world-wide-web at                           |
-// | http://www.php.net/license/2_02.txt.                                 |
-// | If you did not receive a copy of the PHP license and are unable to   |
-// | obtain it through the world-wide-web, please send a note to          |
-// | license@php.net so we can mail you a copy immediately.               |
-// +----------------------------------------------------------------------+
-// | Authors: Martin Jansen <mj@php.net>
-// |	Richard Tango-Lowy <richtl@arscognita.com>                                  |
-// +----------------------------------------------------------------------+
-//
-// $Id: ADOdb.php,v 1.7 2005/07/24 16:58:32 markwest Exp $
-//
-
-require_once 'Auth/Container.php';
-require_once 'adodb.inc.php';
-require_once 'adodb-pear.inc.php';
-require_once 'adodb-errorpear.inc.php';
-
-/**
- * Storage driver for fetching login data from a database using ADOdb-PHP.
- *
- * This storage driver can use all databases which are supported
- * by the ADBdb DB abstraction layer to fetch login data.
- * See http://php.weblogs.com/adodb for information on ADOdb.
- * NOTE: The ADOdb directory MUST be in your PHP include_path!
- *
- * @author   Richard Tango-Lowy <richtl@arscognita.com>
- * @package  Auth
- * @version  $Revision: 1.7 $
- */
-class Auth_Container_ADOdb extends Auth_Container
-{
-
-    /**
-     * Additional options for the storage container
-     * @var array
-     */
-    var $options = array();
-
-    /**
-     * DB object
-     * @var object
-     */
-    var $db = null;
-    var $dsn = '';
-	
-    /**
-     * User that is currently selected from the DB.
-     * @var string
-     */
-    var $activeUser = '';
-
-    // {{{ Constructor
-
-    /**
-     * Constructor of the container class
-     *
-     * Initate connection to the database via PEAR::ADOdb
-     *
-     * @param  string Connection data or DB object
-     * @return object Returns an error object if something went wrong
-     */
-    function Auth_Container_ADOdb($dsn)
-    {
-        $this->_setDefaults();
-		
-        if (is_array($dsn)) {
-            $this->_parseOptions($dsn);
-
-            if (empty($this->options['dsn'])) {
-                PEAR::raiseError('No connection parameters specified!');
-            }
-        } else {
-        	// Extract db_type from dsn string.
-            $this->options['dsn'] = $dsn;
-        }
-    }
-
-    // }}}
-    // {{{ _connect()
-
-    /**
-     * Connect to database by using the given DSN string
-     *
-     * @access private
-     * @param  string DSN string
-     * @return mixed  Object on error, otherwise bool
-     */
-     function _connect($dsn)
-    {
-        if (is_string($dsn) || is_array($dsn)) {
-        	if(!$this->db) {
-	        	$this->db = &ADONewConnection($dsn);
-	    		if( $err = ADODB_Pear_error() ) {
-	   	    		return PEAR::raiseError($err);
-	    		}
-        	}
-        	
-        } else {
-            return PEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
-                                    41,
-                                    PEAR_ERROR_RETURN,
-                                    null,
-                                    null
-                                    );
-        }
-        
-        if(!$this->db) {
-        	return PEAR::raiseError(ADODB_Pear_error());
-        } else {
-        	return true;
-        }
-    }
-
-    // }}}
-    // {{{ _prepare()
-
-    /**
-     * Prepare database connection
-     *
-     * This function checks if we have already opened a connection to
-     * the database. If that's not the case, a new connection is opened.
-     *
-     * @access private
-     * @return mixed True or a DB error object.
-     */
-    function _prepare()
-    {
-    	if(!$this->db) {
-    		$res = $this->_connect($this->options['dsn']);  		
-    	}
-        return true;
-    }
-
-    // }}}
-    // {{{ query()
-
-    /**
-     * Prepare query to the database
-     *
-     * This function checks if we have already opened a connection to
-     * the database. If that's not the case, a new connection is opened.
-     * After that the query is passed to the database.
-     *
-     * @access public
-     * @param  string Query string
-     * @return mixed  a DB_result object or DB_OK on success, a DB
-     *                or PEAR error on failure
-     */
-    function query($query)
-    {
-        $err = $this->_prepare();
-        if ($err !== true) {
-            return $err;
-        }
-        return $this->db->query($query);
-    }
-
-    // }}}
-    // {{{ _setDefaults()
-
-    /**
-     * Set some default options
-     *
-     * @access private
-     * @return void
-     */
-    function _setDefaults()
-    {
-    	$this->options['db_type']	= 'mysql';
-        $this->options['table']       = 'auth';
-        $this->options['usernamecol'] = 'username';
-        $this->options['passwordcol'] = 'password';
-        $this->options['dsn']         = '';
-        $this->options['db_fields']   = '';
-        $this->options['cryptType']   = 'md5';
-    }
-
-    // }}}
-    // {{{ _parseOptions()
-
-    /**
-     * Parse options passed to the container class
-     *
-     * @access private
-     * @param  array
-     */
-    function _parseOptions($array)
-    {
-        foreach ($array as $key => $value) {
-            if (isset($this->options[$key])) {
-                $this->options[$key] = $value;
-            }
-        }
-
-        /* Include additional fields if they exist */
-        if(!empty($this->options['db_fields'])){
-            if(is_array($this->options['db_fields'])){
-                $this->options['db_fields'] = join($this->options['db_fields'], ', ');
-            }
-            $this->options['db_fields'] = ', '.$this->options['db_fields'];
-        }
-    }
-
-    // }}}
-    // {{{ fetchData()
-
-    /**
-     * Get user information from database
-     *
-     * This function uses the given username to fetch
-     * the corresponding login data from the database
-     * table. If an account that matches the passed username
-     * and password is found, the function returns true.
-     * Otherwise it returns false.
-     *
-     * @param   string Username
-     * @param   string Password
-     * @return  mixed  Error object or boolean
-     */
-    function fetchData($username, $password)
-    {
-        // Prepare for a database query
-        $err = $this->_prepare();
-        if ($err !== true) {
-            return PEAR::raiseError($err->getMessage(), $err->getCode());
-        }
-
-        // Find if db_fields contains a *, i so assume all col are selected
-        if(strstr($this->options['db_fields'], '*')){
-            $sql_from = "*";
-        }
-        else{
-            $sql_from = $this->options['usernamecol'] . ", ".$this->options['passwordcol'].$this->options['db_fields'];
-        }
-        
-        $query = "SELECT ".$sql_from.
-                " FROM ".$this->options['table'].
-                " WHERE ".$this->options['usernamecol']." = " . $this->db->Quote($username);
-        
-        $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-        $rset = $this->db->Execute( $query );
-        $res = $rset->fetchRow();
-
-        if (DB::isError($res)) {
-            return PEAR::raiseError($res->getMessage(), $res->getCode());
-        }
-        if (!is_array($res)) {
-            $this->activeUser = '';
-            return false;
-        }
-        if ($this->verifyPassword(trim($password, "\r\n"),
-                                  trim($res[$this->options['passwordcol']], "\r\n"),
-                                  $this->options['cryptType'])) {
-            // Store additional field values in the session
-            foreach ($res as $key => $value) {
-                if ($key == $this->options['passwordcol'] ||
-                    $key == $this->options['usernamecol']) {
-                    continue;
-                }
-                // Use reference to the auth object if exists
-                // This is because the auth session variable can change so a static call to setAuthData does not make sence
-                if(is_object($this->_auth_obj)){
-                    $this->_auth_obj->setAuthData($key, $value);
-                } else {
-                    Auth::setAuthData($key, $value);
-                }
-            }
-
-            return true;
-        }
-
-        $this->activeUser = $res[$this->options['usernamecol']];
-        return false;
-    }
-
-    // }}}
-    // {{{ listUsers()
-
-    function listUsers()
-    {
-        $err = $this->_prepare();
-        if ($err !== true) {
-            return PEAR::raiseError($err->getMessage(), $err->getCode());
-        }
-
-        $retVal = array();
-
-        // Find if db_fileds contains a *, i so assume all col are selected
-        if(strstr($this->options['db_fields'], '*')){
-            $sql_from = "*";
-        }
-        else{
-            $sql_from = $this->options['usernamecol'] . ", ".$this->options['passwordcol'].$this->options['db_fields'];
-        }
-
-        $query = sprintf("SELECT %s FROM %s",
-                         $sql_from,
-                         $this->options['table']
-                         );
-        $res = $this->db->getAll($query, null, DB_FETCHMODE_ASSOC);
-
-        if (DB::isError($res)) {
-            return PEAR::raiseError($res->getMessage(), $res->getCode());
-        } else {
-            foreach ($res as $user) {
-                $user['username'] = $user[$this->options['usernamecol']];
-                $retVal[] = $user;
-            }
-        }
-        return $retVal;
-    }
-
-    // }}}
-    // {{{ addUser()
-
-    /**
-     * Add user to the storage container
-     *
-     * @access public
-     * @param  string Username
-     * @param  string Password
-     * @param  mixed  Additional information that are stored in the DB
-     *
-     * @return mixed True on success, otherwise error object
-     */
-    function addUser($username, $password, $additional = "")
-    {
-        if (function_exists($this->options['cryptType'])) {
-            $cryptFunction = $this->options['cryptType'];
-        } else {
-            $cryptFunction = 'md5';
-        }
-
-        $additional_key   = '';
-        $additional_value = '';
-
-        if (is_array($additional)) {
-            foreach ($additional as $key => $value) {
-                $additional_key .= ', ' . $key;
-                $additional_value .= ", '" . $value . "'";
-            }
-        }
-
-        $query = sprintf("INSERT INTO %s (%s, %s%s) VALUES ('%s', '%s'%s)",
-                         $this->options['table'],
-                         $this->options['usernamecol'],
-                         $this->options['passwordcol'],
-                         $additional_key,
-                         $username,
-                         $cryptFunction($password),
-                         $additional_value
-                         );
-
-        $res = $this->query($query);
-
-        if (DB::isError($res)) {
-           return PEAR::raiseError($res->getMessage(), $res->getCode());
-        } else {
-          return true;
-        }
-    }
-
-    // }}}
-    // {{{ removeUser()
-
-    /**
-     * Remove user from the storage container
-     *
-     * @access public
-     * @param  string Username
-     *
-     * @return mixed True on success, otherwise error object
-     */
-    function removeUser($username)
-    {
-        $query = sprintf("DELETE FROM %s WHERE %s = '%s'",
-                         $this->options['table'],
-                         $this->options['usernamecol'],
-                         $username
-                         );
-
-        $res = $this->query($query);
-
-        if (DB::isError($res)) {
-           return PEAR::raiseError($res->getMessage(), $res->getCode());
-        } else {
-          return true;
-        }
-    }
-
-    // }}}
-}
-
-function showDbg( $string ) {
-	print "
--- $string</P>";
-}
-function dump( $var, $str, $vardump = false ) {
-	print "<H4>$str</H4><pre>";
-	( !$vardump ) ? ( print_r( $var )) : ( var_dump( $var ));
-	print "</pre>";
-}
-?>
diff -ruN 0.761/includes/classes/adodb/pear/readme.Auth.txt 0.762/includes/classes/adodb/pear/readme.Auth.txt
--- 0.761/includes/classes/adodb/pear/readme.Auth.txt	2005-03-22 11:12:59.000000000 -0600
+++ 0.762/includes/classes/adodb/pear/readme.Auth.txt	1969-12-31 18:00:00.000000000 -0600
@@ -1,20 +0,0 @@
-From: Rich Tango-Lowy (richtl#arscognita.com)
-Date: Sat, May 29, 2004 11:20 am
-
-OK, I hacked out an ADOdb container for PEAR-Auth. The error handling's 
-a bit of a mess, but all the methods work.
-
-Copy ADOdb.php to your pear/Auth/Container/ directory.
-
-Use the ADOdb container exactly as you would the DB
-container, but specify 'ADOdb' instead of 'DB':
-
-$dsn = "mysql://myuser:mypass@localhost/authdb";
-$a = new Auth("ADOdb", $dsn, "loginFunction");
-
-
--------------------
-
-John Lim adds:
-
-See http://pear.php.net/manual/en/package.authentication.php
diff -ruN 0.761/includes/classes/adodb/perf/perf-db2.inc.php 0.762/includes/classes/adodb/perf/perf-db2.inc.php
--- 0.761/includes/classes/adodb/perf/perf-db2.inc.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/perf/perf-db2.inc.php	2005-10-10 09:04:11.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
diff -ruN 0.761/includes/classes/adodb/perf/perf-informix.inc.php 0.762/includes/classes/adodb/perf/perf-informix.inc.php
--- 0.761/includes/classes/adodb/perf/perf-informix.inc.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/perf/perf-informix.inc.php	2005-10-10 09:04:11.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
diff -ruN 0.761/includes/classes/adodb/perf/perf-mssql.inc.php 0.762/includes/classes/adodb/perf/perf-mssql.inc.php
--- 0.761/includes/classes/adodb/perf/perf-mssql.inc.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/perf/perf-mssql.inc.php	2005-10-10 09:04:11.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
diff -ruN 0.761/includes/classes/adodb/perf/perf-mysql.inc.php 0.762/includes/classes/adodb/perf/perf-mysql.inc.php
--- 0.761/includes/classes/adodb/perf/perf-mysql.inc.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/perf/perf-mysql.inc.php	2005-10-10 09:04:11.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
diff -ruN 0.761/includes/classes/adodb/perf/perf-oci8.inc.php 0.762/includes/classes/adodb/perf/perf-oci8.inc.php
--- 0.761/includes/classes/adodb/perf/perf-oci8.inc.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/perf/perf-oci8.inc.php	2005-10-10 09:04:11.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
diff -ruN 0.761/includes/classes/adodb/perf/perf-postgres.inc.php 0.762/includes/classes/adodb/perf/perf-postgres.inc.php
--- 0.761/includes/classes/adodb/perf/perf-postgres.inc.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/perf/perf-postgres.inc.php	2005-10-10 09:04:11.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /* 
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
diff -ruN 0.761/includes/classes/adodb/pivottable.inc.php 0.762/includes/classes/adodb/pivottable.inc.php
--- 0.761/includes/classes/adodb/pivottable.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/pivottable.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ * @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/rsfilter.inc.php 0.762/includes/classes/adodb/rsfilter.inc.php
--- 0.761/includes/classes/adodb/rsfilter.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/rsfilter.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ * @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/server.php 0.762/includes/classes/adodb/server.php
--- 0.761/includes/classes/adodb/server.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/server.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,98 +0,0 @@
-<?php
-
-/** 
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
- * Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence. 
- */
- 
-/* Documentation on usage is at http://php.weblogs.com/adodb_csv
- *
- * Legal query string parameters:
- * 
- * sql = holds sql string
- * nrows = number of rows to return 
- * offset = skip offset rows of data
- * fetch = $ADODB_FETCH_MODE
- * 
- * example:
- *
- * http://localhost/php/server.php?select+*+from+table&nrows=10&offset=2
- */
-
-
-/* 
- * Define the IP address you want to accept requests from 
- * as a security measure. If blank we accept anyone promisciously!
- */
-$ACCEPTIP = '';
-
-/*
- * Connection parameters
- */
-$driver = 'mysql';
-$host = 'localhost'; // DSN for odbc
-$uid = 'root';
-$pwd = '';
-$database = 'test';
-
-/*============================ DO NOT MODIFY BELOW HERE =================================*/
-// $sep must match csv2rs() in adodb.inc.php
-$sep = ' :::: ';
-
-include('./adodb.inc.php');
-include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
-
-function err($s)
-{
-	die('**** '.$s.' ');
-}
-
-// undo stupid magic quotes
-function undomq(&$m) 
-{
-	if (get_magic_quotes_gpc()) {
-		// undo the damage
-		$m = str_replace('\\\\','\\',$m);
-		$m = str_replace('\"','"',$m);
-		$m = str_replace('\\\'','\'',$m);
-		
-	}
-	return $m;
-}
-
-///////////////////////////////////////// DEFINITIONS
-
-
-$remote = $_SERVER["REMOTE_ADDR"]; 
- 
-if (empty($_GET['sql'])) err('No SQL');
-
-if (!empty($ACCEPTIP))
- if ($remote != '127.0.0.1' && $remote != $ACCEPTIP) 
- 	err("Unauthorised client: '$remote'");
-
-
-$conn = &ADONewConnection($driver);
-
-if (!$conn->Connect($host,$uid,$pwd,$database)) err($conn->ErrorNo(). $sep . $conn->ErrorMsg());
-$sql = undomq($_GET['sql']);
-
-if (isset($_GET['fetch']))
-	$ADODB_FETCH_MODE = $_GET['fetch'];
-	
-if (isset($_GET['nrows'])) {
-	$nrows = $_GET['nrows'];
-	$offset = isset($_GET['offset']) ? $_GET['offset'] : -1;
-	$rs = $conn->SelectLimit($sql,$nrows,$offset);
-} else 
-	$rs = $conn->Execute($sql);
-if ($rs){ 
-	//$rs->timeToLive = 1;
-	echo _rs2serialize($rs,$conn,$sql);
-	$rs->Close();
-} else
-	err($conn->ErrorNo(). $sep .$conn->ErrorMsg());
-
-?>
\ No newline at end of file
diff -ruN 0.761/includes/classes/adodb/session/adodb-compress-bzip2.php 0.762/includes/classes/adodb/session/adodb-compress-bzip2.php
--- 0.761/includes/classes/adodb/session/adodb-compress-bzip2.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/session/adodb-compress-bzip2.php	2005-10-10 09:04:11.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
diff -ruN 0.761/includes/classes/adodb/session/adodb-compress-gzip.php 0.762/includes/classes/adodb/session/adodb-compress-gzip.php
--- 0.761/includes/classes/adodb/session/adodb-compress-gzip.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/session/adodb-compress-gzip.php	2005-10-10 09:04:11.000000000 -0500
@@ -2,7 +2,7 @@
 
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
diff -ruN 0.761/includes/classes/adodb/session/adodb-cryptsession.php 0.762/includes/classes/adodb/session/adodb-cryptsession.php
--- 0.761/includes/classes/adodb/session/adodb-cryptsession.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/session/adodb-cryptsession.php	2005-10-10 09:04:11.000000000 -0500
@@ -2,7 +2,7 @@
 
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
diff -ruN 0.761/includes/classes/adodb/session/adodb-encrypt-mcrypt.php 0.762/includes/classes/adodb/session/adodb-encrypt-mcrypt.php
--- 0.761/includes/classes/adodb/session/adodb-encrypt-mcrypt.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/session/adodb-encrypt-mcrypt.php	2005-10-10 09:04:11.000000000 -0500
@@ -2,7 +2,7 @@
 
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
diff -ruN 0.761/includes/classes/adodb/session/adodb-encrypt-md5.php 0.762/includes/classes/adodb/session/adodb-encrypt-md5.php
--- 0.761/includes/classes/adodb/session/adodb-encrypt-md5.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/session/adodb-encrypt-md5.php	2005-10-10 09:04:11.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
diff -ruN 0.761/includes/classes/adodb/session/adodb-encrypt-secret.php 0.762/includes/classes/adodb/session/adodb-encrypt-secret.php
--- 0.761/includes/classes/adodb/session/adodb-encrypt-secret.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/session/adodb-encrypt-secret.php	2005-10-10 09:04:11.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
diff -ruN 0.761/includes/classes/adodb/session/adodb-session-clob.php 0.762/includes/classes/adodb/session/adodb-session-clob.php
--- 0.761/includes/classes/adodb/session/adodb-session-clob.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/session/adodb-session-clob.php	2005-10-10 09:04:11.000000000 -0500
@@ -2,7 +2,7 @@
 
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
diff -ruN 0.761/includes/classes/adodb/session/adodb-session.php 0.762/includes/classes/adodb/session/adodb-session.php
--- 0.761/includes/classes/adodb/session/adodb-session.php	2005-07-24 11:58:32.000000000 -0500
+++ 0.762/includes/classes/adodb/session/adodb-session.php	2005-10-10 09:04:11.000000000 -0500
@@ -2,7 +2,7 @@
 
 
 /*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb@netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
@@ -834,11 +834,19 @@
 				$conn->CommitTrans();
 			}
 		} else {
-			$sql = "DELETE FROM $table WHERE expiry < $time";
-			$rs =& $conn->Execute($sql);
-			ADODB_Session::_dumprs($rs);
-			if ($rs) {
-				$rs->Close();
+		
+			if (1) {
+				$sql = "SELECT sesskey FROM $table WHERE expiry < $time";
+				$arr =& $conn->GetAll($sql);
+				foreach ($arr as $row) {
+					$sql2 = "DELETE FROM $table WHERE sesskey='$row[0]'";
+					$conn->Execute($sql2);
+				}
+			} else {
+				$sql = "DELETE FROM $table WHERE expiry < $time";
+				$rs =& $conn->Execute($sql);
+				ADODB_Session::_dumprs($rs);
+				if ($rs) $rs->Close();
 			}
 			if ($debug) {
 				ADOConnection::outp("<p><b>Garbage Collection</b>: $sql</p>");
diff -ruN 0.761/includes/classes/adodb/session/old/adodb-cryptsession.php 0.762/includes/classes/adodb/session/old/adodb-cryptsession.php
--- 0.761/includes/classes/adodb/session/old/adodb-cryptsession.php	2005-07-24 11:58:33.000000000 -0500
+++ 0.762/includes/classes/adodb/session/old/adodb-cryptsession.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,322 +0,0 @@
-<?php
-/*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence.
-	Made table name configurable - by David Johnson djohnson@inpro.net
-	Encryption by Ari Kuorikoski <ari.kuorikoski@finebyte.com>
-	
-  Set tabs to 4 for best viewing.
-  
-  Latest version of ADODB is available at http://php.weblogs.com/adodb
-  ======================================================================
-  
- This file provides PHP4 session management using the ADODB database
-wrapper library.
- 
- Example
- =======
- 
-	include('adodb.inc.php');
-	#---------------------------------#
-	include('adodb-cryptsession.php'); 
-	#---------------------------------#
-	session_start();
-	session_register('AVAR');
-	$_SESSION['AVAR'] += 1;
-	print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";
-
- 
- Installation
- ============
- 1. Create a new database in MySQL or Access "sessions" like
-so:
- 
-  create table sessions (
-	   SESSKEY char(32) not null,
-	   EXPIRY int(11) unsigned not null,
-	   EXPIREREF varchar(64),
-	   DATA CLOB,
-	  primary key (sesskey)
-  );
-  
-  2. Then define the following parameters. You can either modify
-     this file, or define them before this file is included:
-	 
-  	$ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase';
-	$ADODB_SESSION_CONNECT='server to connect to';
-	$ADODB_SESSION_USER ='user';
-	$ADODB_SESSION_PWD ='password';
-	$ADODB_SESSION_DB ='database';
-	$ADODB_SESSION_TBL = 'sessions'
-	
-  3. Recommended is PHP 4.0.2 or later. There are documented
-session bugs in earlier versions of PHP.
-
-*/
-
-
-include_once('crypt.inc.php');
-
-if (!defined('_ADODB_LAYER')) {
-	include (dirname(__FILE__).'/adodb.inc.php');
-}
-
- /* if database time and system time is difference is greater than this, then give warning */
- define('ADODB_SESSION_SYNCH_SECS',60); 
-
-if (!defined('ADODB_SESSION')) {
-
- define('ADODB_SESSION',1);
- 
-GLOBAL 	$ADODB_SESSION_CONNECT, 
-	$ADODB_SESSION_DRIVER,
-	$ADODB_SESSION_USER,
-	$ADODB_SESSION_PWD,
-	$ADODB_SESSION_DB,
-	$ADODB_SESS_CONN,
-	$ADODB_SESS_LIFE,
-	$ADODB_SESS_DEBUG,
-	$ADODB_SESS_INSERT,
-	$ADODB_SESSION_EXPIRE_NOTIFY,
-	$ADODB_SESSION_TBL; 
-
-	//$ADODB_SESS_DEBUG = true;
-	
-	/* SET THE FOLLOWING PARAMETERS */
-if (empty($ADODB_SESSION_DRIVER)) {
-	$ADODB_SESSION_DRIVER='mysql';
-	$ADODB_SESSION_CONNECT='localhost';
-	$ADODB_SESSION_USER ='root';
-	$ADODB_SESSION_PWD ='';
-	$ADODB_SESSION_DB ='xphplens_2';
-}
-
-if (empty($ADODB_SESSION_TBL)){
-	$ADODB_SESSION_TBL = 'sessions';
-}
-
-if (empty($ADODB_SESSION_EXPIRE_NOTIFY)) {
-	$ADODB_SESSION_EXPIRE_NOTIFY = false;
-}
-
-function ADODB_Session_Key() 
-{
-$ADODB_CRYPT_KEY = 'CRYPTED ADODB SESSIONS ROCK!';
-
-	/* USE THIS FUNCTION TO CREATE THE ENCRYPTION KEY FOR CRYPTED SESSIONS	*/
-	/* Crypt the used key, $ADODB_CRYPT_KEY as key and session_ID as SALT	*/
-	return crypt($ADODB_CRYPT_KEY, session_ID());
-}
-
-$ADODB_SESS_LIFE = ini_get('session.gc_maxlifetime');
-if ($ADODB_SESS_LIFE <= 1) {
-	// bug in PHP 4.0.3 pl 1  -- how about other versions?
-	//print "<h3>Session Error: PHP.INI setting <i>session.gc_maxlifetime</i>not set: $ADODB_SESS_LIFE</h3>";
-	$ADODB_SESS_LIFE=1440;
-}
-
-function adodb_sess_open($save_path, $session_name) 
-{
-GLOBAL 	$ADODB_SESSION_CONNECT, 
-	$ADODB_SESSION_DRIVER,
-	$ADODB_SESSION_USER,
-	$ADODB_SESSION_PWD,
-	$ADODB_SESSION_DB,
-	$ADODB_SESS_CONN,
-	$ADODB_SESS_DEBUG;
-	
-	$ADODB_SESS_INSERT = false;
-	
-	if (isset($ADODB_SESS_CONN)) return true;
-	
-	$ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER);
-	if (!empty($ADODB_SESS_DEBUG)) {
-		$ADODB_SESS_CONN->debug = true;
-		print" conn=$ADODB_SESSION_CONNECT user=$ADODB_SESSION_USER pwd=$ADODB_SESSION_PWD db=$ADODB_SESSION_DB ";
-	}
-	return $ADODB_SESS_CONN->PConnect($ADODB_SESSION_CONNECT,
-			$ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
-	
-}
-
-function adodb_sess_close() 
-{
-global $ADODB_SESS_CONN;
-
-	if ($ADODB_SESS_CONN) $ADODB_SESS_CONN->Close();
-	return true;
-}
-
-function adodb_sess_read($key) 
-{
-$Crypt = new MD5Crypt;
-global $ADODB_SESS_CONN,$ADODB_SESS_INSERT,$ADODB_SESSION_TBL;
-	$rs = $ADODB_SESS_CONN->Execute("SELECT data FROM $ADODB_SESSION_TBL WHERE sesskey = '$key' AND expiry >= " . time());
-	if ($rs) {
-		if ($rs->EOF) {
-			$ADODB_SESS_INSERT = true;
-			$v = '';
-		} else {
-			// Decrypt session data
-			$v = rawurldecode($Crypt->Decrypt(reset($rs->fields), ADODB_Session_Key()));
-		}
-		$rs->Close();
-		return $v;
-	}
-	else $ADODB_SESS_INSERT = true;
-	
-	return '';
-}
-
-function adodb_sess_write($key, $val) 
-{
-$Crypt = new MD5Crypt;
-	global $ADODB_SESS_INSERT,$ADODB_SESS_CONN, $ADODB_SESS_LIFE, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
-	$expiry = time() + $ADODB_SESS_LIFE;
-
-	// encrypt session data..	
-	$val = $Crypt->Encrypt(rawurlencode($val), ADODB_Session_Key());
-	
-	$arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val);
-	if ($ADODB_SESSION_EXPIRE_NOTIFY) {
-		$var = reset($ADODB_SESSION_EXPIRE_NOTIFY);
-		global $$var;
-		$arr['expireref'] = $$var;
-	}
-	$rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL,
-	    $arr,
-    	'sesskey',$autoQuote = true);
-
-	if (!$rs) {
-		ADOConnection::outp( '
--- Session Replace: '.$ADODB_SESS_CONN->ErrorMsg().'</p>',false);
-	} else {
-		// bug in access driver (could be odbc?) means that info is not commited
-		// properly unless select statement executed in Win2000
-	
-	if ($ADODB_SESS_CONN->databaseType == 'access') $rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'");
-	}
-	return isset($rs);
-}
-
-function adodb_sess_destroy($key) 
-{
-	global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-	
-	if ($ADODB_SESSION_EXPIRE_NOTIFY) {
-		reset($ADODB_SESSION_EXPIRE_NOTIFY);
-		$fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
-		$savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
-		$rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
-		$ADODB_SESS_CONN->SetFetchMode($savem);
-		if ($rs) {
-			$ADODB_SESS_CONN->BeginTrans();
-			while (!$rs->EOF) {
-				$ref = $rs->fields[0];
-				$key = $rs->fields[1];
-				$fn($ref,$key);
-				$del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
-				$rs->MoveNext();
-			}
-			$ADODB_SESS_CONN->CommitTrans();
-		}
-	} else {
-		$qry = "DELETE FROM $ADODB_SESSION_TBL WHERE sesskey = '$key'";
-		$rs = $ADODB_SESS_CONN->Execute($qry);
-	}
-	return $rs ? true : false;
-}
-
-
-function adodb_sess_gc($maxlifetime) {
-	global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY,$ADODB_SESS_DEBUG;
-
-	if ($ADODB_SESSION_EXPIRE_NOTIFY) {
-		reset($ADODB_SESSION_EXPIRE_NOTIFY);
-		$fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
-		$savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
-		$t = time();
-		$rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE expiry < $t");
-		$ADODB_SESS_CONN->SetFetchMode($savem);
-		if ($rs) {
-			$ADODB_SESS_CONN->BeginTrans();
-			while (!$rs->EOF) {
-				$ref = $rs->fields[0];
-				$key = $rs->fields[1];
-				$fn($ref,$key);
-				//$del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
-				$rs->MoveNext();
-			}
-			$rs->Close();
-			
-			$ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE expiry < $t");
-			$ADODB_SESS_CONN->CommitTrans();
-		}
-	} else {
-		$qry = "DELETE FROM $ADODB_SESSION_TBL WHERE expiry < " . time();
-		$ADODB_SESS_CONN->Execute($qry);
-	}
-	
-	// suggested by Cameron, "GaM3R" <gamr@outworld.cx>
-	if (defined('ADODB_SESSION_OPTIMIZE'))
-	{
-		switch( $ADODB_SESSION_DRIVER ) {
-			case 'mysql':
-			case 'mysqlt':
-				$opt_qry = 'OPTIMIZE TABLE '.$ADODB_SESSION_TBL;
-				break;
-			case 'postgresql':
-			case 'postgresql7':
-				$opt_qry = 'VACUUM '.$ADODB_SESSION_TBL;	
-				break;
-		}
-	}
-	
-	if ($ADODB_SESS_CONN->dataProvider === 'oci8') $sql = 'select  TO_CHAR('.($ADODB_SESS_CONN->sysTimeStamp).', \'RRRR-MM-DD HH24:MI:SS\') from '. $ADODB_SESSION_TBL;
-	else $sql = 'select '.$ADODB_SESS_CONN->sysTimeStamp.' from '. $ADODB_SESSION_TBL;
-	
-	$rs =& $ADODB_SESS_CONN->SelectLimit($sql,1);
-	if ($rs && !$rs->EOF) {
-	
-		$dbts = reset($rs->fields);
-		$rs->Close();
-		$dbt = $ADODB_SESS_CONN->UnixTimeStamp($dbts);
-		$t = time();
-		if (abs($dbt - $t) >= ADODB_SESSION_SYNCH_SECS) {
-			$msg = 
-			__FILE__.": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: database=$dbt ($dbts), webserver=$t (diff=".(abs($dbt-$t)/3600)." hrs)";
-			error_log($msg);
-			if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- $msg</p>");
-		}
-	}
-	
-	return true;
-}
-
-session_module_name('user'); 
-session_set_save_handler(
-	"adodb_sess_open",
-	"adodb_sess_close",
-	"adodb_sess_read",
-	"adodb_sess_write",
-	"adodb_sess_destroy",
-	"adodb_sess_gc");
-}
-
-/*  TEST SCRIPT -- UNCOMMENT */
-/*
-if (0) {
-
-	session_start();
-	session_register('AVAR');
-	$_SESSION['AVAR'] += 1;
-	print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";
-}
-*/
-?>
diff -ruN 0.761/includes/classes/adodb/session/old/adodb-session-clob.php 0.762/includes/classes/adodb/session/old/adodb-session-clob.php
--- 0.761/includes/classes/adodb/session/old/adodb-session-clob.php	2005-07-24 11:58:33.000000000 -0500
+++ 0.762/includes/classes/adodb/session/old/adodb-session-clob.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,448 +0,0 @@
-<?php
-/*
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence.
-	  Set tabs to 4 for best viewing.
-  
-  Latest version of ADODB is available at http://php.weblogs.com/adodb
-  ======================================================================
-  
- This file provides PHP4 session management using the ADODB database
- wrapper library, using Oracle CLOB's to store data. Contributed by achim.gosse@ddd.de.
-
- Example
- =======
- 
-	include('adodb.inc.php');
-	include('adodb-session.php');
-	session_start();
-	session_register('AVAR');
-	$_SESSION['AVAR'] += 1;
-	print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";
-	
-To force non-persistent connections, call adodb_session_open first before session_start():
-
-	include('adodb.inc.php');
-	include('adodb-session.php');
-	adodb_session_open(false,false,false);
-	session_start();
-	session_register('AVAR');
-	$_SESSION['AVAR'] += 1;
-	print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";
-
- 
- Installation
- ============
- 1. Create this table in your database (syntax might vary depending on your db):
- 
-  create table sessions (
-	   SESSKEY char(32) not null,
-	   EXPIRY int(11) unsigned not null,
-	   EXPIREREF varchar(64),
-	   DATA CLOB,
-	  primary key (sesskey)
-  );
-
-
-  2. Then define the following parameters in this file:
-  	$ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase';
-	$ADODB_SESSION_CONNECT='server to connect to';
-	$ADODB_SESSION_USER ='user';
-	$ADODB_SESSION_PWD ='password';
-	$ADODB_SESSION_DB ='database';
-	$ADODB_SESSION_TBL = 'sessions'
-	$ADODB_SESSION_USE_LOBS = false; (or, if you wanna use CLOBS (= 'CLOB') or ( = 'BLOB')
-	
-  3. Recommended is PHP 4.1.0 or later. There are documented
-	 session bugs in earlier versions of PHP.
-
-  4. If you want to receive notifications when a session expires, then
-  	 you can tag a session with an EXPIREREF, and before the session
-	 record is deleted, we can call a function that will pass the EXPIREREF
-	 as the first parameter, and the session key as the second parameter.
-	 
-	 To do this, define a notification function, say NotifyFn:
-	 
-	 	function NotifyFn($expireref, $sesskey)
-	 	{
-	 	}
-	 
-	 Then you need to define a global variable $ADODB_SESSION_EXPIRE_NOTIFY.
-	 This is an array with 2 elements, the first being the name of the variable
-	 you would like to store in the EXPIREREF field, and the 2nd is the 
-	 notification function's name.
-	 
-	 In this example, we want to be notified when a user's session 
-	 has expired, so we store the user id in the global variable $USERID, 
-	 store this value in the EXPIREREF field:
-	 
-	 	$ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
-		
-	Then when the NotifyFn is called, we are passed the $USERID as the first
-	parameter, eg. NotifyFn($userid, $sesskey).
-*/
-
-if (!defined('_ADODB_LAYER')) {
-	include (dirname(__FILE__).'/adodb.inc.php');
-}
-
-if (!defined('ADODB_SESSION')) {
-
- define('ADODB_SESSION',1);
- 
- /* if database time and system time is difference is greater than this, then give warning */
- define('ADODB_SESSION_SYNCH_SECS',60); 
-
-/****************************************************************************************\
-	Global definitions
-\****************************************************************************************/
-GLOBAL 	$ADODB_SESSION_CONNECT, 
-	$ADODB_SESSION_DRIVER,
-	$ADODB_SESSION_USER,
-	$ADODB_SESSION_PWD,
-	$ADODB_SESSION_DB,
-	$ADODB_SESS_CONN,
-	$ADODB_SESS_LIFE,
-	$ADODB_SESS_DEBUG,
-	$ADODB_SESSION_EXPIRE_NOTIFY,
-	$ADODB_SESSION_CRC,
-	$ADODB_SESSION_USE_LOBS,
-	$ADODB_SESSION_TBL;
-	
-	if (!isset($ADODB_SESSION_USE_LOBS)) $ADODB_SESSION_USE_LOBS = 'CLOB';
-	
-	$ADODB_SESS_LIFE = ini_get('session.gc_maxlifetime');
-	if ($ADODB_SESS_LIFE <= 1) {
-	 // bug in PHP 4.0.3 pl 1  -- how about other versions?
-	 //print "<h3>Session Error: PHP.INI setting <i>session.gc_maxlifetime</i>not set: $ADODB_SESS_LIFE</h3>";
-	 	$ADODB_SESS_LIFE=1440;
-	}
-	$ADODB_SESSION_CRC = false;
-	//$ADODB_SESS_DEBUG = true;
-	
-	//////////////////////////////////
-	/* SET THE FOLLOWING PARAMETERS */
-	//////////////////////////////////
-	
-	if (empty($ADODB_SESSION_DRIVER)) {
-		$ADODB_SESSION_DRIVER='mysql';
-		$ADODB_SESSION_CONNECT='localhost';
-		$ADODB_SESSION_USER ='root';
-		$ADODB_SESSION_PWD ='';
-		$ADODB_SESSION_DB ='xphplens_2';
-	}
-	
-	if (empty($ADODB_SESSION_EXPIRE_NOTIFY)) {
-		$ADODB_SESSION_EXPIRE_NOTIFY = false;
-	}
-	//  Made table name configurable - by David Johnson djohnson@inpro.net
-	if (empty($ADODB_SESSION_TBL)){
-		$ADODB_SESSION_TBL = 'sessions';
-	}
-	
-
-	// defaulting $ADODB_SESSION_USE_LOBS
-	if (!isset($ADODB_SESSION_USE_LOBS) || empty($ADODB_SESSION_USE_LOBS)) {
-		$ADODB_SESSION_USE_LOBS = false;
-	}
-
-	/*
-	$ADODB_SESS['driver'] = $ADODB_SESSION_DRIVER;
-	$ADODB_SESS['connect'] = $ADODB_SESSION_CONNECT;
-	$ADODB_SESS['user'] = $ADODB_SESSION_USER;
-	$ADODB_SESS['pwd'] = $ADODB_SESSION_PWD;
-	$ADODB_SESS['db'] = $ADODB_SESSION_DB;
-	$ADODB_SESS['life'] = $ADODB_SESS_LIFE;
-	$ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
-	
-	$ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
-	$ADODB_SESS['table'] = $ADODB_SESS_TBL;
-	*/
-	
-/****************************************************************************************\
-	Create the connection to the database. 
-	
-	If $ADODB_SESS_CONN already exists, reuse that connection
-\****************************************************************************************/
-function adodb_sess_open($save_path, $session_name,$persist=true) 
-{
-GLOBAL $ADODB_SESS_CONN;
-	if (isset($ADODB_SESS_CONN)) return true;
-	
-GLOBAL 	$ADODB_SESSION_CONNECT, 
-	$ADODB_SESSION_DRIVER,
-	$ADODB_SESSION_USER,
-	$ADODB_SESSION_PWD,
-	$ADODB_SESSION_DB,
-	$ADODB_SESS_DEBUG;
-	
-	// cannot use & below - do not know why...
-	$ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER);
-	if (!empty($ADODB_SESS_DEBUG)) {
-		$ADODB_SESS_CONN->debug = true;
-		ADOConnection::outp( " conn=$ADODB_SESSION_CONNECT user=$ADODB_SESSION_USER pwd=$ADODB_SESSION_PWD db=$ADODB_SESSION_DB ");
-	}
-	if ($persist) $ok = $ADODB_SESS_CONN->PConnect($ADODB_SESSION_CONNECT,
-			$ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
-	else $ok = $ADODB_SESS_CONN->Connect($ADODB_SESSION_CONNECT,
-			$ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
-	
-	if (!$ok) ADOConnection::outp( "
--- Session: connection failed</p>",false);
-}
-
-/****************************************************************************************\
-	Close the connection
-\****************************************************************************************/
-function adodb_sess_close() 
-{
-global $ADODB_SESS_CONN;
-
-	if ($ADODB_SESS_CONN) $ADODB_SESS_CONN->Close();
-	return true;
-}
-
-/****************************************************************************************\
-	Slurp in the session variables and return the serialized string
-\****************************************************************************************/
-function adodb_sess_read($key) 
-{
-global $ADODB_SESS_CONN,$ADODB_SESSION_TBL,$ADODB_SESSION_CRC;
-
-	$rs = $ADODB_SESS_CONN->Execute("SELECT data FROM $ADODB_SESSION_TBL WHERE sesskey = '$key' AND expiry >= " . time());
-	if ($rs) {
-		if ($rs->EOF) {
-			$v = '';
-		} else 
-			$v = rawurldecode(reset($rs->fields));
-			
-		$rs->Close();
-		
-		// new optimization adodb 2.1
-		$ADODB_SESSION_CRC = strlen($v).crc32($v);
-		
-		return $v;
-	}
-	
-	return ''; // thx to Jorma Tuomainen, webmaster#wizactive.com
-}
-
-/****************************************************************************************\
-	Write the serialized data to a database.
-	
-	If the data has not been modified since adodb_sess_read(), we do not write.
-\****************************************************************************************/
-function adodb_sess_write($key, $val) 
-{
-	global
-		$ADODB_SESS_CONN, 
-		$ADODB_SESS_LIFE, 
-		$ADODB_SESSION_TBL,
-		$ADODB_SESS_DEBUG, 
-		$ADODB_SESSION_CRC,
-		$ADODB_SESSION_EXPIRE_NOTIFY,
-		$ADODB_SESSION_DRIVER,			// added
-		$ADODB_SESSION_USE_LOBS;		// added
-
-	$expiry = time() + $ADODB_SESS_LIFE;
-	
-	// crc32 optimization since adodb 2.1
-	// now we only update expiry date, thx to sebastian thom in adodb 2.32
-	if ($ADODB_SESSION_CRC !== false && $ADODB_SESSION_CRC == strlen($val).crc32($val)) {
-		if ($ADODB_SESS_DEBUG) echo "
--- Session: Only updating date - crc32 not changed</p>";
-		$qry = "UPDATE $ADODB_SESSION_TBL SET expiry=$expiry WHERE sesskey='$key' AND expiry >= " . time();
-		$rs = $ADODB_SESS_CONN->Execute($qry);	
-		return true;
-	}
-	$val = rawurlencode($val);
-	
-	$arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val);
-	if ($ADODB_SESSION_EXPIRE_NOTIFY) {
-		$var = reset($ADODB_SESSION_EXPIRE_NOTIFY);
-		global $$var;
-		$arr['expireref'] = $$var;
-	}
-
-	
-	if ($ADODB_SESSION_USE_LOBS === false) {	// no lobs, simply use replace()
-		$rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL,$arr, 'sesskey',$autoQuote = true);
-		if (!$rs) {
-			$err = $ADODB_SESS_CONN->ErrorMsg();
-		}
-	} else {
-		// what value shall we insert/update for lob row?
-		switch ($ADODB_SESSION_DRIVER) {
-			// empty_clob or empty_lob for oracle dbs
-			case "oracle":
-			case "oci8":
-			case "oci8po":
-			case "oci805":
-				$lob_value = sprintf("empty_%s()", strtolower($ADODB_SESSION_USE_LOBS));
-				break;
-
-			// null for all other
-			default:
-				$lob_value = "null";
-				break;
-		}
-
-		// do we insert or update? => as for sesskey
-		$res = $ADODB_SESS_CONN->Execute("select count(*) as cnt from $ADODB_SESSION_TBL where sesskey = '$key'");
-		if ($res && reset($res->fields) > 0) {
-			$qry = sprintf("update %s set expiry = %d, data = %s where sesskey = '%s'", $ADODB_SESSION_TBL, $expiry, $lob_value, $key);
-		} else {
-			// insert
-			$qry = sprintf("insert into %s (sesskey, expiry, data) values ('%s', %d, %s)", $ADODB_SESSION_TBL, $key, $expiry, $lob_value);
-		}
-
-		$err = "";
-		$rs1 = $ADODB_SESS_CONN->Execute($qry);
-		if (!$rs1) {
-			$err .= $ADODB_SESS_CONN->ErrorMsg()."\n";
-		}
-		$rs2 = $ADODB_SESS_CONN->UpdateBlob($ADODB_SESSION_TBL, 'data', $val, "sesskey='$key'", strtoupper($ADODB_SESSION_USE_LOBS));
-		if (!$rs2) {
-			$err .= $ADODB_SESS_CONN->ErrorMsg()."\n";
-		}
-		$rs = ($rs1 && $rs2) ? true : false;
-	}
-
-	if (!$rs) {
-		ADOConnection::outp( '
--- Session Replace: '.nl2br($err).'</p>',false);
-	}  else {
-		// bug in access driver (could be odbc?) means that info is not commited
-		// properly unless select statement executed in Win2000
-		if ($ADODB_SESS_CONN->databaseType == 'access') 
-			$rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'");
-	}
-	return !empty($rs);
-}
-
-function adodb_sess_destroy($key) 
-{
-	global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-	
-	if ($ADODB_SESSION_EXPIRE_NOTIFY) {
-		reset($ADODB_SESSION_EXPIRE_NOTIFY);
-		$fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
-		$savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
-		$rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
-		$ADODB_SESS_CONN->SetFetchMode($savem);
-		if ($rs) {
-			$ADODB_SESS_CONN->BeginTrans();
-			while (!$rs->EOF) {
-				$ref = $rs->fields[0];
-				$key = $rs->fields[1];
-				$fn($ref,$key);
-				$del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
-				$rs->MoveNext();
-			}
-			$ADODB_SESS_CONN->CommitTrans();
-		}
-	} else {
-		$qry = "DELETE FROM $ADODB_SESSION_TBL WHERE sesskey = '$key'";
-		$rs = $ADODB_SESS_CONN->Execute($qry);
-	}
-	return $rs ? true : false;
-}
-
-function adodb_sess_gc($maxlifetime) 
-{
-	global $ADODB_SESS_DEBUG, $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-	
-	if ($ADODB_SESSION_EXPIRE_NOTIFY) {
-		reset($ADODB_SESSION_EXPIRE_NOTIFY);
-		$fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
-		$savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
-		$t = time();
-		$rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE expiry < $t");
-		$ADODB_SESS_CONN->SetFetchMode($savem);
-		if ($rs) {
-			$ADODB_SESS_CONN->BeginTrans();
-			while (!$rs->EOF) {
-				$ref = $rs->fields[0];
-				$key = $rs->fields[1];
-				$fn($ref,$key);
-				$del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
-				$rs->MoveNext();
-			}
-			$rs->Close();
-			
-			//$ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE expiry < $t");
-			$ADODB_SESS_CONN->CommitTrans();
-			
-		}
-	} else {
-		$ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE expiry < " . time());
-	
-		if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- <b>Garbage Collection</b>: $qry</p>");
-	}
-	// suggested by Cameron, "GaM3R" <gamr@outworld.cx>
-	if (defined('ADODB_SESSION_OPTIMIZE')) {
-	global $ADODB_SESSION_DRIVER;
-	
-		switch( $ADODB_SESSION_DRIVER ) {
-			case 'mysql':
-			case 'mysqlt':
-				$opt_qry = 'OPTIMIZE TABLE '.$ADODB_SESSION_TBL;
-				break;
-			case 'postgresql':
-			case 'postgresql7':
-				$opt_qry = 'VACUUM '.$ADODB_SESSION_TBL;	
-				break;
-		}
-		if (!empty($opt_qry)) {
-			$ADODB_SESS_CONN->Execute($opt_qry);
-		}
-	}
-	if ($ADODB_SESS_CONN->dataProvider === 'oci8') $sql = 'select  TO_CHAR('.($ADODB_SESS_CONN->sysTimeStamp).', \'RRRR-MM-DD HH24:MI:SS\') from '. $ADODB_SESSION_TBL;
-	else $sql = 'select '.$ADODB_SESS_CONN->sysTimeStamp.' from '. $ADODB_SESSION_TBL;
-	
-	$rs =& $ADODB_SESS_CONN->SelectLimit($sql,1);
-	if ($rs && !$rs->EOF) {
-	
-		$dbts = reset($rs->fields);
-		$rs->Close();
-		$dbt = $ADODB_SESS_CONN->UnixTimeStamp($dbts);
-		$t = time();
-		if (abs($dbt - $t) >= ADODB_SESSION_SYNCH_SECS) {
-			$msg = 
-			__FILE__.": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: database=$dbt ($dbts), webserver=$t (diff=".(abs($dbt-$t)/3600)." hrs)";
-			error_log($msg);
-			if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- $msg</p>");
-		}
-	}
-	
-	return true;
-}
-
-session_module_name('user'); 
-session_set_save_handler(
-	"adodb_sess_open",
-	"adodb_sess_close",
-	"adodb_sess_read",
-	"adodb_sess_write",
-	"adodb_sess_destroy",
-	"adodb_sess_gc");
-}
-
-/*  TEST SCRIPT -- UNCOMMENT */
-
-if (0) {
-
-	session_start();
-	session_register('AVAR');
-	$_SESSION['AVAR'] += 1;
-	ADOConnection::outp( "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}</p>",false);
-}
-
-?>
diff -ruN 0.761/includes/classes/adodb/session/old/adodb-session.php 0.762/includes/classes/adodb/session/old/adodb-session.php
--- 0.761/includes/classes/adodb/session/old/adodb-session.php	2005-07-24 11:58:33.000000000 -0500
+++ 0.762/includes/classes/adodb/session/old/adodb-session.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,439 +0,0 @@
-<?php
-/*
-V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence.
-	  Set tabs to 4 for best viewing.
-  
-  Latest version of ADODB is available at http://php.weblogs.com/adodb
-  ======================================================================
-  
- This file provides PHP4 session management using the ADODB database
-wrapper library.
- 
- Example
- =======
- 
-	include('adodb.inc.php');
-	include('adodb-session.php');
-	session_start();
-	session_register('AVAR');
-	$_SESSION['AVAR'] += 1;
-	print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";
-	
-To force non-persistent connections, call adodb_session_open first before session_start():
-
-	include('adodb.inc.php');
-	include('adodb-session.php');
-	adodb_sess_open(false,false,false);
-	session_start();
-	session_register('AVAR');
-	$_SESSION['AVAR'] += 1;
-	print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";
-
- 
- Installation
- ============
- 1. Create this table in your database (syntax might vary depending on your db):
- 
-  create table sessions (
-	   SESSKEY char(32) not null,
-	   EXPIRY int(11) unsigned not null,
-	   EXPIREREF varchar(64),
-	   DATA text not null,
-	  primary key (sesskey)
-  );
-  
-  For oracle:
-    create table sessions (
-	   SESSKEY char(32) not null,
-	   EXPIRY DECIMAL(16)  not null,
-	   EXPIREREF varchar(64),
-	   DATA varchar(4000) not null,
-	  primary key (sesskey)
-  );
-
-
-  2. Then define the following parameters. You can either modify
-     this file, or define them before this file is included:
-	 
-  	$ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase';
-	$ADODB_SESSION_CONNECT='server to connect to';
-	$ADODB_SESSION_USER ='user';
-	$ADODB_SESSION_PWD ='password';
-	$ADODB_SESSION_DB ='database';
-	$ADODB_SESSION_TBL = 'sessions'
-	
-  3. Recommended is PHP 4.1.0 or later. There are documented
-	 session bugs in earlier versions of PHP.
-
-  4. If you want to receive notifications when a session expires, then
-  	 you can tag a session with an EXPIREREF, and before the session
-	 record is deleted, we can call a function that will pass the EXPIREREF
-	 as the first parameter, and the session key as the second parameter.
-	 
-	 To do this, define a notification function, say NotifyFn:
-	 
-	 	function NotifyFn($expireref, $sesskey)
-	 	{
-	 	}
-	 
-	 Then you need to define a global variable $ADODB_SESSION_EXPIRE_NOTIFY.
-	 This is an array with 2 elements, the first being the name of the variable
-	 you would like to store in the EXPIREREF field, and the 2nd is the 
-	 notification function's name.
-	 
-	 In this example, we want to be notified when a user's session 
-	 has expired, so we store the user id in the global variable $USERID, 
-	 store this value in the EXPIREREF field:
-	 
-	 	$ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
-		
-	Then when the NotifyFn is called, we are passed the $USERID as the first
-	parameter, eg. NotifyFn($userid, $sesskey).
-*/
-
-if (!defined('_ADODB_LAYER')) {
-	include (dirname(__FILE__).'/adodb.inc.php');
-}
-
-if (!defined('ADODB_SESSION')) {
-
- define('ADODB_SESSION',1);
- 
- /* if database time and system time is difference is greater than this, then give warning */
- define('ADODB_SESSION_SYNCH_SECS',60); 
-
- /*
-	Thanks Joe Li. See http://phplens.com/lens/lensforum/msgs.php?id=11487&x=1
-*/
-function adodb_session_regenerate_id() 
-{
-	$conn =& ADODB_Session::_conn();
-	if (!$conn) return false;
-
-	$old_id = session_id();
-	if (function_exists('session_regenerate_id')) {
-		session_regenerate_id();
-	} else {
-		session_id(md5(uniqid(rand(), true)));
-		$ck = session_get_cookie_params();
-		setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
-		//@session_start();
-	}
-	$new_id = session_id();
-	$ok =& $conn->Execute('UPDATE '. ADODB_Session::table(). ' SET sesskey='. $conn->qstr($new_id). ' WHERE sesskey='.$conn->qstr($old_id));
-	
-	/* it is possible that the update statement fails due to a collision */
-	if (!$ok) {
-		session_id($old_id);
-		if (empty($ck)) $ck = session_get_cookie_params();
-		setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
-		return false;
-	}
-	
-	return true;
-}
-
-/****************************************************************************************\
-	Global definitions
-\****************************************************************************************/
-GLOBAL 	$ADODB_SESSION_CONNECT, 
-	$ADODB_SESSION_DRIVER,
-	$ADODB_SESSION_USER,
-	$ADODB_SESSION_PWD,
-	$ADODB_SESSION_DB,
-	$ADODB_SESS_CONN,
-	$ADODB_SESS_LIFE,
-	$ADODB_SESS_DEBUG,
-	$ADODB_SESSION_EXPIRE_NOTIFY,
-	$ADODB_SESSION_CRC,
-	$ADODB_SESSION_TBL;
-	
-	
-	$ADODB_SESS_LIFE = ini_get('session.gc_maxlifetime');
-	if ($ADODB_SESS_LIFE <= 1) {
-	 // bug in PHP 4.0.3 pl 1  -- how about other versions?
-	 //print "<h3>Session Error: PHP.INI setting <i>session.gc_maxlifetime</i>not set: $ADODB_SESS_LIFE</h3>";
-	 	$ADODB_SESS_LIFE=1440;
-	}
-	$ADODB_SESSION_CRC = false;
-	//$ADODB_SESS_DEBUG = true;
-	
-	//////////////////////////////////
-	/* SET THE FOLLOWING PARAMETERS */
-	//////////////////////////////////
-	
-	if (empty($ADODB_SESSION_DRIVER)) {
-		$ADODB_SESSION_DRIVER='mysql';
-		$ADODB_SESSION_CONNECT='localhost';
-		$ADODB_SESSION_USER ='root';
-		$ADODB_SESSION_PWD ='';
-		$ADODB_SESSION_DB ='xphplens_2';
-	}
-	
-	if (empty($ADODB_SESSION_EXPIRE_NOTIFY)) {
-		$ADODB_SESSION_EXPIRE_NOTIFY = false;
-	}
-	//  Made table name configurable - by David Johnson djohnson@inpro.net
-	if (empty($ADODB_SESSION_TBL)){
-		$ADODB_SESSION_TBL = 'sessions';
-	}
-	
-	/*
-	$ADODB_SESS['driver'] = $ADODB_SESSION_DRIVER;
-	$ADODB_SESS['connect'] = $ADODB_SESSION_CONNECT;
-	$ADODB_SESS['user'] = $ADODB_SESSION_USER;
-	$ADODB_SESS['pwd'] = $ADODB_SESSION_PWD;
-	$ADODB_SESS['db'] = $ADODB_SESSION_DB;
-	$ADODB_SESS['life'] = $ADODB_SESS_LIFE;
-	$ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
-	
-	$ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
-	$ADODB_SESS['table'] = $ADODB_SESS_TBL;
-	*/
-	
-/****************************************************************************************\
-	Create the connection to the database. 
-	
-	If $ADODB_SESS_CONN already exists, reuse that connection
-\****************************************************************************************/
-function adodb_sess_open($save_path, $session_name,$persist=true) 
-{
-GLOBAL $ADODB_SESS_CONN;
-	if (isset($ADODB_SESS_CONN)) return true;
-	
-GLOBAL 	$ADODB_SESSION_CONNECT, 
-	$ADODB_SESSION_DRIVER,
-	$ADODB_SESSION_USER,
-	$ADODB_SESSION_PWD,
-	$ADODB_SESSION_DB,
-	$ADODB_SESS_DEBUG;
-	
-	// cannot use & below - do not know why...
-	$ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER);
-	if (!empty($ADODB_SESS_DEBUG)) {
-		$ADODB_SESS_CONN->debug = true;
-		ADOConnection::outp( " conn=$ADODB_SESSION_CONNECT user=$ADODB_SESSION_USER pwd=$ADODB_SESSION_PWD db=$ADODB_SESSION_DB ");
-	}
-	if ($persist) $ok = $ADODB_SESS_CONN->PConnect($ADODB_SESSION_CONNECT,
-			$ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
-	else $ok = $ADODB_SESS_CONN->Connect($ADODB_SESSION_CONNECT,
-			$ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
-	
-	if (!$ok) ADOConnection::outp( "
--- Session: connection failed</p>",false);
-}
-
-/****************************************************************************************\
-	Close the connection
-\****************************************************************************************/
-function adodb_sess_close() 
-{
-global $ADODB_SESS_CONN;
-
-	if ($ADODB_SESS_CONN) $ADODB_SESS_CONN->Close();
-	return true;
-}
-
-/****************************************************************************************\
-	Slurp in the session variables and return the serialized string
-\****************************************************************************************/
-function adodb_sess_read($key) 
-{
-global $ADODB_SESS_CONN,$ADODB_SESSION_TBL,$ADODB_SESSION_CRC;
-
-	$rs = $ADODB_SESS_CONN->Execute("SELECT data FROM $ADODB_SESSION_TBL WHERE sesskey = '$key' AND expiry >= " . time());
-	if ($rs) {
-		if ($rs->EOF) {
-			$v = '';
-		} else 
-			$v = rawurldecode(reset($rs->fields));
-			
-		$rs->Close();
-		
-		// new optimization adodb 2.1
-		$ADODB_SESSION_CRC = strlen($v).crc32($v);
-		
-		return $v;
-	}
-	
-	return ''; // thx to Jorma Tuomainen, webmaster#wizactive.com
-}
-
-/****************************************************************************************\
-	Write the serialized data to a database.
-	
-	If the data has not been modified since adodb_sess_read(), we do not write.
-\****************************************************************************************/
-function adodb_sess_write($key, $val) 
-{
-	global
-		$ADODB_SESS_CONN, 
-		$ADODB_SESS_LIFE, 
-		$ADODB_SESSION_TBL,
-		$ADODB_SESS_DEBUG, 
-		$ADODB_SESSION_CRC,
-		$ADODB_SESSION_EXPIRE_NOTIFY;
-
-	$expiry = time() + $ADODB_SESS_LIFE;
-	
-	// crc32 optimization since adodb 2.1
-	// now we only update expiry date, thx to sebastian thom in adodb 2.32
-	if ($ADODB_SESSION_CRC !== false && $ADODB_SESSION_CRC == strlen($val).crc32($val)) {
-		if ($ADODB_SESS_DEBUG) echo "
--- Session: Only updating date - crc32 not changed</p>";
-		$qry = "UPDATE $ADODB_SESSION_TBL SET expiry=$expiry WHERE sesskey='$key' AND expiry >= " . time();
-		$rs = $ADODB_SESS_CONN->Execute($qry);	
-		return true;
-	}
-	$val = rawurlencode($val);
-	
-	$arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val);
-	if ($ADODB_SESSION_EXPIRE_NOTIFY) {
-		$var = reset($ADODB_SESSION_EXPIRE_NOTIFY);
-		global $$var;
-		$arr['expireref'] = $$var;
-	}
-	$rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL,$arr,
-    	'sesskey',$autoQuote = true);
-	
-	if (!$rs) {
-		ADOConnection::outp( '
--- Session Replace: '.$ADODB_SESS_CONN->ErrorMsg().'</p>',false);
-	}  else {
-		// bug in access driver (could be odbc?) means that info is not commited
-		// properly unless select statement executed in Win2000
-		if ($ADODB_SESS_CONN->databaseType == 'access') 
-			$rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'");
-	}
-	return !empty($rs);
-}
-
-function adodb_sess_destroy($key) 
-{
-	global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-	
-	if ($ADODB_SESSION_EXPIRE_NOTIFY) {
-		reset($ADODB_SESSION_EXPIRE_NOTIFY);
-		$fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
-		$savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
-		$rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
-		$ADODB_SESS_CONN->SetFetchMode($savem);
-		if ($rs) {
-			$ADODB_SESS_CONN->BeginTrans();
-			while (!$rs->EOF) {
-				$ref = $rs->fields[0];
-				$key = $rs->fields[1];
-				$fn($ref,$key);
-				$del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
-				$rs->MoveNext();
-			}
-			$ADODB_SESS_CONN->CommitTrans();
-		}
-	} else {
-		$qry = "DELETE FROM $ADODB_SESSION_TBL WHERE sesskey = '$key'";
-		$rs = $ADODB_SESS_CONN->Execute($qry);
-	}
-	return $rs ? true : false;
-}
-
-function adodb_sess_gc($maxlifetime) 
-{
-	global $ADODB_SESS_DEBUG, $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-	
-	if ($ADODB_SESSION_EXPIRE_NOTIFY) {
-		reset($ADODB_SESSION_EXPIRE_NOTIFY);
-		$fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
-		$savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
-		$t = time();
-		$rs =& $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE expiry < $t");
-		$ADODB_SESS_CONN->SetFetchMode($savem);
-		if ($rs) {
-			$ADODB_SESS_CONN->BeginTrans();
-			while (!$rs->EOF) {
-				$ref = $rs->fields[0];
-				$key = $rs->fields[1];
-				$fn($ref,$key);
-				$del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
-				$rs->MoveNext();
-			}
-			$rs->Close();
-			
-			$ADODB_SESS_CONN->CommitTrans();
-			
-		}
-	} else {
-		$qry = "DELETE FROM $ADODB_SESSION_TBL WHERE expiry < " . time();
-		$ADODB_SESS_CONN->Execute($qry);
-	
-		if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- <b>Garbage Collection</b>: $qry</p>");
-	}
-	// suggested by Cameron, "GaM3R" <gamr@outworld.cx>
-	if (defined('ADODB_SESSION_OPTIMIZE')) {
-	global $ADODB_SESSION_DRIVER;
-	
-		switch( $ADODB_SESSION_DRIVER ) {
-			case 'mysql':
-			case 'mysqlt':
-				$opt_qry = 'OPTIMIZE TABLE '.$ADODB_SESSION_TBL;
-				break;
-			case 'postgresql':
-			case 'postgresql7':
-				$opt_qry = 'VACUUM '.$ADODB_SESSION_TBL;	
-				break;
-		}
-		if (!empty($opt_qry)) {
-			$ADODB_SESS_CONN->Execute($opt_qry);
-		}
-	}
-	if ($ADODB_SESS_CONN->dataProvider === 'oci8') $sql = 'select  TO_CHAR('.($ADODB_SESS_CONN->sysTimeStamp).', \'RRRR-MM-DD HH24:MI:SS\') from '. $ADODB_SESSION_TBL;
-	else $sql = 'select '.$ADODB_SESS_CONN->sysTimeStamp.' from '. $ADODB_SESSION_TBL;
-	
-	$rs =& $ADODB_SESS_CONN->SelectLimit($sql,1);
-	if ($rs && !$rs->EOF) {
-	
-		$dbts = reset($rs->fields);
-		$rs->Close();
-		$dbt = $ADODB_SESS_CONN->UnixTimeStamp($dbts);
-		$t = time();
-	
-		if (abs($dbt - $t) >= ADODB_SESSION_SYNCH_SECS) {
-		
-			$msg = 
-			__FILE__.": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: database=$dbt ($dbts), webserver=$t (diff=".(abs($dbt-$t)/3600)." hrs)";
-			error_log($msg);
-			if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- $msg</p>");
-		}
-	}
-	
-	return true;
-}
-
-session_module_name('user'); 
-session_set_save_handler(
-	"adodb_sess_open",
-	"adodb_sess_close",
-	"adodb_sess_read",
-	"adodb_sess_write",
-	"adodb_sess_destroy",
-	"adodb_sess_gc");
-}
-
-/*  TEST SCRIPT -- UNCOMMENT */
-
-if (0) {
-
-	session_start();
-	session_register('AVAR');
-	$_SESSION['AVAR'] += 1;
-	ADOConnection::outp( "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}</p>",false);
-}
-
-?>
\ No newline at end of file
diff -ruN 0.761/includes/classes/adodb/session/old/crypt.inc.php 0.762/includes/classes/adodb/session/old/crypt.inc.php
--- 0.761/includes/classes/adodb/session/old/crypt.inc.php	2004-11-15 15:04:59.000000000 -0600
+++ 0.762/includes/classes/adodb/session/old/crypt.inc.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,64 +0,0 @@
-<?php
-//	 Session Encryption by Ari Kuorikoski <ari.kuorikoski@finebyte.com>
-class MD5Crypt{
-		function keyED($txt,$encrypt_key)
-		{
-				$encrypt_key = md5($encrypt_key);
-				$ctr=0;
-				$tmp = "";
-				for ($i=0;$i<strlen($txt);$i++){
-						if ($ctr==strlen($encrypt_key)) $ctr=0;
-						$tmp.= substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1);
-						$ctr++;
-				}
-				return $tmp;
-		}
-
-		function Encrypt($txt,$key)
-		{
-				srand((double)microtime()*1000000);
-				$encrypt_key = md5(rand(0,32000));
-				$ctr=0;
-				$tmp = "";
-				for ($i=0;$i<strlen($txt);$i++)
-				{
-				if ($ctr==strlen($encrypt_key)) $ctr=0;
-				$tmp.= substr($encrypt_key,$ctr,1) .
-				(substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1));
-				$ctr++;
-				}
-				return base64_encode($this->keyED($tmp,$key));
-		}
-
-		function Decrypt($txt,$key)
-		{
-				$txt = $this->keyED(base64_decode($txt),$key);
-				$tmp = "";
-				for ($i=0;$i<strlen($txt);$i++){
-						$md5 = substr($txt,$i,1);
-						$i++;
-						$tmp.= (substr($txt,$i,1) ^ $md5);
-				}
-				return $tmp;
-		}
-
-		function RandPass()
-		{
-				$randomPassword = "";
-				srand((double)microtime()*1000000);
-				for($i=0;$i<8;$i++)
-				{
-						$randnumber = rand(48,120);
-
-						while (($randnumber >= 58 && $randnumber <= 64) || ($randnumber >= 91 && $randnumber <= 96))
-						{
-								$randnumber = rand(48,120);
-						}
-
-						$randomPassword .= chr($randnumber);
-				}
-				return $randomPassword;
-		}
-
-}
-?>
\ No newline at end of file
diff -ruN 0.761/includes/classes/adodb/toexport.inc.php 0.762/includes/classes/adodb/toexport.inc.php
--- 0.761/includes/classes/adodb/toexport.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/toexport.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,7 +1,7 @@
 <?php
 
 /** 
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+ * @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
diff -ruN 0.761/includes/classes/adodb/tohtml.inc.php 0.762/includes/classes/adodb/tohtml.inc.php
--- 0.761/includes/classes/adodb/tohtml.inc.php	2005-07-24 11:58:29.000000000 -0500
+++ 0.762/includes/classes/adodb/tohtml.inc.php	2005-10-10 09:04:05.000000000 -0500
@@ -1,6 +1,6 @@
 <?php 
 /*
-  V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
+  V4.66 28 Sept 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
diff -ruN 0.761/includes/classes/adodb/xmlschema.dtd 0.762/includes/classes/adodb/xmlschema.dtd
--- 0.761/includes/classes/adodb/xmlschema.dtd	2005-03-22 11:12:53.000000000 -0600
+++ 0.762/includes/classes/adodb/xmlschema.dtd	2005-10-10 09:04:05.000000000 -0500
@@ -2,8 +2,9 @@
 <!DOCTYPE adodb_schema [
 <!ELEMENT schema (table*, sql*)>
 <!ATTLIST schema version CDATA #REQUIRED>
-<!ELEMENT table ((field+|DROP), constraint*, descr?, index*, data*)>
-<!ELEMENT field ((NOTNULL|KEY|PRIMARY)?, (AUTO|AUTOINCREMENT)?, (DEFAULT|DEFDATE|DEFTIMESTAMP)?, NOQUOTE, constraint, descr?)>
+<!ELEMENT table ((field+|DROP), CONSTRAINT*, descr?, index*, data*)>
+<!ELEMENT field ((NOTNULL|KEY|PRIMARY)?, (AUTO|AUTOINCREMENT)?, (DEFAULT|DEFDATE|DEFTIMESTAMP)?, 
+NOQUOTE?, CONSTRAINT*, descr?)>
 <!ELEMENT data (row+)>
 <!ELEMENT row (f+)>
 <!ELEMENT f (#CDATA)>
@@ -18,12 +19,12 @@
 <!ELEMENT DEFTIMESTAMP EMPTY>
 <!ELEMENT NOQUOTE EMPTY>
 <!ELEMENT DROP EMPTY>
-<!ELEMENT constraint (#CDATA)>
+<!ELEMENT CONSTRAINT (#CDATA)>
 <!ATTLIST table name CDATA #REQUIRED platform CDATA #IMPLIED version CDATA #IMPLIED>
 <!ATTLIST field name CDATA #REQUIRED type (C|C2|X|X2|B|D|T|L|I|F|N) #REQUIRED size CDATA #IMPLIED>
 <!ATTLIST data platform CDATA #IMPLIED>
 <!ATTLIST f name CDATA #IMPLIED>
-<!ATTLIST DEFAULT value CDATA #REQUIRED>
+<!ATTLIST DEFAULT VALUE CDATA #REQUIRED>
 <!ELEMENT index ((col+|DROP), CLUSTERED?, BITMAP?, UNIQUE?, FULLTEXT?, HASH?, descr?)>
 <!ELEMENT col (#CDATA)>
 <!ELEMENT CLUSTERED EMPTY>
@@ -35,4 +36,4 @@
 <!ELEMENT sql (query+, descr?)>
 <!ELEMENT query (#CDATA)>
 <!ATTLIST sql name CDATA #IMPLIED platform CDATA #IMPLIED, key CDATA, prefixmethod (AUTO|MANUAL|NONE) >
-] >
+] >
\ No newline at end of file
diff -ruN 0.761/includes/classes/.htaccess 0.762/includes/classes/.htaccess
--- 0.761/includes/classes/.htaccess	1969-12-31 18:00:00.000000000 -0600
+++ 0.762/includes/classes/.htaccess	2005-12-19 02:05:48.000000000 -0600
@@ -0,0 +1,2 @@
+order allow,deny
+deny from all
\ No newline at end of file
diff -ruN 0.761/includes/classes/idna/idna_convert.class.php 0.762/includes/classes/idna/idna_convert.class.php
--- 0.761/includes/classes/idna/idna_convert.class.php	2004-05-17 11:09:40.000000000 -0500
+++ 0.762/includes/classes/idna/idna_convert.class.php	2005-10-18 14:52:06.000000000 -0500
@@ -1,223 +1,487 @@
 <?php
 /* ------------------------------------------------------------------------- */
-/* idna_convert.class.php - Encode / Decode punycode based domain names      */
-/* (c) 2004 blue birdy, Berlin (http://bluebirdy.de)                         */
+/* idna_convert.class.php - Encode / Decode Internationalized Domain Names   */
+/* (c) 2004-2005 phlyLabs, Berlin (http://phlylabs.de)                       */
 /* All rights reserved                                                       */
-/* v0.1.5                                                                    */
+/* v0.4.2                                                                    */
 /* ------------------------------------------------------------------------- */
 
-/*
- * This PHP class is derived work from the IDN extension for PHP, originally
- * written by JPNIC in C++ and the ANSI C code from RFC3492, written by
- * Adam M. Costello.
- * PHP port: Copyright 2004 blue birdy
- * All rights reserved.
- *
- *
- * By using this file, you agree to the terms and conditions set forth bellow.
+// {{{ license
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
+//
+// +----------------------------------------------------------------------+
+// | This library is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU Lesser General Public License as       |
+// | published by the Free Software Foundation; either version 2.1 of the |
+// | License, or (at your option) any later version.                      |
+// |                                                                      |
+// | This library is distributed in the hope that it will be useful, but  |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of           |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    |
+// | Lesser General Public License for more details.                      |
+// |                                                                      |
+// | You should have received a copy of the GNU Lesser General Public     |
+// | License along with this library; if not, write to the Free Software  |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 |
+// | USA.                                                                 |
+// +----------------------------------------------------------------------+
+//
+
+// }}}
+
+/**
+ * Encode/decode Internationalized Domain Names.
  *
- *                         LICENSE TERMS AND CONDITIONS
+ * The class allows to convert internationalized domain names
+ * (see RFC 3490 for details) as they can be used with various registries worldwide
+ * to be translated between their original (localized) form and their encoded form
+ * as it will be used in the DNS (Domain Name System).
  *
- * The following License Terms and Conditions apply, unless a different
- * license is obtained from
- * blue birdy, c/o M. Sommerfeld, Schmidstr. 7, 10179 Berlin, Germany.
+ * The class provides two public methods, encode() and decode(), which do exactly
+ * what you would expect them to do. You are allowed to use complete domain names,
+ * simple strings and complete email addresses as well. That means, that you might
+ * use any of the following notations:
  *
- * 1. Use, Modification and Redistribution (including distribution of any
- *    modified or derived work) in source and/or binary forms is permitted
- *    under these License Terms and Conditions.
+ * - www.nörgler.com
+ * - xn--nrgler-wxa
+ * - xn--brse-5qa.xn--knrz-1ra.info
  *
- * 2. Redistribution of source code must retain the copyright notices as they
- *    appear in the source code file, these License Terms and Conditions.
+ * Unicode input might be given as either UTF-8 string, UCS-4 string or UCS-4
+ * array. Unicode output is available in the same formats.
+ * You can select your preferred format via {@link set_paramter()}.
  *
- * 3. Redistribution in binary form must reproduce the Copyright Notice,
- *    these License Terms and Conditions, in the documentation and/or other
- *    materials provided with the distribution.  For the purposes of binary
- *    distribution the "Copyright Notice" refers to the following language:
- *    "(c) 2004 blue birdy, Berlin (http://bluebirdy.de)"
+ * ACE input and output is always expected to be ASCII.
  *
- * 4. The name of blue birdy may not be used to endorse or promote products
- *    derived from this software without specific prior written approval of
- *    blue birdy.
+ * @author  Matthias Sommerfeld <mso@phlylabs.de>
+ * @version 0.4.2
  *
- * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED "AS IS"
- *    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- *    PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUE BIRDY BE
- *    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- *    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- *    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- *    BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- *    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- *    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- *    ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  */
 
-
-
 class idna_convert
 {
+    // {{{ npdata
+    /**
+     * Holds all relevant mapping tables, loaded from a seperate file on construct
+     * See RFC3454 for details
+     *
+     * @var array
+     * @access private
+     */
+    var $_np_ = array();
+    // }}}
+
+
     // Internal settings, do not mess with them
-    var $punycode_prefix = 'xn--';
-    var $invalid_ucs =     0x80000000;
-    var $max_ucs =         0x10ffff;
-    var $base =            36;
-    var $tmin =            1;
-    var $tmax =            26;
-    var $skew =            38;
-    var $damp =            700;
-    var $initial_bias =    72;
-    var $initial_n =       0x80;
-    var $error =           FALSE;
+    var $_punycode_prefix = 'xn--';
+    var $_invalid_ucs =     0x80000000;
+    var $_max_ucs =         0x10FFFF;
+    var $_base =            36;
+    var $_tmin =            1;
+    var $_tmax =            26;
+    var $_skew =            38;
+    var $_damp =            700;
+    var $_initial_bias =    72;
+    var $_initial_n =       0x80;
+    var $_sbase =           0xAC00;
+    var $_lbase =           0x1100;
+    var $_vbase =           0x1161;
+    var $_tbase =           0x11a7;
+    var $_lcount =          19;
+    var $_vcount =          21;
+    var $_tcount =          28;
+    var $_ncount =          588;   // _vcount * _tcount
+    var $_scount =          11172; // _lcount * _tcount * _vcount
+    var $_error =           false;
+
+    // See set_parameter() for details of how to change the following settings
+    // from within your script / application
+    var $_api_encoding   =  'utf8'; // Default input charset is UTF-8
+    var $_allow_overlong =  false;  // Overlong UTF-8 encodings are forbidden
+    var $_strict_mode    =  false;  // Behave strict or not
 
     // The constructor
-    function idna_convert()
+    function idna_convert($options = false)
     {
-        return TRUE;
+        $this->slast = $this->_sbase + $this->_lcount * $this->_vcount * $this->_tcount;
+        if (function_exists('file_get_contents')) {
+            $this->_np_ = unserialize(file_get_contents(dirname(__FILE__).'/npdata.ser'));
+        } else {
+            $this->_np_ = unserialize(join('', file(dirname(__FILE__).'/npdata.ser')));
+        }
+        // If parameters are given, pass these to the respective method
+        if (is_array($options)) {
+            return $this->set_parameter($options);
+        }
+        return true;
+    }
+
+    /**
+    * Sets a new option value. Available options and values:
+    * [encoding - Use either UTF-8, UCS4 as array or UCS4 as string as input ('utf8' for UTF-8,
+    *         'ucs4_string' and 'ucs4_array' respectively for UCS4); The output is always UTF-8]
+    * [overlong - Unicode does not allow unnecessarily long encodings of chars,
+    *             to allow this, set this parameter to true, else to false;
+    *             default is false.]
+    * [strict - true: strict mode, good for registration purposes - Causes errors
+    *           on failures; false: loose mode, ideal for "wildlife" applications
+    *           by silently ignoring errors and returning the original input instead
+    *
+    * @param    mixed     Parameter to set (string: single parameter; array of Parameter => Value pairs)
+    * @param    string    Value to use (if parameter 1 is a string)
+    * @return   boolean   true on success, false otherwise
+    * @access   public
+    */
+    function set_parameter($option, $value = false)
+    {
+        if (!is_array($option)) {
+            $option = array($option => $value);
+        }
+        foreach ($option as $k => $v) {
+            switch ($k) {
+            case 'encoding':
+                switch ($v) {
+                case 'utf8':
+                case 'ucs4_string':
+                case 'ucs4_array':
+                    $this->_api_encoding = $v;
+                    break;
+                default:
+                    $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k);
+                    return false;
+                }
+                break;
+            case 'overlong':
+                $this->_allow_overlong = ($v) ? true : false;
+                break;
+            case 'strict':
+                $this->_strict_mode = ($v) ? true : false;
+                break;
+            default:
+                $this->_error('Set Parameter: Unknown option '.$k);
+                return false;
+            }
+        }
+        return true;
     }
 
-    // Decode a given Domain name
-    function decode($encoded)
-    {
-        // Clean up input
-        $encoded = trim($encoded);
-        // Call actual wrapper
-        return $this->_do_job($encoded, 'decode');
-    }
+    /**
+    * Decode a given ACE domain name
+    * @param    string   Domain name (ACE string)
+    * [@param    string   Desired output encoding, see {@link set_parameter}]
+    * @return   string   Decoded Domain name (UTF-8 or UCS-4)
+    * @access   public
+    */
+    function decode($input, $one_time_encoding = false)
+    {
+        // Optionally set
+        if ($one_time_encoding) {
+            switch ($one_time_encoding) {
+            case 'utf8':
+            case 'ucs4_string':
+            case 'ucs4_array':
+                break;
+            default:
+                $this->_error('Unknown encoding '.$one_time_encoding);
+                return false;
+            }
+        }
+        // Make sure to drop any newline characters around
+        $input = trim($input);
 
-    // Encode a given Domain name
-    function encode($decoded)
-    {
-        // Clean up input
-        $decoded = preg_replace('!!', 'ss', strtolower(trim($decoded)));
-        // Call actual wrapper
-        return $this->_do_job($decoded, 'encode');
+        // Negotiate input and try to determine, wether it is a plain string,
+        // an email address or something like a complete URL
+        if (strpos($input, '@')) { // Maybe it is an email address
+            // No no in strict mode
+            if ($this->_strict_mode) {
+                $this->_error('Only simple domain name parts can be handled in strict mode');
+                return false;
+            }
+            list($email_pref, $input) = explode('@', $input, 2);
+            $arr = explode('.', $input);
+            foreach ($arr as $k => $v) {
+                $conv = $this->_decode($v);
+                if ($conv) $arr[$k] = $conv;
+            }
+            $return = $email_pref . '@' . join('.', $arr);
+        } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters)
+            // No no in strict mode
+            if ($this->_strict_mode) {
+                $this->_error('Only simple domain name parts can be handled in strict mode');
+                return false;
+            }
+            $parsed = parse_url($input);
+            if (isset($parsed['host'])) {
+                $arr = explode('.', $parsed['host']);
+                foreach ($arr as $k => $v) {
+                    $conv = $this->_decode($v);
+                    if ($conv) $arr[$k] = $conv;
+                }
+                $parsed['host'] = join('.', $arr);
+                $return =
+                        (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://'))
+                        .(empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@')
+                        .$parsed['host']
+                        .(empty($parsed['port']) ? '' : ':'.$parsed['port'])
+                        .$parsed['path']
+                        .(empty($parsed['query']) ? '' : '?'.$parsed['query'])
+                        .(empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']);
+            } else { // parse_url seems to have failed, try without it
+                $arr = explode('.', $input);
+                foreach ($arr as $k => $v) {
+                    $conv = $this->_decode($v);
+                    if ($conv) $arr[$k] = $conv;
+                }
+                $return = join('.', $arr);
+            }
+        } else { // Otherwise we consider it being a pure domain name string
+            $return = $this->_decode($input);
+        }
+        // The output is UTF-8 by default, other output formats need conversion here
+        // If one time encoding is given, use this, else the objects property
+        switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
+        case 'utf8':
+            return $return;
+            break;
+        case 'ucs4_string':
+           return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return));
+           break;
+        case 'ucs4_array':
+            return $this->_utf8_to_ucs4($return);
+            break;
+        default:
+            $this->_error('Unsupported output format');
+            return false;
+        }
+    }
+
+    /**
+    * Encode a given UTF-8 domain name
+    * @param    string   Domain name (UTF-8 or UCS-4)
+    * [@param    string   Desired input encoding, see {@link set_parameter}]
+    * @return   string   Encoded Domain name (ACE string)
+    * @access   public
+    */
+    function encode($decoded, $one_time_encoding = false)
+    {
+        // Forcing conversion of input to UCS4 array
+        // If one time encoding is given, use this, else the objects property
+        switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
+        case 'utf8':
+            $decoded = $this->_utf8_to_ucs4($decoded);
+            break;
+        case 'ucs4_string':
+           $decoded = $this->_ucs4_string_to_ucs4($decoded);
+        case 'ucs4_array':
+           break;
+        default:
+            // $this->_error('Unsupported input format: '.$this->_api_encoding);
+            $this->_error('Unsupported input format');
+            return false;
+        }
+
+        // No input, no output, what else did you expect?
+        if (empty($decoded)) return '';
+
+        // Anchors for iteration
+        $last_begin = 0;
+        // Output string
+        $output = '';
+        foreach ($decoded as $k => $v) {
+            // Make sure to use just the plain dot
+            switch($v) {
+            case 0x3002:
+            case 0xFF0E:
+            case 0xFF61:
+                $decoded[$k] = 0x2E;
+                // It's right, no break here
+                // The codepoints above have to be converted to dots anyway
+
+            // Stumbling across an anchoring character
+            case 0x2E:
+            case 0x2F:
+            case 0x3A:
+            case 0x3F:
+            case 0x40:
+                // Neither email addresses nor URLs allowed in strict mode
+                if ($this->_strict_mode) {
+                   $this->_error('Neither email addresses nor URLs are allowed in strict mode.');
+                   return false;
+                } else {
+                    // Skip first char
+                    if ($k) {
+                        $encoded = '';
+                        $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin)));
+                        if ($encoded) {
+                            $output .= $encoded;
+                        } else {
+                            $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin)));
+                        }
+                        $output .= chr($decoded[$k]);
+                    }
+                    $last_begin = $k + 1;
+                }
+            }
+        }
+        // Catch the rest of the string
+        if ($last_begin) {
+            $inp_len = sizeof($decoded);
+            $encoded = '';
+            $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len)-$last_begin)));
+            if ($encoded) {
+                $output .= $encoded;
+            } else {
+                $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len)-$last_begin)));
+            }
+            return $output;
+        } else {
+            if ($output = $this->_encode($decoded)) {
+                return $output;
+            } else {
+                return $this->_ucs4_to_utf8($decoded);
+            }
+        }
     }
 
-    // Use this method to get the last error ocurred
+    /**
+    * Use this method to get the last error ocurred
+    * @param    void
+    * @return   string   The last error, that occured
+    * @access   public
+    */
     function get_last_error()
     {
-        return $this->error;
-    }
-
-    // Wrapper class to provide extended functionality
-    // This allows for processing complete email addresses and domain names
-    function _do_job($input, $mode)
-    {
-        $method = '_'.$mode;
-        // Maybe it is an email address
-        if (strpos($input, '@')) {
-            list($email_pref, $input) = explode('@', $input, 2);
-            $email_pref .= '@';
-        } else {
-            $email_pref = '';
-        }
-        // Process any substring
-        $arr = explode('.', $input);
-        foreach($arr as $k => $v) {
-            $conv = $this->$method($v);
-            if ($conv) $arr[$k] = $conv;
-        }
-        return $email_pref . join('.', $arr);
+        return $this->_error;
     }
 
-    // The actual decoding algorithm
+    /**
+    * The actual decoding algorithm
+    * @access   private
+    */
     function _decode($encoded)
     {
         // We do need to find the Punycode prefix
-        if (!preg_match('!^'.preg_quote($this->punycode_prefix, '!').'!', $encoded)) {
+        if (!preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $encoded)) {
             $this->_error('This is not a punycode string');
-            return FALSE;
+            return false;
         }
-        $encode_test = preg_replace('!^'.preg_quote($this->punycode_prefix, '!').'!', '', $encoded);
+        $encode_test = preg_replace('!^'.preg_quote($this->_punycode_prefix, '!').'!', '', $encoded);
         // If nothing left after removing the prefix, it is hopeless
         if (!$encode_test) {
             $this->_error('The given encoded string was empty');
-            return FALSE;
+            return false;
         }
         // Find last occurence of the delimiter
         $delim_pos = strrpos($encoded, '-');
-        $decoded = ($delim_pos > strlen($this->punycode_prefix))
-                 ? substr($encoded, strlen($this->punycode_prefix), ($delim_pos - strlen($this->punycode_prefix)))
-                 : '';
-
-        $deco_len = strlen($decoded);
+        if ($delim_pos > strlen($this->_punycode_prefix)) {
+            for ($k = strlen($this->_punycode_prefix); $k < $delim_pos; ++$k) {
+                $decoded[] = ord($encoded{$k});
+            }
+        } else {
+            $decoded = array();
+        }
+        $deco_len = count($decoded);
         $enco_len = strlen($encoded);
 
         // Wandering through the strings; init
-        $is_first = TRUE;
-        $bias     = $this->initial_bias;
+        $is_first = true;
+        $bias     = $this->_initial_bias;
         $idx      = 0;
-        $char     = $this->initial_n;
+        $char     = $this->_initial_n;
 
-        //while ($enco_idx < $enco_len) {
         for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) {
-            for ($old_idx = $idx, $w = 1, $k = $this->base; 1 ; $k += $this->base) {
+            for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) {
                 $digit = $this->_decode_digit($encoded{$enco_idx++});
                 $idx += $digit * $w;
-                $t = ($k <= $bias) ? $this->tmin :
-                        (($k >= $bias + $this->tmax) ? $this->tmax : ($k - $bias));
+                $t = ($k <= $bias) ? $this->_tmin :
+                        (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias));
                 if ($digit < $t) break;
-                $w = (int) ($w * ($this->base - $t));
+                $w = (int) ($w * ($this->_base - $t));
             }
             $bias = $this->_adapt($idx - $old_idx, $deco_len + 1, $is_first);
-            $is_first = FALSE;
-            $char += ($idx / ($deco_len + 1)) % 256;
+            $is_first = false;
+            $char += (int) ($idx / ($deco_len + 1));
             $idx %= ($deco_len + 1);
-            if ($deco_len) {
+            if ($deco_len > 0) {
+                // Make room for the decoded char
                 for ($i = $deco_len; $i > $idx; $i--) {
-                    $decoded{$i} = $decoded{($i - 1)};
+                    $decoded[$i] = $decoded[($i - 1)];
                 }
             }
-            $decoded{$idx++} = chr($char);
+            $decoded[$idx++] = $char;
         }
-        return $decoded;
+        return $this->_ucs4_to_utf8($decoded);
     }
 
-    // The actual encoding algorithm
+    /**
+    * The actual encoding algorithm
+    * @access   private
+    */
     function _encode($decoded)
     {
-        // No empty strings please
-        if (!$decoded) {
-            $this->_error('The given decoded string was empty');
-            return FALSE;
-        }
         // We cannot encode a domain name containing the Punycode prefix
-        if (preg_match('!^'.preg_quote($this->punycode_prefix, '!').'!', $decoded)) {
+        $extract = strlen($this->_punycode_prefix);
+        $check_pref = $this->_utf8_to_ucs4($this->_punycode_prefix);
+        $check_deco = array_slice($decoded, 0, $extract);
+
+        if ($check_pref == $check_deco) {
             $this->_error('This is already a punycode string');
-            return FALSE;
+            return false;
+        }
+        // We will not try to encode strings consisting of basic code points only
+        $encodable = false;
+        foreach ($decoded as $k => $v) {
+            if ($v > 0x7a) {
+                $encodable = true;
+                break;
+            }
         }
-        // We will not try to encode strings containing of basic code points only
-        if (!preg_match('![\x80-\xff]!', $decoded)) {
+        if (!$encodable) {
             $this->_error('The given string does not contain encodable chars');
-            return FALSE;
+            return false;
         }
 
-        $deco_len  = strlen($decoded);
+        // Do NAMEPREP
+        $decoded = $this->_nameprep($decoded);
+        if (!$decoded || !is_array($decoded)) return false; // NAMEPREP failed
+
+        $deco_len  = count($decoded);
+        if (!$deco_len) return false; // Empty array
+
         $codecount = 0; // How many chars have been consumed
 
-        // Start with the prefix; copy it to output
-        $encoded = $this->punycode_prefix;
+        $encoded = '';
         // Copy all basic code points to output
         for ($i = 0; $i < $deco_len; ++$i) {
-            if (preg_match('![0-9a-zA-Z-]!', $decoded{$i})) {
-                $encoded .= $decoded{$i};
+            $test = $decoded[$i];
+            // Will match [0-9a-zA-Z-]
+            if ((0x2F < $test && $test < 0x40)
+                    || (0x40 < $test && $test < 0x5B)
+                    || (0x60 < $test && $test <= 0x7B)
+                    || (0x2D == $test)) {
+                $encoded .= chr($decoded[$i]);
                 $codecount++;
             }
         }
+        if ($codecount == $deco_len) return $encoded; // All codepoints were basic ones
+
+        // Start with the prefix; copy it to output
+        $encoded = $this->_punycode_prefix.$encoded;
+
         // If we have basic code points in output, add an hyphen to the end
         if ($codecount) $encoded .= '-';
 
         // Now find and encode all non-basic code points
-        $is_first  = TRUE;
-        $cur_code  = $this->initial_n;
-        $bias      = $this->initial_bias;
+        $is_first  = true;
+        $cur_code  = $this->_initial_n;
+        $bias      = $this->_initial_bias;
         $delta     = 0;
         while ($codecount < $deco_len) {
             // Find the smallest code point >= the current code point and
             // remember the last ouccrence of it in the input
-            for ($i = 0, $next_code = $this->max_ucs; $i < $deco_len; $i++) {
-                if (ord($decoded{$i}) >= $cur_code && ord($decoded{$i}) <= $next_code) {
-                    $next_code = ord($decoded{$i});
+            for ($i = 0, $next_code = $this->_max_ucs; $i < $deco_len; $i++) {
+                if ($decoded[$i] >= $cur_code && $decoded[$i] <= $next_code) {
+                    $next_code = $decoded[$i];
                 }
             }
 
@@ -226,21 +490,21 @@
 
             // Scan input again and encode all characters whose code point is $cur_code
             for ($i = 0; $i < $deco_len; $i++) {
-                if (ord($decoded{$i}) < $cur_code) {
+                if ($decoded[$i] < $cur_code) {
                     $delta++;
-                } elseif (ord($decoded{$i}) == $cur_code) {
-                    for ($q = $delta, $k = $this->base; 1; $k += $this->base) {
-                        $t = ($k <= $bias) ? $this->tmin :
-                                (($k >= $bias + $this->tmax) ? $this->tmax : $k - $bias);
+                } elseif ($decoded[$i] == $cur_code) {
+                    for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) {
+                        $t = ($k <= $bias) ? $this->_tmin :
+                                (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias);
                         if ($q < $t) break;
-                        $encoded .= $this->_encode_digit(ceil($t + (($q - $t) % ($this->base - $t))));
-                        $q = ($q - $t) / ($this->base - $t);
+                        $encoded .= $this->_encode_digit(ceil($t + (($q - $t) % ($this->_base - $t))));
+                        $q = ($q - $t) / ($this->_base - $t);
                     }
                     $encoded .= $this->_encode_digit($q);
                     $bias = $this->_adapt($delta, $codecount+1, $is_first);
                     $codecount++;
                     $delta = 0;
-                    $is_first = FALSE;
+                    $is_first = false;
                 }
             }
             $delta++;
@@ -249,34 +513,478 @@
         return $encoded;
     }
 
-    // Adapt the bias according to the current code point and position
+    /**
+    * Adapt the bias according to the current code point and position
+    * @access   private
+    */
     function _adapt($delta, $npoints, $is_first)
     {
-        $delta = $is_first ? ($delta / $this->damp) : ($delta / 2);
-        $delta += $delta / $npoints;
-        for ($k = 0; $delta > (($this->base - $this->tmin) * $this->tmax) / 2; $k += $this->base) {
-            $delta = $delta / ($this->base - $this->tmin);
-        }
-        return $k + ($this->base - $this->tmin + 1) * $delta / ($delta + $this->skew);
+        $delta = (int) ($is_first ? ($delta / $this->_damp) : ($delta / 2));
+        $delta += (int) ($delta / $npoints);
+        for ($k = 0; $delta > (($this->_base - $this->_tmin) * $this->_tmax) / 2; $k += $this->_base) {
+            $delta = (int) ($delta / ($this->_base - $this->_tmin));
+        }
+        return (int) ($k + ($this->_base - $this->_tmin + 1) * $delta / ($delta + $this->_skew));
     }
 
-    //
+    /**
+    * Encoding a certain digit
+    * @access   private
+    */
     function _encode_digit($d)
     {
         return chr($d + 22 + 75 * ($d < 26));
     }
 
-    //
+    /**
+    * Decode a certain digit
+    * @access   private
+    */
     function _decode_digit($cp)
     {
         $cp = ord($cp);
-        return ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $this->base));
+        return ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $this->_base));
     }
 
-    // Internal error handling method
+    /**
+    * Internal error handling method
+    * @access   private
+    */
     function _error($error = '')
     {
-        $this->error = $error;
+        $this->_error = $error;
+    }
+
+    /**
+    * Do Nameprep according to RFC3491 and RFC3454
+    * @param    array    Unicode Characters
+    * @return   string   Unicode Characters, Nameprep'd
+    * @access   private
+    */
+    function _nameprep($input)
+    {
+        $output = array();
+        $error = false;
+        //
+        // Mapping
+        // Walking through the input array, performing the required steps on each of
+        // the input chars and putting the result into the output array
+        // While mapping required chars we apply the cannonical ordering
+
+        // $this->_show_hex($input);
+        foreach ($input as $v) {
+            // Map to nothing == skip that code point
+            if (in_array($v, $this->_np_['map_nothing'])) continue;
+
+            // Try to find prohibited input
+            if (in_array($v, $this->_np_['prohibit']) || in_array($v, $this->_np_['general_prohibited'])) {
+                $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v));
+                return false;
+            }
+            foreach ($this->_np_['prohibit_ranges'] as $range) {
+                if ($range[0] <= $v && $v <= $range[1]) {
+                    $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v));
+                    return false;
+                }
+            }
+            //
+            // Hangul syllable decomposition
+            if (0xAC00 <= $v && $v <= 0xD7AF) {
+                foreach ($this->_hangul_decompose($v) as $out) {
+                    $output[] = $out;
+                }
+            // There's a decomposition mapping for that code point
+            } elseif (isset($this->_np_['replacemaps'][$v])) {
+                foreach ($this->_apply_cannonical_ordering($this->_np_['replacemaps'][$v]) as $out) {
+                    $output[] = $out;
+                }
+            } else {
+                $output[] = $v;
+            }
+        }
+        //
+        // Combine code points
+        //
+        $last_class   = 0;
+        $last_starter = 0;
+        $out_len      = count($output);
+        for ($i = 0; $i < $out_len; ++$i) {
+            $class = $this->_get_combining_class($output[$i]);
+            if ((!$last_class || $last_class != $class) && $class) {
+                // Try to match
+                $seq_len = $i - $last_starter;
+                $out = $this->_combine(array_slice($output, $last_starter, $seq_len));
+                // On match: Replace the last starter with the composed character and remove
+                // the now redundant non-starter(s)
+                if ($out) {
+                    $output[$last_starter] = $out;
+                    if (count($out) != $seq_len) {
+                        for ($j = $i+1; $j < $out_len; ++$j) {
+                            $output[$j-1] = $output[$j];
+                        }
+                        unset($output[$out_len]);
+                    }
+                    // Rewind the for loop by one, since there can be more possible compositions
+                    $i--;
+                    $out_len--;
+                    $last_class = ($i == $last_starter) ? 0 : $this->_get_combining_class($output[$i-1]);
+                    continue;
+                }
+            }
+            if (!$class) { // The current class is 0
+                $last_starter = $i;
+            }
+            $last_class = $class;
+        }
+        return $output;
+    }
+
+    /**
+    * Decomposes a Hangul syllable
+    * (see http://www.unicode.org/unicode/reports/tr15/#Hangul
+    * @param    integer  32bit UCS4 code point
+    * @return   array    Either Hangul Syllable decomposed or original 32bit value as one value array
+    * @access   private
+    */
+    function _hangul_decompose($char)
+    {
+        $sindex = $char - $this->_sbase;
+        if ($sindex < 0 || $sindex >= $this->_scount) {
+            return array($char);
+        }
+        $result = array();
+        $T = $this->_tbase + $sindex % $this->_tcount;
+        $result[] = (int) ($this->_lbase + $sindex / $this->_ncount);
+        $result[] = (int) ($this->_vbase + ($sindex % $this->_ncount) / $this->_tcount);
+        if ($T != $this->_tbase) $result[] = $T;
+        return $result;
+    }
+
+    /**
+    * Ccomposes a Hangul syllable
+    * (see http://www.unicode.org/unicode/reports/tr15/#Hangul
+    * @param    array    Decomposed UCS4 sequence
+    * @return   array    UCS4 sequence with syllables composed
+    * @access   private
+    */
+    function _hangul_compose($input)
+    {
+        $inp_len = count($input);
+        if (!$inp_len) return array();
+        $result = array();
+        $last = $input[0];
+        $result[] = $last; // copy first char from input to output
+
+        for ($i = 1; $i < $inp_len; ++$i) {
+            $char = $input[$i];
+
+            // Find out, wether two current characters from L and V
+            $lindex = $last - $this->_lbase;
+            if (0 <= $lindex && $lindex < $this->_lcount) {
+                $vindex = $char - $this->_vbase;
+                if (0 <= $vindex && $vindex < $this->_vcount) {
+                    // create syllable of form LV
+                    $last = ($this->_sbase + ($lindex * $this->_vcount + $vindex) * $this->_tcount);
+                    $out_off = count($result) - 1;
+                    $result[$out_off] = $last; // reset last
+                    continue; // discard char
+                }
+            }
+
+            // Find out, wether two current characters are LV and T
+            $sindex = $last - $this->_sbase;
+            if (0 <= $sindex && $sindex < $this->_scount && ($sindex % $this->_tcount) == 0) {
+                $tindex = $char - $this->_tbase;
+                if (0 <= $tindex && $tindex <= $this->_tcount) {
+                    // create syllable of form LVT
+                    $last += $tindex;
+                    $out_off = count($result) - 1;
+                    $result[$out_off] = $last; // reset last
+                    continue; // discard char
+                }
+            }
+            // if neither case was true, just add the character
+            $last = $char;
+            $result[] = $char;
+        }
+        return $result;
+    }
+
+    /**
+    * Returns the combining class of a certain wide char
+    * @param    integer    Wide char to check (32bit integer)
+    * @return   integer    Combining class if found, else 0
+    * @access   private
+    */
+    function _get_combining_class($char)
+    {
+        return isset($this->_np_['norm_combcls'][$char]) ? $this->_np_['norm_combcls'][$char] : 0;
+    }
+
+    /**
+    * Apllies the cannonical ordering of a decomposed UCS4 sequence
+    * @param    array      Decomposed UCS4 sequence
+    * @return   array      Ordered USC4 sequence
+    * @access   private
+    */
+    function _apply_cannonical_ordering($input)
+    {
+        $swap = true;
+        $size = count($input);
+        while ($swap) {
+            $swap = false;
+            $last = $this->_get_combining_class($input[0]);
+            for ($i = 0; $i < $size - 1; ++$i) {
+                $next = $this->_get_combining_class($input[$i+1]);
+                if ($next != 0 && $last > $next) {
+                    // Move item leftward until it fits
+                    for ($j = $i + 1; $j > 0; --$j) {
+                        if ($this->_get_combining_class($input[$j - 1]) <= $next) break;
+                        $t = $input[$j];
+                        $input[$j] = $input[$j - 1];
+                        $input[$j - 1] = $t;
+                        $swap = 1;
+                    }
+                    // Reentering the loop looking at the old character again
+                    $next = $last;
+                }
+                $last = $next;
+            }
+        }
+        return $input;
+    }
+
+    /**
+    * Do composition of a sequence of starter and non-starter
+    * @param    array      UCS4 Decomposed sequence
+    * @return   array      Ordered USC4 sequence
+    * @access   private
+    */
+    function _combine($input)
+    {
+        $inp_len = count($input);
+        // Is it a Hangul syllable?
+        if (1 != $inp_len) {
+            $hangul = $this->_hangul_compose($input);
+            if (count($hangul) != $inp_len) return $hangul; // This place is probably wrong
+        }
+        foreach ($this->_np_['replacemaps'] as $np_src => $np_target) {
+            if ($np_target[0] != $input[0]) continue;
+            if (count($np_target) != $inp_len) continue;
+            $hit = false;
+            foreach ($input as $k2 => $v2) {
+                if ($v2 == $np_target[$k2]) {
+                    $hit = true;
+                } else {
+                    $hit = false;
+                    break;
+                }
+            }
+            if ($hit) return $np_src;
+        }
+        return false;
+    }
+
+    /**
+    * This converts an UTF-8 encoded string to its UCS-4 representation
+    * By talking about UCS-4 "strings" we mean arrays of 32bit integers representing
+    * each of the "chars". This is due to PHP not being able to handle strings with
+    * bit depth different from 8. This apllies to the reverse method _ucs4_to_utf8(), too.
+    * The following UTF-8 encodings are supported:
+    * bytes bits  representation
+    * 1        7  0xxxxxxx
+    * 2       11  110xxxxx 10xxxxxx
+    * 3       16  1110xxxx 10xxxxxx 10xxxxxx
+    * 4       21  11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+    * 5       26  111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+    * 6       31  1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+    * Each x represents a bit that can be used to store character data.
+    * The five and six byte sequences are part of Annex D of ISO/IEC 10646-1:2000
+    * @access   private
+    */
+    function _utf8_to_ucs4($input)
+    {
+        $output = array();
+        $out_len = 0;
+        $inp_len = strlen($input);
+        $mode = 'next';
+        $test = 'none';
+        for ($k = 0; $k < $inp_len; ++$k) {
+            $v = ord($input{$k}); // Extract byte from input string
+
+            if ($v < 128) { // We found an ASCII char - put into stirng as is
+                $output[$out_len] = $v;
+                ++$out_len;
+                if ('add' == $mode) {
+                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k);
+                    return false;
+                }
+                continue;
+            }
+            if ('next' == $mode) { // Try to find the next start byte; determine the width of the Unicode char
+                $start_byte = $v;
+                $mode = 'add';
+                $test = 'range';
+                if ($v >> 5 == 6) { // &110xxxxx 10xxxxx
+                    $next_byte = 0; // Tells, how many times subsequent bitmasks must rotate 6bits to the left
+                    $v = ($v - 192) << 6;
+                } elseif ($v >> 4 == 14) { // &1110xxxx 10xxxxxx 10xxxxxx
+                    $next_byte = 1;
+                    $v = ($v - 224) << 12;
+                } elseif ($v >> 3 == 30) { // &11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+                    $next_byte = 2;
+                    $v = ($v - 240) << 18;
+                } elseif ($v >> 2 == 62) { // &111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+                    $next_byte = 3;
+                    $v = ($v - 248) << 24;
+                } elseif ($v >> 1 == 126) { // &1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+                    $next_byte = 4;
+                    $v = ($v - 252) << 30;
+                } else {
+                    $this->_error('This might be UTF-8, but I don\'t understand it at byte '.$k);
+                    return false;
+                }
+                if ('add' == $mode) {
+                    $output[$out_len] = (int) $v;
+                    ++$out_len;
+                    continue;
+                }
+            }
+            if ('add' == $mode) {
+                if (!$this->_allow_overlong && $test == 'range') {
+                    $test = 'none';
+                    if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) {
+                        $this->_error('Bogus UTF-8 character detected (out of legal range) at byte '.$k);
+                        return false;
+                    }
+                }
+                if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx
+                    $v = ($v - 128) << ($next_byte * 6);
+                    $output[($out_len - 1)] += $v;
+                    --$next_byte;
+                } else {
+                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k);
+                    return false;
+                }
+                if ($next_byte < 0) {
+                    $mode = 'next';
+                }
+            }
+        } // for
+        return $output;
+    }
+
+    /**
+    * Convert UCS-4 string into UTF-8 string
+    * See _utf8_to_ucs4() for details
+    * @access   private
+    */
+    function _ucs4_to_utf8($input)
+    {
+        $output = '';
+        foreach ($input as $v) {
+            // $v = ord($v);
+            if ($v < 128) { // 7bit are transferred literally
+                $output .= chr($v);
+            } elseif ($v < (1 << 11)) { // 2 bytes
+                $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63));
+            } elseif ($v < (1 << 16)) { // 3 bytes
+                $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
+            } elseif ($v < (1 << 21)) { // 4 bytes
+                $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63))
+                         . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
+            } elseif ($v < (1 << 26)) { // 5 bytes
+                $output .= chr(248 + ($v >> 24)) . chr(128 + (($v >> 18) & 63))
+                         . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63))
+                         . chr(128 + ($v & 63));
+            } elseif ($v < (1 << 31)) { // 6 bytes
+                $output .= chr(252 + ($v >> 30)) . chr(128 + (($v >> 24) & 63))
+                         . chr(128 + (($v >> 18) & 63)) . chr(128 + (($v >> 12) & 63))
+                         . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
+            } else {
+                $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k);
+                return false;
+            }
+        }
+        return $output;
+    }
+
+    /**
+     * Convert UCS-4 array into UCS-4 string
+     *
+     * @access   private
+     */
+    function _ucs4_to_ucs4_string($input)
+    {
+        $output = '';
+        // Take array values and split output to 4 bytes per value
+        // The bit mask is 255, which reads &11111111
+        foreach ($input as $v) {
+            $output .= chr(($v >> 24) & 255)
+                     . chr(($v >> 16) & 255)
+                     . chr(($v >> 8) & 255)
+                     . chr($v & 255);
+        }
+        return $output;
+    }
+
+    /**
+     * Convert UCS-4 strin into UCS-4 garray
+     *
+     * @access   private
+     */
+    function _ucs4_string_to_ucs4($input)
+    {
+        $output = array();
+
+        $inp_len = strlen($input);
+        // Input length must be dividable by 4
+        if ($inp_len % 4) {
+            $this->_error('Input UCS4 string is broken');
+            return false;
+        }
+
+        // Empty input - return empty output
+        if (!$inp_len) return $output;
+
+        for ($i = 0, $out_len = -1; $i < $inp_len; ++$i) {
+            // Increment output position every 4 input bytes
+            if (!($i % 4)) {
+                $out_len++;
+                $output[$out_len] = 0;
+            }
+            $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) );
+        }
+        return $output;
+    }
+}
+
+/**
+* Adapter class for aligning the API of idna_convert with that of
+* Net_IDNA
+* @author  Matthias Sommerfeld <mso@phlylabs.de>
+*/
+class Net_IDNA_php4 extends idna_convert
+{
+    /**
+    * Sets a new option value. Available options and values:
+    * [encoding - Use either UTF-8, UCS4 as array or UCS4 as string as input ('utf8' for UTF-8,
+    *         'ucs4_string' and 'ucs4_array' respectively for UCS4); The output is always UTF-8]
+    * [overlong - Unicode does not allow unnecessarily long encodings of chars,
+    *             to allow this, set this parameter to true, else to false;
+    *             default is false.]
+    * [strict - true: strict mode, good for registration purposes - Causes errors
+    *           on failures; false: loose mode, ideal for "wildlife" applications
+    *           by silently ignoring errors and returning the original input instead
+    *
+    * @param    mixed     Parameter to set (string: single parameter; array of Parameter => Value pairs)
+    * @param    string    Value to use (if parameter 1 is a string)
+    * @return   boolean   true on success, false otherwise
+    * @access   public
+    */
+    function setParams($option, $param = false)
+    {
+        return $this->IC->set_parameters($option, $param);
     }
 }
 
diff -ruN 0.761/includes/classes/idna/npdata.ser 0.762/includes/classes/idna/npdata.ser
--- 0.761/includes/classes/idna/npdata.ser	1969-12-31 18:00:00.000000000 -0600
+++ 0.762/includes/classes/idna/npdata.ser	2005-10-18 14:52:06.000000000 -0500
@@ -0,0 +1 @@
+a:6:{s:11:"map_nothing";a:27:{i:0;i:173;i:1;i:847;i:2;i:6150;i:3;i:6155;i:4;i:6156;i:5;i:6157;i:6;i:8203;i:7;i:8204;i:8;i:8205;i:9;i:8288;i:10;i:65024;i:11;i:65025;i:12;i:65026;i:13;i:65027;i:14;i:65028;i:15;i:65029;i:16;i:65030;i:17;i:65031;i:18;i:65032;i:19;i:65033;i:20;i:65034;i:21;i:65035;i:22;i:65036;i:23;i:65037;i:24;i:65038;i:25;i:65039;i:26;i:65279;}s:18:"general_prohibited";a:64:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:5;i:6;i:6;i:7;i:7;i:8;i:8;i:9;i:9;i:10;i:10;i:11;i:11;i:12;i:12;i:13;i:13;i:14;i:14;i:15;i:15;i:16;i:16;i:17;i:17;i:18;i:18;i:19;i:19;i:20;i:20;i:21;i:21;i:22;i:22;i:23;i:23;i:24;i:24;i:25;i:25;i:26;i:26;i:27;i:27;i:28;i:28;i:29;i:29;i:30;i:30;i:31;i:31;i:32;i:32;i:33;i:33;i:34;i:34;i:35;i:35;i:36;i:36;i:37;i:37;i:38;i:38;i:39;i:39;i:40;i:40;i:41;i:41;i:42;i:42;i:43;i:43;i:44;i:44;i:45;i:47;i:46;i:59;i:47;i:60;i:48;i:61;i:49;i:62;i:50;i:63;i:51;i:64;i:52;i:91;i:53;i:92;i:54;i:93;i:55;i:94;i:56;i:95;i:57;i:96;i:58;i:123;i:59;i:124;i:60;i:125;i:61;i:126;i:62;i:127;i:63;i:12290;}s:8:"prohibit";a:84:{i:0;i:160;i:1;i:5760;i:2;i:8192;i:3;i:8193;i:4;i:8194;i:5;i:8195;i:6;i:8196;i:7;i:8197;i:8;i:8198;i:9;i:8199;i:10;i:8200;i:11;i:8201;i:12;i:8202;i:13;i:8203;i:14;i:8239;i:15;i:8287;i:16;i:12288;i:17;i:1757;i:18;i:1807;i:19;i:6158;i:20;i:8204;i:21;i:8205;i:22;i:8232;i:23;i:8233;i:24;i:65279;i:25;i:65529;i:26;i:65530;i:27;i:65531;i:28;i:65532;i:29;i:65534;i:30;i:65535;i:31;i:131070;i:32;i:131071;i:33;i:196606;i:34;i:196607;i:35;i:262142;i:36;i:262143;i:37;i:327678;i:38;i:327679;i:39;i:393214;i:40;i:393215;i:41;i:458750;i:42;i:458751;i:43;i:524286;i:44;i:524287;i:45;i:589822;i:46;i:589823;i:47;i:655358;i:48;i:655359;i:49;i:720894;i:50;i:720895;i:51;i:786430;i:52;i:786431;i:53;i:851966;i:54;i:851967;i:55;i:917502;i:56;i:917503;i:57;i:983038;i:58;i:983039;i:59;i:1048574;i:60;i:1048575;i:61;i:1114110;i:62;i:1114111;i:63;i:65529;i:64;i:65530;i:65;i:65531;i:66;i:65532;i:67;i:65533;i:68;i:832;i:69;i:833;i:70;i:8206;i:71;i:8207;i:72;i:8234;i:73;i:8235;i:74;i:8236;i:75;i:8237;i:76;i:8238;i:77;i:8298;i:78;i:8299;i:79;i:8300;i:80;i:8301;i:81;i:8302;i:82;i:8303;i:83;i:917505;}s:15:"prohibit_ranges";a:10:{i:0;a:2:{i:0;i:128;i:1;i:159;}i:1;a:2:{i:0;i:8288;i:1;i:8303;}i:2;a:2:{i:0;i:119155;i:1;i:119162;}i:3;a:2:{i:0;i:57344;i:1;i:63743;}i:4;a:2:{i:0;i:983040;i:1;i:1048573;}i:5;a:2:{i:0;i:1048576;i:1;i:1114109;}i:6;a:2:{i:0;i:64976;i:1;i:65007;}i:7;a:2:{i:0;i:55296;i:1;i:57343;}i:8;a:2:{i:0;i:12272;i:1;i:12283;}i:9;a:2:{i:0;i:917536;i:1;i:917631;}}s:11:"replacemaps";a:1401:{i:65;a:1:{i:0;i:97;}i:66;a:1:{i:0;i:98;}i:67;a:1:{i:0;i:99;}i:68;a:1:{i:0;i:100;}i:69;a:1:{i:0;i:101;}i:70;a:1:{i:0;i:102;}i:71;a:1:{i:0;i:103;}i:72;a:1:{i:0;i:104;}i:73;a:1:{i:0;i:105;}i:74;a:1:{i:0;i:106;}i:75;a:1:{i:0;i:107;}i:76;a:1:{i:0;i:108;}i:77;a:1:{i:0;i:109;}i:78;a:1:{i:0;i:110;}i:79;a:1:{i:0;i:111;}i:80;a:1:{i:0;i:112;}i:81;a:1:{i:0;i:113;}i:82;a:1:{i:0;i:114;}i:83;a:1:{i:0;i:115;}i:84;a:1:{i:0;i:116;}i:85;a:1:{i:0;i:117;}i:86;a:1:{i:0;i:118;}i:87;a:1:{i:0;i:119;}i:88;a:1:{i:0;i:120;}i:89;a:1:{i:0;i:121;}i:90;a:1:{i:0;i:122;}i:181;a:1:{i:0;i:956;}i:192;a:1:{i:0;i:224;}i:193;a:1:{i:0;i:225;}i:194;a:1:{i:0;i:226;}i:195;a:1:{i:0;i:227;}i:196;a:1:{i:0;i:228;}i:197;a:1:{i:0;i:229;}i:198;a:1:{i:0;i:230;}i:199;a:1:{i:0;i:231;}i:200;a:1:{i:0;i:232;}i:201;a:1:{i:0;i:233;}i:202;a:1:{i:0;i:234;}i:203;a:1:{i:0;i:235;}i:204;a:1:{i:0;i:236;}i:205;a:1:{i:0;i:237;}i:206;a:1:{i:0;i:238;}i:207;a:1:{i:0;i:239;}i:208;a:1:{i:0;i:240;}i:209;a:1:{i:0;i:241;}i:210;a:1:{i:0;i:242;}i:211;a:1:{i:0;i:243;}i:212;a:1:{i:0;i:244;}i:213;a:1:{i:0;i:245;}i:214;a:1:{i:0;i:246;}i:216;a:1:{i:0;i:248;}i:217;a:1:{i:0;i:249;}i:218;a:1:{i:0;i:250;}i:219;a:1:{i:0;i:251;}i:220;a:1:{i:0;i:252;}i:221;a:1:{i:0;i:253;}i:222;a:1:{i:0;i:254;}i:223;a:2:{i:0;i:115;i:1;i:115;}i:256;a:1:{i:0;i:257;}i:258;a:1:{i:0;i:259;}i:260;a:1:{i:0;i:261;}i:262;a:1:{i:0;i:263;}i:264;a:1:{i:0;i:265;}i:266;a:1:{i:0;i:267;}i:268;a:1:{i:0;i:269;}i:270;a:1:{i:0;i:271;}i:272;a:1:{i:0;i:273;}i:274;a:1:{i:0;i:275;}i:276;a:1:{i:0;i:277;}i:278;a:1:{i:0;i:279;}i:280;a:1:{i:0;i:281;}i:282;a:1:{i:0;i:283;}i:284;a:1:{i:0;i:285;}i:286;a:1:{i:0;i:287;}i:288;a:1:{i:0;i:289;}i:290;a:1:{i:0;i:291;}i:292;a:1:{i:0;i:293;}i:294;a:1:{i:0;i:295;}i:296;a:1:{i:0;i:297;}i:298;a:1:{i:0;i:299;}i:300;a:1:{i:0;i:301;}i:302;a:1:{i:0;i:303;}i:304;a:2:{i:0;i:105;i:1;i:775;}i:306;a:1:{i:0;i:307;}i:308;a:1:{i:0;i:309;}i:310;a:1:{i:0;i:311;}i:313;a:1:{i:0;i:314;}i:315;a:1:{i:0;i:316;}i:317;a:1:{i:0;i:318;}i:319;a:1:{i:0;i:320;}i:321;a:1:{i:0;i:322;}i:323;a:1:{i:0;i:324;}i:325;a:1:{i:0;i:326;}i:327;a:1:{i:0;i:328;}i:329;a:2:{i:0;i:700;i:1;i:110;}i:330;a:1:{i:0;i:331;}i:332;a:1:{i:0;i:333;}i:334;a:1:{i:0;i:335;}i:336;a:1:{i:0;i:337;}i:338;a:1:{i:0;i:339;}i:340;a:1:{i:0;i:341;}i:342;a:1:{i:0;i:343;}i:344;a:1:{i:0;i:345;}i:346;a:1:{i:0;i:347;}i:348;a:1:{i:0;i:349;}i:350;a:1:{i:0;i:351;}i:352;a:1:{i:0;i:353;}i:354;a:1:{i:0;i:355;}i:356;a:1:{i:0;i:357;}i:358;a:1:{i:0;i:359;}i:360;a:1:{i:0;i:361;}i:362;a:1:{i:0;i:363;}i:364;a:1:{i:0;i:365;}i:366;a:1:{i:0;i:367;}i:368;a:1:{i:0;i:369;}i:370;a:1:{i:0;i:371;}i:372;a:1:{i:0;i:373;}i:374;a:1:{i:0;i:375;}i:376;a:1:{i:0;i:255;}i:377;a:1:{i:0;i:378;}i:379;a:1:{i:0;i:380;}i:381;a:1:{i:0;i:382;}i:383;a:1:{i:0;i:115;}i:385;a:1:{i:0;i:595;}i:386;a:1:{i:0;i:387;}i:388;a:1:{i:0;i:389;}i:390;a:1:{i:0;i:596;}i:391;a:1:{i:0;i:392;}i:393;a:1:{i:0;i:598;}i:394;a:1:{i:0;i:599;}i:395;a:1:{i:0;i:396;}i:398;a:1:{i:0;i:477;}i:399;a:1:{i:0;i:601;}i:400;a:1:{i:0;i:603;}i:401;a:1:{i:0;i:402;}i:403;a:1:{i:0;i:608;}i:404;a:1:{i:0;i:611;}i:406;a:1:{i:0;i:617;}i:407;a:1:{i:0;i:616;}i:408;a:1:{i:0;i:409;}i:412;a:1:{i:0;i:623;}i:413;a:1:{i:0;i:626;}i:415;a:1:{i:0;i:629;}i:416;a:1:{i:0;i:417;}i:418;a:1:{i:0;i:419;}i:420;a:1:{i:0;i:421;}i:422;a:1:{i:0;i:640;}i:423;a:1:{i:0;i:424;}i:425;a:1:{i:0;i:643;}i:428;a:1:{i:0;i:429;}i:430;a:1:{i:0;i:648;}i:431;a:1:{i:0;i:432;}i:433;a:1:{i:0;i:650;}i:434;a:1:{i:0;i:651;}i:435;a:1:{i:0;i:436;}i:437;a:1:{i:0;i:438;}i:439;a:1:{i:0;i:658;}i:440;a:1:{i:0;i:441;}i:444;a:1:{i:0;i:445;}i:452;a:1:{i:0;i:454;}i:453;a:1:{i:0;i:454;}i:455;a:1:{i:0;i:457;}i:456;a:1:{i:0;i:457;}i:458;a:1:{i:0;i:460;}i:459;a:1:{i:0;i:460;}i:461;a:1:{i:0;i:462;}i:463;a:1:{i:0;i:464;}i:465;a:1:{i:0;i:466;}i:467;a:1:{i:0;i:468;}i:469;a:1:{i:0;i:470;}i:471;a:1:{i:0;i:472;}i:473;a:1:{i:0;i:474;}i:475;a:1:{i:0;i:476;}i:478;a:1:{i:0;i:479;}i:480;a:1:{i:0;i:481;}i:482;a:1:{i:0;i:483;}i:484;a:1:{i:0;i:485;}i:486;a:1:{i:0;i:487;}i:488;a:1:{i:0;i:489;}i:490;a:1:{i:0;i:491;}i:492;a:1:{i:0;i:493;}i:494;a:1:{i:0;i:495;}i:496;a:2:{i:0;i:106;i:1;i:780;}i:497;a:1:{i:0;i:499;}i:498;a:1:{i:0;i:499;}i:500;a:1:{i:0;i:501;}i:502;a:1:{i:0;i:405;}i:503;a:1:{i:0;i:447;}i:504;a:1:{i:0;i:505;}i:506;a:1:{i:0;i:507;}i:508;a:1:{i:0;i:509;}i:510;a:1:{i:0;i:511;}i:512;a:1:{i:0;i:513;}i:514;a:1:{i:0;i:515;}i:516;a:1:{i:0;i:517;}i:518;a:1:{i:0;i:519;}i:520;a:1:{i:0;i:521;}i:522;a:1:{i:0;i:523;}i:524;a:1:{i:0;i:525;}i:526;a:1:{i:0;i:527;}i:528;a:1:{i:0;i:529;}i:530;a:1:{i:0;i:531;}i:532;a:1:{i:0;i:533;}i:534;a:1:{i:0;i:535;}i:536;a:1:{i:0;i:537;}i:538;a:1:{i:0;i:539;}i:540;a:1:{i:0;i:541;}i:542;a:1:{i:0;i:543;}i:544;a:1:{i:0;i:414;}i:546;a:1:{i:0;i:547;}i:548;a:1:{i:0;i:549;}i:550;a:1:{i:0;i:551;}i:552;a:1:{i:0;i:553;}i:554;a:1:{i:0;i:555;}i:556;a:1:{i:0;i:557;}i:558;a:1:{i:0;i:559;}i:560;a:1:{i:0;i:561;}i:562;a:1:{i:0;i:563;}i:837;a:1:{i:0;i:953;}i:890;a:2:{i:0;i:32;i:1;i:953;}i:902;a:1:{i:0;i:940;}i:904;a:1:{i:0;i:941;}i:905;a:1:{i:0;i:942;}i:906;a:1:{i:0;i:943;}i:908;a:1:{i:0;i:972;}i:910;a:1:{i:0;i:973;}i:911;a:1:{i:0;i:974;}i:912;a:3:{i:0;i:953;i:1;i:776;i:2;i:769;}i:913;a:1:{i:0;i:945;}i:914;a:1:{i:0;i:946;}i:915;a:1:{i:0;i:947;}i:916;a:1:{i:0;i:948;}i:917;a:1:{i:0;i:949;}i:918;a:1:{i:0;i:950;}i:919;a:1:{i:0;i:951;}i:920;a:1:{i:0;i:952;}i:921;a:1:{i:0;i:953;}i:922;a:1:{i:0;i:954;}i:923;a:1:{i:0;i:955;}i:924;a:1:{i:0;i:956;}i:925;a:1:{i:0;i:957;}i:926;a:1:{i:0;i:958;}i:927;a:1:{i:0;i:959;}i:928;a:1:{i:0;i:960;}i:929;a:1:{i:0;i:961;}i:931;a:1:{i:0;i:963;}i:932;a:1:{i:0;i:964;}i:933;a:1:{i:0;i:965;}i:934;a:1:{i:0;i:966;}i:935;a:1:{i:0;i:967;}i:936;a:1:{i:0;i:968;}i:937;a:1:{i:0;i:969;}i:938;a:1:{i:0;i:970;}i:939;a:1:{i:0;i:971;}i:944;a:3:{i:0;i:965;i:1;i:776;i:2;i:769;}i:962;a:1:{i:0;i:963;}i:976;a:1:{i:0;i:946;}i:977;a:1:{i:0;i:952;}i:978;a:1:{i:0;i:965;}i:979;a:1:{i:0;i:973;}i:980;a:1:{i:0;i:971;}i:981;a:1:{i:0;i:966;}i:982;a:1:{i:0;i:960;}i:984;a:1:{i:0;i:985;}i:986;a:1:{i:0;i:987;}i:988;a:1:{i:0;i:989;}i:990;a:1:{i:0;i:991;}i:992;a:1:{i:0;i:993;}i:994;a:1:{i:0;i:995;}i:996;a:1:{i:0;i:997;}i:998;a:1:{i:0;i:999;}i:1000;a:1:{i:0;i:1001;}i:1002;a:1:{i:0;i:1003;}i:1004;a:1:{i:0;i:1005;}i:1006;a:1:{i:0;i:1007;}i:1008;a:1:{i:0;i:954;}i:1009;a:1:{i:0;i:961;}i:1010;a:1:{i:0;i:963;}i:1012;a:1:{i:0;i:952;}i:1013;a:1:{i:0;i:949;}i:1024;a:1:{i:0;i:1104;}i:1025;a:1:{i:0;i:1105;}i:1026;a:1:{i:0;i:1106;}i:1027;a:1:{i:0;i:1107;}i:1028;a:1:{i:0;i:1108;}i:1029;a:1:{i:0;i:1109;}i:1030;a:1:{i:0;i:1110;}i:1031;a:1:{i:0;i:1111;}i:1032;a:1:{i:0;i:1112;}i:1033;a:1:{i:0;i:1113;}i:1034;a:1:{i:0;i:1114;}i:1035;a:1:{i:0;i:1115;}i:1036;a:1:{i:0;i:1116;}i:1037;a:1:{i:0;i:1117;}i:1038;a:1:{i:0;i:1118;}i:1039;a:1:{i:0;i:1119;}i:1040;a:1:{i:0;i:1072;}i:1041;a:1:{i:0;i:1073;}i:1042;a:1:{i:0;i:1074;}i:1043;a:1:{i:0;i:1075;}i:1044;a:1:{i:0;i:1076;}i:1045;a:1:{i:0;i:1077;}i:1046;a:1:{i:0;i:1078;}i:1047;a:1:{i:0;i:1079;}i:1048;a:1:{i:0;i:1080;}i:1049;a:1:{i:0;i:1081;}i:1050;a:1:{i:0;i:1082;}i:1051;a:1:{i:0;i:1083;}i:1052;a:1:{i:0;i:1084;}i:1053;a:1:{i:0;i:1085;}i:1054;a:1:{i:0;i:1086;}i:1055;a:1:{i:0;i:1087;}i:1056;a:1:{i:0;i:1088;}i:1057;a:1:{i:0;i:1089;}i:1058;a:1:{i:0;i:1090;}i:1059;a:1:{i:0;i:1091;}i:1060;a:1:{i:0;i:1092;}i:1061;a:1:{i:0;i:1093;}i:1062;a:1:{i:0;i:1094;}i:1063;a:1:{i:0;i:1095;}i:1064;a:1:{i:0;i:1096;}i:1065;a:1:{i:0;i:1097;}i:1066;a:1:{i:0;i:1098;}i:1067;a:1:{i:0;i:1099;}i:1068;a:1:{i:0;i:1100;}i:1069;a:1:{i:0;i:1101;}i:1070;a:1:{i:0;i:1102;}i:1071;a:1:{i:0;i:1103;}i:1120;a:1:{i:0;i:1121;}i:1122;a:1:{i:0;i:1123;}i:1124;a:1:{i:0;i:1125;}i:1126;a:1:{i:0;i:1127;}i:1128;a:1:{i:0;i:1129;}i:1130;a:1:{i:0;i:1131;}i:1132;a:1:{i:0;i:1133;}i:1134;a:1:{i:0;i:1135;}i:1136;a:1:{i:0;i:1137;}i:1138;a:1:{i:0;i:1139;}i:1140;a:1:{i:0;i:1141;}i:1142;a:1:{i:0;i:1143;}i:1144;a:1:{i:0;i:1145;}i:1146;a:1:{i:0;i:1147;}i:1148;a:1:{i:0;i:1149;}i:1150;a:1:{i:0;i:1151;}i:1152;a:1:{i:0;i:1153;}i:1162;a:1:{i:0;i:1163;}i:1164;a:1:{i:0;i:1165;}i:1166;a:1:{i:0;i:1167;}i:1168;a:1:{i:0;i:1169;}i:1170;a:1:{i:0;i:1171;}i:1172;a:1:{i:0;i:1173;}i:1174;a:1:{i:0;i:1175;}i:1176;a:1:{i:0;i:1177;}i:1178;a:1:{i:0;i:1179;}i:1180;a:1:{i:0;i:1181;}i:1182;a:1:{i:0;i:1183;}i:1184;a:1:{i:0;i:1185;}i:1186;a:1:{i:0;i:1187;}i:1188;a:1:{i:0;i:1189;}i:1190;a:1:{i:0;i:1191;}i:1192;a:1:{i:0;i:1193;}i:1194;a:1:{i:0;i:1195;}i:1196;a:1:{i:0;i:1197;}i:1198;a:1:{i:0;i:1199;}i:1200;a:1:{i:0;i:1201;}i:1202;a:1:{i:0;i:1203;}i:1204;a:1:{i:0;i:1205;}i:1206;a:1:{i:0;i:1207;}i:1208;a:1:{i:0;i:1209;}i:1210;a:1:{i:0;i:1211;}i:1212;a:1:{i:0;i:1213;}i:1214;a:1:{i:0;i:1215;}i:1217;a:1:{i:0;i:1218;}i:1219;a:1:{i:0;i:1220;}i:1221;a:1:{i:0;i:1222;}i:1223;a:1:{i:0;i:1224;}i:1225;a:1:{i:0;i:1226;}i:1227;a:1:{i:0;i:1228;}i:1229;a:1:{i:0;i:1230;}i:1232;a:1:{i:0;i:1233;}i:1234;a:1:{i:0;i:1235;}i:1236;a:1:{i:0;i:1237;}i:1238;a:1:{i:0;i:1239;}i:1240;a:1:{i:0;i:1241;}i:1242;a:1:{i:0;i:1243;}i:1244;a:1:{i:0;i:1245;}i:1246;a:1:{i:0;i:1247;}i:1248;a:1:{i:0;i:1249;}i:1250;a:1:{i:0;i:1251;}i:1252;a:1:{i:0;i:1253;}i:1254;a:1:{i:0;i:1255;}i:1256;a:1:{i:0;i:1257;}i:1258;a:1:{i:0;i:1259;}i:1260;a:1:{i:0;i:1261;}i:1262;a:1:{i:0;i:1263;}i:1264;a:1:{i:0;i:1265;}i:1266;a:1:{i:0;i:1267;}i:1268;a:1:{i:0;i:1269;}i:1272;a:1:{i:0;i:1273;}i:1280;a:1:{i:0;i:1281;}i:1282;a:1:{i:0;i:1283;}i:1284;a:1:{i:0;i:1285;}i:1286;a:1:{i:0;i:1287;}i:1288;a:1:{i:0;i:1289;}i:1290;a:1:{i:0;i:1291;}i:1292;a:1:{i:0;i:1293;}i:1294;a:1:{i:0;i:1295;}i:1329;a:1:{i:0;i:1377;}i:1330;a:1:{i:0;i:1378;}i:1331;a:1:{i:0;i:1379;}i:1332;a:1:{i:0;i:1380;}i:1333;a:1:{i:0;i:1381;}i:1334;a:1:{i:0;i:1382;}i:1335;a:1:{i:0;i:1383;}i:1336;a:1:{i:0;i:1384;}i:1337;a:1:{i:0;i:1385;}i:1338;a:1:{i:0;i:1386;}i:1339;a:1:{i:0;i:1387;}i:1340;a:1:{i:0;i:1388;}i:1341;a:1:{i:0;i:1389;}i:1342;a:1:{i:0;i:1390;}i:1343;a:1:{i:0;i:1391;}i:1344;a:1:{i:0;i:1392;}i:1345;a:1:{i:0;i:1393;}i:1346;a:1:{i:0;i:1394;}i:1347;a:1:{i:0;i:1395;}i:1348;a:1:{i:0;i:1396;}i:1349;a:1:{i:0;i:1397;}i:1350;a:1:{i:0;i:1398;}i:1351;a:1:{i:0;i:1399;}i:1352;a:1:{i:0;i:1400;}i:1353;a:1:{i:0;i:1401;}i:1354;a:1:{i:0;i:1402;}i:1355;a:1:{i:0;i:1403;}i:1356;a:1:{i:0;i:1404;}i:1357;a:1:{i:0;i:1405;}i:1358;a:1:{i:0;i:1406;}i:1359;a:1:{i:0;i:1407;}i:1360;a:1:{i:0;i:1408;}i:1361;a:1:{i:0;i:1409;}i:1362;a:1:{i:0;i:1410;}i:1363;a:1:{i:0;i:1411;}i:1364;a:1:{i:0;i:1412;}i:1365;a:1:{i:0;i:1413;}i:1366;a:1:{i:0;i:1414;}i:1415;a:2:{i:0;i:1381;i:1;i:1410;}i:7680;a:1:{i:0;i:7681;}i:7682;a:1:{i:0;i:7683;}i:7684;a:1:{i:0;i:7685;}i:7686;a:1:{i:0;i:7687;}i:7688;a:1:{i:0;i:7689;}i:7690;a:1:{i:0;i:7691;}i:7692;a:1:{i:0;i:7693;}i:7694;a:1:{i:0;i:7695;}i:7696;a:1:{i:0;i:7697;}i:7698;a:1:{i:0;i:7699;}i:7700;a:1:{i:0;i:7701;}i:7702;a:1:{i:0;i:7703;}i:7704;a:1:{i:0;i:7705;}i:7706;a:1:{i:0;i:7707;}i:7708;a:1:{i:0;i:7709;}i:7710;a:1:{i:0;i:7711;}i:7712;a:1:{i:0;i:7713;}i:7714;a:1:{i:0;i:7715;}i:7716;a:1:{i:0;i:7717;}i:7718;a:1:{i:0;i:7719;}i:7720;a:1:{i:0;i:7721;}i:7722;a:1:{i:0;i:7723;}i:7724;a:1:{i:0;i:7725;}i:7726;a:1:{i:0;i:7727;}i:7728;a:1:{i:0;i:7729;}i:7730;a:1:{i:0;i:7731;}i:7732;a:1:{i:0;i:7733;}i:7734;a:1:{i:0;i:7735;}i:7736;a:1:{i:0;i:7737;}i:7738;a:1:{i:0;i:7739;}i:7740;a:1:{i:0;i:7741;}i:7742;a:1:{i:0;i:7743;}i:7744;a:1:{i:0;i:7745;}i:7746;a:1:{i:0;i:7747;}i:7748;a:1:{i:0;i:7749;}i:7750;a:1:{i:0;i:7751;}i:7752;a:1:{i:0;i:7753;}i:7754;a:1:{i:0;i:7755;}i:7756;a:1:{i:0;i:7757;}i:7758;a:1:{i:0;i:7759;}i:7760;a:1:{i:0;i:7761;}i:7762;a:1:{i:0;i:7763;}i:7764;a:1:{i:0;i:7765;}i:7766;a:1:{i:0;i:7767;}i:7768;a:1:{i:0;i:7769;}i:7770;a:1:{i:0;i:7771;}i:7772;a:1:{i:0;i:7773;}i:7774;a:1:{i:0;i:7775;}i:7776;a:1:{i:0;i:7777;}i:7778;a:1:{i:0;i:7779;}i:7780;a:1:{i:0;i:7781;}i:7782;a:1:{i:0;i:7783;}i:7784;a:1:{i:0;i:7785;}i:7786;a:1:{i:0;i:7787;}i:7788;a:1:{i:0;i:7789;}i:7790;a:1:{i:0;i:7791;}i:7792;a:1:{i:0;i:7793;}i:7794;a:1:{i:0;i:7795;}i:7796;a:1:{i:0;i:7797;}i:7798;a:1:{i:0;i:7799;}i:7800;a:1:{i:0;i:7801;}i:7802;a:1:{i:0;i:7803;}i:7804;a:1:{i:0;i:7805;}i:7806;a:1:{i:0;i:7807;}i:7808;a:1:{i:0;i:7809;}i:7810;a:1:{i:0;i:7811;}i:7812;a:1:{i:0;i:7813;}i:7814;a:1:{i:0;i:7815;}i:7816;a:1:{i:0;i:7817;}i:7818;a:1:{i:0;i:7819;}i:7820;a:1:{i:0;i:7821;}i:7822;a:1:{i:0;i:7823;}i:7824;a:1:{i:0;i:7825;}i:7826;a:1:{i:0;i:7827;}i:7828;a:1:{i:0;i:7829;}i:7830;a:2:{i:0;i:104;i:1;i:817;}i:7831;a:2:{i:0;i:116;i:1;i:776;}i:7832;a:2:{i:0;i:119;i:1;i:778;}i:7833;a:2:{i:0;i:121;i:1;i:778;}i:7834;a:2:{i:0;i:97;i:1;i:702;}i:7835;a:1:{i:0;i:7777;}i:7840;a:1:{i:0;i:7841;}i:7842;a:1:{i:0;i:7843;}i:7844;a:1:{i:0;i:7845;}i:7846;a:1:{i:0;i:7847;}i:7848;a:1:{i:0;i:7849;}i:7850;a:1:{i:0;i:7851;}i:7852;a:1:{i:0;i:7853;}i:7854;a:1:{i:0;i:7855;}i:7856;a:1:{i:0;i:7857;}i:7858;a:1:{i:0;i:7859;}i:7860;a:1:{i:0;i:7861;}i:7862;a:1:{i:0;i:7863;}i:7864;a:1:{i:0;i:7865;}i:7866;a:1:{i:0;i:7867;}i:7868;a:1:{i:0;i:7869;}i:7870;a:1:{i:0;i:7871;}i:7872;a:1:{i:0;i:7873;}i:7874;a:1:{i:0;i:7875;}i:7876;a:1:{i:0;i:7877;}i:7878;a:1:{i:0;i:7879;}i:7880;a:1:{i:0;i:7881;}i:7882;a:1:{i:0;i:7883;}i:7884;a:1:{i:0;i:7885;}i:7886;a:1:{i:0;i:7887;}i:7888;a:1:{i:0;i:7889;}i:7890;a:1:{i:0;i:7891;}i:7892;a:1:{i:0;i:7893;}i:7894;a:1:{i:0;i:7895;}i:7896;a:1:{i:0;i:7897;}i:7898;a:1:{i:0;i:7899;}i:7900;a:1:{i:0;i:7901;}i:7902;a:1:{i:0;i:7903;}i:7904;a:1:{i:0;i:7905;}i:7906;a:1:{i:0;i:7907;}i:7908;a:1:{i:0;i:7909;}i:7910;a:1:{i:0;i:7911;}i:7912;a:1:{i:0;i:7913;}i:7914;a:1:{i:0;i:7915;}i:7916;a:1:{i:0;i:7917;}i:7918;a:1:{i:0;i:7919;}i:7920;a:1:{i:0;i:7921;}i:7922;a:1:{i:0;i:7923;}i:7924;a:1:{i:0;i:7925;}i:7926;a:1:{i:0;i:7927;}i:7928;a:1:{i:0;i:7929;}i:7944;a:1:{i:0;i:7936;}i:7945;a:1:{i:0;i:7937;}i:7946;a:1:{i:0;i:7938;}i:7947;a:1:{i:0;i:7939;}i:7948;a:1:{i:0;i:7940;}i:7949;a:1:{i:0;i:7941;}i:7950;a:1:{i:0;i:7942;}i:7951;a:1:{i:0;i:7943;}i:7960;a:1:{i:0;i:7952;}i:7961;a:1:{i:0;i:7953;}i:7962;a:1:{i:0;i:7954;}i:7963;a:1:{i:0;i:7955;}i:7964;a:1:{i:0;i:7956;}i:7965;a:1:{i:0;i:7957;}i:7976;a:1:{i:0;i:7968;}i:7977;a:1:{i:0;i:7969;}i:7978;a:1:{i:0;i:7970;}i:7979;a:1:{i:0;i:7971;}i:7980;a:1:{i:0;i:7972;}i:7981;a:1:{i:0;i:7973;}i:7982;a:1:{i:0;i:7974;}i:7983;a:1:{i:0;i:7975;}i:7992;a:1:{i:0;i:7984;}i:7993;a:1:{i:0;i:7985;}i:7994;a:1:{i:0;i:7986;}i:7995;a:1:{i:0;i:7987;}i:7996;a:1:{i:0;i:7988;}i:7997;a:1:{i:0;i:7989;}i:7998;a:1:{i:0;i:7990;}i:7999;a:1:{i:0;i:7991;}i:8008;a:1:{i:0;i:8000;}i:8009;a:1:{i:0;i:8001;}i:8010;a:1:{i:0;i:8002;}i:8011;a:1:{i:0;i:8003;}i:8012;a:1:{i:0;i:8004;}i:8013;a:1:{i:0;i:8005;}i:8016;a:2:{i:0;i:965;i:1;i:787;}i:8018;a:3:{i:0;i:965;i:1;i:787;i:2;i:768;}i:8020;a:3:{i:0;i:965;i:1;i:787;i:2;i:769;}i:8022;a:3:{i:0;i:965;i:1;i:787;i:2;i:834;}i:8025;a:1:{i:0;i:8017;}i:8027;a:1:{i:0;i:8019;}i:8029;a:1:{i:0;i:8021;}i:8031;a:1:{i:0;i:8023;}i:8040;a:1:{i:0;i:8032;}i:8041;a:1:{i:0;i:8033;}i:8042;a:1:{i:0;i:8034;}i:8043;a:1:{i:0;i:8035;}i:8044;a:1:{i:0;i:8036;}i:8045;a:1:{i:0;i:8037;}i:8046;a:1:{i:0;i:8038;}i:8047;a:1:{i:0;i:8039;}i:8064;a:2:{i:0;i:7936;i:1;i:953;}i:8065;a:2:{i:0;i:7937;i:1;i:953;}i:8066;a:2:{i:0;i:7938;i:1;i:953;}i:8067;a:2:{i:0;i:7939;i:1;i:953;}i:8068;a:2:{i:0;i:7940;i:1;i:953;}i:8069;a:2:{i:0;i:7941;i:1;i:953;}i:8070;a:2:{i:0;i:7942;i:1;i:953;}i:8071;a:2:{i:0;i:7943;i:1;i:953;}i:8072;a:2:{i:0;i:7936;i:1;i:953;}i:8073;a:2:{i:0;i:7937;i:1;i:953;}i:8074;a:2:{i:0;i:7938;i:1;i:953;}i:8075;a:2:{i:0;i:7939;i:1;i:953;}i:8076;a:2:{i:0;i:7940;i:1;i:953;}i:8077;a:2:{i:0;i:7941;i:1;i:953;}i:8078;a:2:{i:0;i:7942;i:1;i:953;}i:8079;a:2:{i:0;i:7943;i:1;i:953;}i:8080;a:2:{i:0;i:7968;i:1;i:953;}i:8081;a:2:{i:0;i:7969;i:1;i:953;}i:8082;a:2:{i:0;i:7970;i:1;i:953;}i:8083;a:2:{i:0;i:7971;i:1;i:953;}i:8084;a:2:{i:0;i:7972;i:1;i:953;}i:8085;a:2:{i:0;i:7973;i:1;i:953;}i:8086;a:2:{i:0;i:7974;i:1;i:953;}i:8087;a:2:{i:0;i:7975;i:1;i:953;}i:8088;a:2:{i:0;i:7968;i:1;i:953;}i:8089;a:2:{i:0;i:7969;i:1;i:953;}i:8090;a:2:{i:0;i:7970;i:1;i:953;}i:8091;a:2:{i:0;i:7971;i:1;i:953;}i:8092;a:2:{i:0;i:7972;i:1;i:953;}i:8093;a:2:{i:0;i:7973;i:1;i:953;}i:8094;a:2:{i:0;i:7974;i:1;i:953;}i:8095;a:2:{i:0;i:7975;i:1;i:953;}i:8096;a:2:{i:0;i:8032;i:1;i:953;}i:8097;a:2:{i:0;i:8033;i:1;i:953;}i:8098;a:2:{i:0;i:8034;i:1;i:953;}i:8099;a:2:{i:0;i:8035;i:1;i:953;}i:8100;a:2:{i:0;i:8036;i:1;i:953;}i:8101;a:2:{i:0;i:8037;i:1;i:953;}i:8102;a:2:{i:0;i:8038;i:1;i:953;}i:8103;a:2:{i:0;i:8039;i:1;i:953;}i:8104;a:2:{i:0;i:8032;i:1;i:953;}i:8105;a:2:{i:0;i:8033;i:1;i:953;}i:8106;a:2:{i:0;i:8034;i:1;i:953;}i:8107;a:2:{i:0;i:8035;i:1;i:953;}i:8108;a:2:{i:0;i:8036;i:1;i:953;}i:8109;a:2:{i:0;i:8037;i:1;i:953;}i:8110;a:2:{i:0;i:8038;i:1;i:953;}i:8111;a:2:{i:0;i:8039;i:1;i:953;}i:8114;a:2:{i:0;i:8048;i:1;i:953;}i:8115;a:2:{i:0;i:945;i:1;i:953;}i:8116;a:2:{i:0;i:940;i:1;i:953;}i:8118;a:2:{i:0;i:945;i:1;i:834;}i:8119;a:3:{i:0;i:945;i:1;i:834;i:2;i:953;}i:8120;a:1:{i:0;i:8112;}i:8121;a:1:{i:0;i:8113;}i:8122;a:1:{i:0;i:8048;}i:8123;a:1:{i:0;i:8049;}i:8124;a:2:{i:0;i:945;i:1;i:953;}i:8126;a:1:{i:0;i:953;}i:8130;a:2:{i:0;i:8052;i:1;i:953;}i:8131;a:2:{i:0;i:951;i:1;i:953;}i:8132;a:2:{i:0;i:942;i:1;i:953;}i:8134;a:2:{i:0;i:951;i:1;i:834;}i:8135;a:3:{i:0;i:951;i:1;i:834;i:2;i:953;}i:8136;a:1:{i:0;i:8050;}i:8137;a:1:{i:0;i:8051;}i:8138;a:1:{i:0;i:8052;}i:8139;a:1:{i:0;i:8053;}i:8140;a:2:{i:0;i:951;i:1;i:953;}i:8146;a:3:{i:0;i:953;i:1;i:776;i:2;i:768;}i:8147;a:3:{i:0;i:953;i:1;i:776;i:2;i:769;}i:8150;a:2:{i:0;i:953;i:1;i:834;}i:8151;a:3:{i:0;i:953;i:1;i:776;i:2;i:834;}i:8152;a:1:{i:0;i:8144;}i:8153;a:1:{i:0;i:8145;}i:8154;a:1:{i:0;i:8054;}i:8155;a:1:{i:0;i:8055;}i:8162;a:3:{i:0;i:965;i:1;i:776;i:2;i:768;}i:8163;a:3:{i:0;i:965;i:1;i:776;i:2;i:769;}i:8164;a:2:{i:0;i:961;i:1;i:787;}i:8166;a:2:{i:0;i:965;i:1;i:834;}i:8167;a:3:{i:0;i:965;i:1;i:776;i:2;i:834;}i:8168;a:1:{i:0;i:8160;}i:8169;a:1:{i:0;i:8161;}i:8170;a:1:{i:0;i:8058;}i:8171;a:1:{i:0;i:8059;}i:8172;a:1:{i:0;i:8165;}i:8178;a:2:{i:0;i:8060;i:1;i:953;}i:8179;a:2:{i:0;i:969;i:1;i:953;}i:8180;a:2:{i:0;i:974;i:1;i:953;}i:8182;a:2:{i:0;i:969;i:1;i:834;}i:8183;a:3:{i:0;i:969;i:1;i:834;i:2;i:953;}i:8184;a:1:{i:0;i:8056;}i:8185;a:1:{i:0;i:8057;}i:8186;a:1:{i:0;i:8060;}i:8187;a:1:{i:0;i:8061;}i:8188;a:2:{i:0;i:969;i:1;i:953;}i:8360;a:2:{i:0;i:114;i:1;i:115;}i:8450;a:1:{i:0;i:99;}i:8451;a:2:{i:0;i:176;i:1;i:99;}i:8455;a:1:{i:0;i:603;}i:8457;a:2:{i:0;i:176;i:1;i:102;}i:8459;a:1:{i:0;i:104;}i:8460;a:1:{i:0;i:104;}i:8461;a:1:{i:0;i:104;}i:8464;a:1:{i:0;i:105;}i:8465;a:1:{i:0;i:105;}i:8466;a:1:{i:0;i:108;}i:8469;a:1:{i:0;i:110;}i:8470;a:2:{i:0;i:110;i:1;i:111;}i:8473;a:1:{i:0;i:112;}i:8474;a:1:{i:0;i:113;}i:8475;a:1:{i:0;i:114;}i:8476;a:1:{i:0;i:114;}i:8477;a:1:{i:0;i:114;}i:8480;a:2:{i:0;i:115;i:1;i:109;}i:8481;a:3:{i:0;i:116;i:1;i:101;i:2;i:108;}i:8482;a:2:{i:0;i:116;i:1;i:109;}i:8484;a:1:{i:0;i:122;}i:8486;a:1:{i:0;i:969;}i:8488;a:1:{i:0;i:122;}i:8490;a:1:{i:0;i:107;}i:8491;a:1:{i:0;i:229;}i:8492;a:1:{i:0;i:98;}i:8493;a:1:{i:0;i:99;}i:8496;a:1:{i:0;i:101;}i:8497;a:1:{i:0;i:102;}i:8499;a:1:{i:0;i:109;}i:8510;a:1:{i:0;i:947;}i:8511;a:1:{i:0;i:960;}i:8517;a:1:{i:0;i:100;}i:8544;a:1:{i:0;i:8560;}i:8545;a:1:{i:0;i:8561;}i:8546;a:1:{i:0;i:8562;}i:8547;a:1:{i:0;i:8563;}i:8548;a:1:{i:0;i:8564;}i:8549;a:1:{i:0;i:8565;}i:8550;a:1:{i:0;i:8566;}i:8551;a:1:{i:0;i:8567;}i:8552;a:1:{i:0;i:8568;}i:8553;a:1:{i:0;i:8569;}i:8554;a:1:{i:0;i:8570;}i:8555;a:1:{i:0;i:8571;}i:8556;a:1:{i:0;i:8572;}i:8557;a:1:{i:0;i:8573;}i:8558;a:1:{i:0;i:8574;}i:8559;a:1:{i:0;i:8575;}i:9398;a:1:{i:0;i:9424;}i:9399;a:1:{i:0;i:9425;}i:9400;a:1:{i:0;i:9426;}i:9401;a:1:{i:0;i:9427;}i:9402;a:1:{i:0;i:9428;}i:9403;a:1:{i:0;i:9429;}i:9404;a:1:{i:0;i:9430;}i:9405;a:1:{i:0;i:9431;}i:9406;a:1:{i:0;i:9432;}i:9407;a:1:{i:0;i:9433;}i:9408;a:1:{i:0;i:9434;}i:9409;a:1:{i:0;i:9435;}i:9410;a:1:{i:0;i:9436;}i:9411;a:1:{i:0;i:9437;}i:9412;a:1:{i:0;i:9438;}i:9413;a:1:{i:0;i:9439;}i:9414;a:1:{i:0;i:9440;}i:9415;a:1:{i:0;i:9441;}i:9416;a:1:{i:0;i:9442;}i:9417;a:1:{i:0;i:9443;}i:9418;a:1:{i:0;i:9444;}i:9419;a:1:{i:0;i:9445;}i:9420;a:1:{i:0;i:9446;}i:9421;a:1:{i:0;i:9447;}i:9422;a:1:{i:0;i:9448;}i:9423;a:1:{i:0;i:9449;}i:13169;a:3:{i:0;i:104;i:1;i:112;i:2;i:97;}i:13171;a:2:{i:0;i:97;i:1;i:117;}i:13173;a:2:{i:0;i:111;i:1;i:118;}i:13184;a:2:{i:0;i:112;i:1;i:97;}i:13185;a:2:{i:0;i:110;i:1;i:97;}i:13186;a:2:{i:0;i:956;i:1;i:97;}i:13187;a:2:{i:0;i:109;i:1;i:97;}i:13188;a:2:{i:0;i:107;i:1;i:97;}i:13189;a:2:{i:0;i:107;i:1;i:98;}i:13190;a:2:{i:0;i:109;i:1;i:98;}i:13191;a:2:{i:0;i:103;i:1;i:98;}i:13194;a:2:{i:0;i:112;i:1;i:102;}i:13195;a:2:{i:0;i:110;i:1;i:102;}i:13196;a:2:{i:0;i:956;i:1;i:102;}i:13200;a:2:{i:0;i:104;i:1;i:122;}i:13201;a:3:{i:0;i:107;i:1;i:104;i:2;i:122;}i:13202;a:3:{i:0;i:109;i:1;i:104;i:2;i:122;}i:13203;a:3:{i:0;i:103;i:1;i:104;i:2;i:122;}i:13204;a:3:{i:0;i:116;i:1;i:104;i:2;i:122;}i:13225;a:2:{i:0;i:112;i:1;i:97;}i:13226;a:3:{i:0;i:107;i:1;i:112;i:2;i:97;}i:13227;a:3:{i:0;i:109;i:1;i:112;i:2;i:97;}i:13228;a:3:{i:0;i:103;i:1;i:112;i:2;i:97;}i:13236;a:2:{i:0;i:112;i:1;i:118;}i:13237;a:2:{i:0;i:110;i:1;i:118;}i:13238;a:2:{i:0;i:956;i:1;i:118;}i:13239;a:2:{i:0;i:109;i:1;i:118;}i:13240;a:2:{i:0;i:107;i:1;i:118;}i:13241;a:2:{i:0;i:109;i:1;i:118;}i:13242;a:2:{i:0;i:112;i:1;i:119;}i:13243;a:2:{i:0;i:110;i:1;i:119;}i:13244;a:2:{i:0;i:956;i:1;i:119;}i:13245;a:2:{i:0;i:109;i:1;i:119;}i:13246;a:2:{i:0;i:107;i:1;i:119;}i:13247;a:2:{i:0;i:109;i:1;i:119;}i:13248;a:2:{i:0;i:107;i:1;i:969;}i:13249;a:2:{i:0;i:109;i:1;i:969;}i:13251;a:2:{i:0;i:98;i:1;i:113;}i:13254;a:4:{i:0;i:99;i:1;i:8725;i:2;i:107;i:3;i:103;}i:13255;a:3:{i:0;i:99;i:1;i:111;i:2;i:46;}i:13256;a:2:{i:0;i:100;i:1;i:98;}i:13257;a:2:{i:0;i:103;i:1;i:121;}i:13259;a:2:{i:0;i:104;i:1;i:112;}i:13261;a:2:{i:0;i:107;i:1;i:107;}i:13262;a:2:{i:0;i:107;i:1;i:109;}i:13271;a:2:{i:0;i:112;i:1;i:104;}i:13273;a:3:{i:0;i:112;i:1;i:112;i:2;i:109;}i:13274;a:2:{i:0;i:112;i:1;i:114;}i:13276;a:2:{i:0;i:115;i:1;i:118;}i:13277;a:2:{i:0;i:119;i:1;i:98;}i:64256;a:2:{i:0;i:102;i:1;i:102;}i:64257;a:2:{i:0;i:102;i:1;i:105;}i:64258;a:2:{i:0;i:102;i:1;i:108;}i:64259;a:3:{i:0;i:102;i:1;i:102;i:2;i:105;}i:64260;a:3:{i:0;i:102;i:1;i:102;i:2;i:108;}i:64261;a:2:{i:0;i:115;i:1;i:116;}i:64262;a:2:{i:0;i:115;i:1;i:116;}i:64275;a:2:{i:0;i:1396;i:1;i:1398;}i:64276;a:2:{i:0;i:1396;i:1;i:1381;}i:64277;a:2:{i:0;i:1396;i:1;i:1387;}i:64278;a:2:{i:0;i:1406;i:1;i:1398;}i:64279;a:2:{i:0;i:1396;i:1;i:1389;}i:65313;a:1:{i:0;i:65345;}i:65314;a:1:{i:0;i:65346;}i:65315;a:1:{i:0;i:65347;}i:65316;a:1:{i:0;i:65348;}i:65317;a:1:{i:0;i:65349;}i:65318;a:1:{i:0;i:65350;}i:65319;a:1:{i:0;i:65351;}i:65320;a:1:{i:0;i:65352;}i:65321;a:1:{i:0;i:65353;}i:65322;a:1:{i:0;i:65354;}i:65323;a:1:{i:0;i:65355;}i:65324;a:1:{i:0;i:65356;}i:65325;a:1:{i:0;i:65357;}i:65326;a:1:{i:0;i:65358;}i:65327;a:1:{i:0;i:65359;}i:65328;a:1:{i:0;i:65360;}i:65329;a:1:{i:0;i:65361;}i:65330;a:1:{i:0;i:65362;}i:65331;a:1:{i:0;i:65363;}i:65332;a:1:{i:0;i:65364;}i:65333;a:1:{i:0;i:65365;}i:65334;a:1:{i:0;i:65366;}i:65335;a:1:{i:0;i:65367;}i:65336;a:1:{i:0;i:65368;}i:65337;a:1:{i:0;i:65369;}i:65338;a:1:{i:0;i:65370;}i:66560;a:1:{i:0;i:66600;}i:66561;a:1:{i:0;i:66601;}i:66562;a:1:{i:0;i:66602;}i:66563;a:1:{i:0;i:66603;}i:66564;a:1:{i:0;i:66604;}i:66565;a:1:{i:0;i:66605;}i:66566;a:1:{i:0;i:66606;}i:66567;a:1:{i:0;i:66607;}i:66568;a:1:{i:0;i:66608;}i:66569;a:1:{i:0;i:66609;}i:66570;a:1:{i:0;i:66610;}i:66571;a:1:{i:0;i:66611;}i:66572;a:1:{i:0;i:66612;}i:66573;a:1:{i:0;i:66613;}i:66574;a:1:{i:0;i:66614;}i:66575;a:1:{i:0;i:66615;}i:66576;a:1:{i:0;i:66616;}i:66577;a:1:{i:0;i:66617;}i:66578;a:1:{i:0;i:66618;}i:66579;a:1:{i:0;i:66619;}i:66580;a:1:{i:0;i:66620;}i:66581;a:1:{i:0;i:66621;}i:66582;a:1:{i:0;i:66622;}i:66583;a:1:{i:0;i:66623;}i:66584;a:1:{i:0;i:66624;}i:66585;a:1:{i:0;i:66625;}i:66586;a:1:{i:0;i:66626;}i:66587;a:1:{i:0;i:66627;}i:66588;a:1:{i:0;i:66628;}i:66589;a:1:{i:0;i:66629;}i:66590;a:1:{i:0;i:66630;}i:66591;a:1:{i:0;i:66631;}i:66592;a:1:{i:0;i:66632;}i:66593;a:1:{i:0;i:66633;}i:66594;a:1:{i:0;i:66634;}i:66595;a:1:{i:0;i:66635;}i:66596;a:1:{i:0;i:66636;}i:66597;a:1:{i:0;i:66637;}i:119808;a:1:{i:0;i:97;}i:119809;a:1:{i:0;i:98;}i:119810;a:1:{i:0;i:99;}i:119811;a:1:{i:0;i:100;}i:119812;a:1:{i:0;i:101;}i:119813;a:1:{i:0;i:102;}i:119814;a:1:{i:0;i:103;}i:119815;a:1:{i:0;i:104;}i:119816;a:1:{i:0;i:105;}i:119817;a:1:{i:0;i:106;}i:119818;a:1:{i:0;i:107;}i:119819;a:1:{i:0;i:108;}i:119820;a:1:{i:0;i:109;}i:119821;a:1:{i:0;i:110;}i:119822;a:1:{i:0;i:111;}i:119823;a:1:{i:0;i:112;}i:119824;a:1:{i:0;i:113;}i:119825;a:1:{i:0;i:114;}i:119826;a:1:{i:0;i:115;}i:119827;a:1:{i:0;i:116;}i:119828;a:1:{i:0;i:117;}i:119829;a:1:{i:0;i:118;}i:119830;a:1:{i:0;i:119;}i:119831;a:1:{i:0;i:120;}i:119832;a:1:{i:0;i:121;}i:119833;a:1:{i:0;i:122;}i:119860;a:1:{i:0;i:97;}i:119861;a:1:{i:0;i:98;}i:119862;a:1:{i:0;i:99;}i:119863;a:1:{i:0;i:100;}i:119864;a:1:{i:0;i:101;}i:119865;a:1:{i:0;i:102;}i:119866;a:1:{i:0;i:103;}i:119867;a:1:{i:0;i:104;}i:119868;a:1:{i:0;i:105;}i:119869;a:1:{i:0;i:106;}i:119870;a:1:{i:0;i:107;}i:119871;a:1:{i:0;i:108;}i:119872;a:1:{i:0;i:109;}i:119873;a:1:{i:0;i:110;}i:119874;a:1:{i:0;i:111;}i:119875;a:1:{i:0;i:112;}i:119876;a:1:{i:0;i:113;}i:119877;a:1:{i:0;i:114;}i:119878;a:1:{i:0;i:115;}i:119879;a:1:{i:0;i:116;}i:119880;a:1:{i:0;i:117;}i:119881;a:1:{i:0;i:118;}i:119882;a:1:{i:0;i:119;}i:119883;a:1:{i:0;i:120;}i:119884;a:1:{i:0;i:121;}i:119885;a:1:{i:0;i:122;}i:119912;a:1:{i:0;i:97;}i:119913;a:1:{i:0;i:98;}i:119914;a:1:{i:0;i:99;}i:119915;a:1:{i:0;i:100;}i:119916;a:1:{i:0;i:101;}i:119917;a:1:{i:0;i:102;}i:119918;a:1:{i:0;i:103;}i:119919;a:1:{i:0;i:104;}i:119920;a:1:{i:0;i:105;}i:119921;a:1:{i:0;i:106;}i:119922;a:1:{i:0;i:107;}i:119923;a:1:{i:0;i:108;}i:119924;a:1:{i:0;i:109;}i:119925;a:1:{i:0;i:110;}i:119926;a:1:{i:0;i:111;}i:119927;a:1:{i:0;i:112;}i:119928;a:1:{i:0;i:113;}i:119929;a:1:{i:0;i:114;}i:119930;a:1:{i:0;i:115;}i:119931;a:1:{i:0;i:116;}i:119932;a:1:{i:0;i:117;}i:119933;a:1:{i:0;i:118;}i:119934;a:1:{i:0;i:119;}i:119935;a:1:{i:0;i:120;}i:119936;a:1:{i:0;i:121;}i:119937;a:1:{i:0;i:122;}i:119964;a:1:{i:0;i:97;}i:119966;a:1:{i:0;i:99;}i:119967;a:1:{i:0;i:100;}i:119970;a:1:{i:0;i:103;}i:119973;a:1:{i:0;i:106;}i:119974;a:1:{i:0;i:107;}i:119977;a:1:{i:0;i:110;}i:119978;a:1:{i:0;i:111;}i:119979;a:1:{i:0;i:112;}i:119980;a:1:{i:0;i:113;}i:119982;a:1:{i:0;i:115;}i:119983;a:1:{i:0;i:116;}i:119984;a:1:{i:0;i:117;}i:119985;a:1:{i:0;i:118;}i:119986;a:1:{i:0;i:119;}i:119987;a:1:{i:0;i:120;}i:119988;a:1:{i:0;i:121;}i:119989;a:1:{i:0;i:122;}i:120016;a:1:{i:0;i:97;}i:120017;a:1:{i:0;i:98;}i:120018;a:1:{i:0;i:99;}i:120019;a:1:{i:0;i:100;}i:120020;a:1:{i:0;i:101;}i:120021;a:1:{i:0;i:102;}i:120022;a:1:{i:0;i:103;}i:120023;a:1:{i:0;i:104;}i:120024;a:1:{i:0;i:105;}i:120025;a:1:{i:0;i:106;}i:120026;a:1:{i:0;i:107;}i:120027;a:1:{i:0;i:108;}i:120028;a:1:{i:0;i:109;}i:120029;a:1:{i:0;i:110;}i:120030;a:1:{i:0;i:111;}i:120031;a:1:{i:0;i:112;}i:120032;a:1:{i:0;i:113;}i:120033;a:1:{i:0;i:114;}i:120034;a:1:{i:0;i:115;}i:120035;a:1:{i:0;i:116;}i:120036;a:1:{i:0;i:117;}i:120037;a:1:{i:0;i:118;}i:120038;a:1:{i:0;i:119;}i:120039;a:1:{i:0;i:120;}i:120040;a:1:{i:0;i:121;}i:120041;a:1:{i:0;i:122;}i:120068;a:1:{i:0;i:97;}i:120069;a:1:{i:0;i:98;}i:120071;a:1:{i:0;i:100;}i:120072;a:1:{i:0;i:101;}i:120073;a:1:{i:0;i:102;}i:120074;a:1:{i:0;i:103;}i:120077;a:1:{i:0;i:106;}i:120078;a:1:{i:0;i:107;}i:120079;a:1:{i:0;i:108;}i:120080;a:1:{i:0;i:109;}i:120081;a:1:{i:0;i:110;}i:120082;a:1:{i:0;i:111;}i:120083;a:1:{i:0;i:112;}i:120084;a:1:{i:0;i:113;}i:120086;a:1:{i:0;i:115;}i:120087;a:1:{i:0;i:116;}i:120088;a:1:{i:0;i:117;}i:120089;a:1:{i:0;i:118;}i:120090;a:1:{i:0;i:119;}i:120091;a:1:{i:0;i:120;}i:120092;a:1:{i:0;i:121;}i:120120;a:1:{i:0;i:97;}i:120121;a:1:{i:0;i:98;}i:120123;a:1:{i:0;i:100;}i:120124;a:1:{i:0;i:101;}i:120125;a:1:{i:0;i:102;}i:120126;a:1:{i:0;i:103;}i:120128;a:1:{i:0;i:105;}i:120129;a:1:{i:0;i:106;}i:120130;a:1:{i:0;i:107;}i:120131;a:1:{i:0;i:108;}i:120132;a:1:{i:0;i:109;}i:120134;a:1:{i:0;i:111;}i:120138;a:1:{i:0;i:115;}i:120139;a:1:{i:0;i:116;}i:120140;a:1:{i:0;i:117;}i:120141;a:1:{i:0;i:118;}i:120142;a:1:{i:0;i:119;}i:120143;a:1:{i:0;i:120;}i:120144;a:1:{i:0;i:121;}i:120172;a:1:{i:0;i:97;}i:120173;a:1:{i:0;i:98;}i:120174;a:1:{i:0;i:99;}i:120175;a:1:{i:0;i:100;}i:120176;a:1:{i:0;i:101;}i:120177;a:1:{i:0;i:102;}i:120178;a:1:{i:0;i:103;}i:120179;a:1:{i:0;i:104;}i:120180;a:1:{i:0;i:105;}i:120181;a:1:{i:0;i:106;}i:120182;a:1:{i:0;i:107;}i:120183;a:1:{i:0;i:108;}i:120184;a:1:{i:0;i:109;}i:120185;a:1:{i:0;i:110;}i:120186;a:1:{i:0;i:111;}i:120187;a:1:{i:0;i:112;}i:120188;a:1:{i:0;i:113;}i:120189;a:1:{i:0;i:114;}i:120190;a:1:{i:0;i:115;}i:120191;a:1:{i:0;i:116;}i:120192;a:1:{i:0;i:117;}i:120193;a:1:{i:0;i:118;}i:120194;a:1:{i:0;i:119;}i:120195;a:1:{i:0;i:120;}i:120196;a:1:{i:0;i:121;}i:120197;a:1:{i:0;i:122;}i:120224;a:1:{i:0;i:97;}i:120225;a:1:{i:0;i:98;}i:120226;a:1:{i:0;i:99;}i:120227;a:1:{i:0;i:100;}i:120228;a:1:{i:0;i:101;}i:120229;a:1:{i:0;i:102;}i:120230;a:1:{i:0;i:103;}i:120231;a:1:{i:0;i:104;}i:120232;a:1:{i:0;i:105;}i:120233;a:1:{i:0;i:106;}i:120234;a:1:{i:0;i:107;}i:120235;a:1:{i:0;i:108;}i:120236;a:1:{i:0;i:109;}i:120237;a:1:{i:0;i:110;}i:120238;a:1:{i:0;i:111;}i:120239;a:1:{i:0;i:112;}i:120240;a:1:{i:0;i:113;}i:120241;a:1:{i:0;i:114;}i:120242;a:1:{i:0;i:115;}i:120243;a:1:{i:0;i:116;}i:120244;a:1:{i:0;i:117;}i:120245;a:1:{i:0;i:118;}i:120246;a:1:{i:0;i:119;}i:120247;a:1:{i:0;i:120;}i:120248;a:1:{i:0;i:121;}i:120249;a:1:{i:0;i:122;}i:120276;a:1:{i:0;i:97;}i:120277;a:1:{i:0;i:98;}i:120278;a:1:{i:0;i:99;}i:120279;a:1:{i:0;i:100;}i:120280;a:1:{i:0;i:101;}i:120281;a:1:{i:0;i:102;}i:120282;a:1:{i:0;i:103;}i:120283;a:1:{i:0;i:104;}i:120284;a:1:{i:0;i:105;}i:120285;a:1:{i:0;i:106;}i:120286;a:1:{i:0;i:107;}i:120287;a:1:{i:0;i:108;}i:120288;a:1:{i:0;i:109;}i:120289;a:1:{i:0;i:110;}i:120290;a:1:{i:0;i:111;}i:120291;a:1:{i:0;i:112;}i:120292;a:1:{i:0;i:113;}i:120293;a:1:{i:0;i:114;}i:120294;a:1:{i:0;i:115;}i:120295;a:1:{i:0;i:116;}i:120296;a:1:{i:0;i:117;}i:120297;a:1:{i:0;i:118;}i:120298;a:1:{i:0;i:119;}i:120299;a:1:{i:0;i:120;}i:120300;a:1:{i:0;i:121;}i:120301;a:1:{i:0;i:122;}i:120328;a:1:{i:0;i:97;}i:120329;a:1:{i:0;i:98;}i:120330;a:1:{i:0;i:99;}i:120331;a:1:{i:0;i:100;}i:120332;a:1:{i:0;i:101;}i:120333;a:1:{i:0;i:102;}i:120334;a:1:{i:0;i:103;}i:120335;a:1:{i:0;i:104;}i:120336;a:1:{i:0;i:105;}i:120337;a:1:{i:0;i:106;}i:120338;a:1:{i:0;i:107;}i:120339;a:1:{i:0;i:108;}i:120340;a:1:{i:0;i:109;}i:120341;a:1:{i:0;i:110;}i:120342;a:1:{i:0;i:111;}i:120343;a:1:{i:0;i:112;}i:120344;a:1:{i:0;i:113;}i:120345;a:1:{i:0;i:114;}i:120346;a:1:{i:0;i:115;}i:120347;a:1:{i:0;i:116;}i:120348;a:1:{i:0;i:117;}i:120349;a:1:{i:0;i:118;}i:120350;a:1:{i:0;i:119;}i:120351;a:1:{i:0;i:120;}i:120352;a:1:{i:0;i:121;}i:120353;a:1:{i:0;i:122;}i:120380;a:1:{i:0;i:97;}i:120381;a:1:{i:0;i:98;}i:120382;a:1:{i:0;i:99;}i:120383;a:1:{i:0;i:100;}i:120384;a:1:{i:0;i:101;}i:120385;a:1:{i:0;i:102;}i:120386;a:1:{i:0;i:103;}i:120387;a:1:{i:0;i:104;}i:120388;a:1:{i:0;i:105;}i:120389;a:1:{i:0;i:106;}i:120390;a:1:{i:0;i:107;}i:120391;a:1:{i:0;i:108;}i:120392;a:1:{i:0;i:109;}i:120393;a:1:{i:0;i:110;}i:120394;a:1:{i:0;i:111;}i:120395;a:1:{i:0;i:112;}i:120396;a:1:{i:0;i:113;}i:120397;a:1:{i:0;i:114;}i:120398;a:1:{i:0;i:115;}i:120399;a:1:{i:0;i:116;}i:120400;a:1:{i:0;i:117;}i:120401;a:1:{i:0;i:118;}i:120402;a:1:{i:0;i:119;}i:120403;a:1:{i:0;i:120;}i:120404;a:1:{i:0;i:121;}i:120405;a:1:{i:0;i:122;}i:120432;a:1:{i:0;i:97;}i:120433;a:1:{i:0;i:98;}i:120434;a:1:{i:0;i:99;}i:120435;a:1:{i:0;i:100;}i:120436;a:1:{i:0;i:101;}i:120437;a:1:{i:0;i:102;}i:120438;a:1:{i:0;i:103;}i:120439;a:1:{i:0;i:104;}i:120440;a:1:{i:0;i:105;}i:120441;a:1:{i:0;i:106;}i:120442;a:1:{i:0;i:107;}i:120443;a:1:{i:0;i:108;}i:120444;a:1:{i:0;i:109;}i:120445;a:1:{i:0;i:110;}i:120446;a:1:{i:0;i:111;}i:120447;a:1:{i:0;i:112;}i:120448;a:1:{i:0;i:113;}i:120449;a:1:{i:0;i:114;}i:120450;a:1:{i:0;i:115;}i:120451;a:1:{i:0;i:116;}i:120452;a:1:{i:0;i:117;}i:120453;a:1:{i:0;i:118;}i:120454;a:1:{i:0;i:119;}i:120455;a:1:{i:0;i:120;}i:120456;a:1:{i:0;i:121;}i:120457;a:1:{i:0;i:122;}i:120488;a:1:{i:0;i:945;}i:120489;a:1:{i:0;i:946;}i:120490;a:1:{i:0;i:947;}i:120491;a:1:{i:0;i:948;}i:120492;a:1:{i:0;i:949;}i:120493;a:1:{i:0;i:950;}i:120494;a:1:{i:0;i:951;}i:120495;a:1:{i:0;i:952;}i:120496;a:1:{i:0;i:953;}i:120497;a:1:{i:0;i:954;}i:120498;a:1:{i:0;i:955;}i:120499;a:1:{i:0;i:956;}i:120500;a:1:{i:0;i:957;}i:120501;a:1:{i:0;i:958;}i:120502;a:1:{i:0;i:959;}i:120503;a:1:{i:0;i:960;}i:120504;a:1:{i:0;i:961;}i:120505;a:1:{i:0;i:952;}i:120506;a:1:{i:0;i:963;}i:120507;a:1:{i:0;i:964;}i:120508;a:1:{i:0;i:965;}i:120509;a:1:{i:0;i:966;}i:120510;a:1:{i:0;i:967;}i:120511;a:1:{i:0;i:968;}i:120512;a:1:{i:0;i:969;}i:120531;a:1:{i:0;i:963;}i:120546;a:1:{i:0;i:945;}i:120547;a:1:{i:0;i:946;}i:120548;a:1:{i:0;i:947;}i:120549;a:1:{i:0;i:948;}i:120550;a:1:{i:0;i:949;}i:120551;a:1:{i:0;i:950;}i:120552;a:1:{i:0;i:951;}i:120553;a:1:{i:0;i:952;}i:120554;a:1:{i:0;i:953;}i:120555;a:1:{i:0;i:954;}i:120556;a:1:{i:0;i:955;}i:120557;a:1:{i:0;i:956;}i:120558;a:1:{i:0;i:957;}i:120559;a:1:{i:0;i:958;}i:120560;a:1:{i:0;i:959;}i:120561;a:1:{i:0;i:960;}i:120562;a:1:{i:0;i:961;}i:120563;a:1:{i:0;i:952;}i:120564;a:1:{i:0;i:963;}i:120565;a:1:{i:0;i:964;}i:120566;a:1:{i:0;i:965;}i:120567;a:1:{i:0;i:966;}i:120568;a:1:{i:0;i:967;}i:120569;a:1:{i:0;i:968;}i:120570;a:1:{i:0;i:969;}i:120589;a:1:{i:0;i:963;}i:120604;a:1:{i:0;i:945;}i:120605;a:1:{i:0;i:946;}i:120606;a:1:{i:0;i:947;}i:120607;a:1:{i:0;i:948;}i:120608;a:1:{i:0;i:949;}i:120609;a:1:{i:0;i:950;}i:120610;a:1:{i:0;i:951;}i:120611;a:1:{i:0;i:952;}i:120612;a:1:{i:0;i:953;}i:120613;a:1:{i:0;i:954;}i:120614;a:1:{i:0;i:955;}i:120615;a:1:{i:0;i:956;}i:120616;a:1:{i:0;i:957;}i:120617;a:1:{i:0;i:958;}i:120618;a:1:{i:0;i:959;}i:120619;a:1:{i:0;i:960;}i:120620;a:1:{i:0;i:961;}i:120621;a:1:{i:0;i:952;}i:120622;a:1:{i:0;i:963;}i:120623;a:1:{i:0;i:964;}i:120624;a:1:{i:0;i:965;}i:120625;a:1:{i:0;i:966;}i:120626;a:1:{i:0;i:967;}i:120627;a:1:{i:0;i:968;}i:120628;a:1:{i:0;i:969;}i:120647;a:1:{i:0;i:963;}i:120662;a:1:{i:0;i:945;}i:120663;a:1:{i:0;i:946;}i:120664;a:1:{i:0;i:947;}i:120665;a:1:{i:0;i:948;}i:120666;a:1:{i:0;i:949;}i:120667;a:1:{i:0;i:950;}i:120668;a:1:{i:0;i:951;}i:120669;a:1:{i:0;i:952;}i:120670;a:1:{i:0;i:953;}i:120671;a:1:{i:0;i:954;}i:120672;a:1:{i:0;i:955;}i:120673;a:1:{i:0;i:956;}i:120674;a:1:{i:0;i:957;}i:120675;a:1:{i:0;i:958;}i:120676;a:1:{i:0;i:959;}i:120677;a:1:{i:0;i:960;}i:120678;a:1:{i:0;i:961;}i:120679;a:1:{i:0;i:952;}i:120680;a:1:{i:0;i:963;}i:120681;a:1:{i:0;i:964;}i:120682;a:1:{i:0;i:965;}i:120683;a:1:{i:0;i:966;}i:120684;a:1:{i:0;i:967;}i:120685;a:1:{i:0;i:968;}i:120686;a:1:{i:0;i:969;}i:120705;a:1:{i:0;i:963;}i:120720;a:1:{i:0;i:945;}i:120721;a:1:{i:0;i:946;}i:120722;a:1:{i:0;i:947;}i:120723;a:1:{i:0;i:948;}i:120724;a:1:{i:0;i:949;}i:120725;a:1:{i:0;i:950;}i:120726;a:1:{i:0;i:951;}i:120727;a:1:{i:0;i:952;}i:120728;a:1:{i:0;i:953;}i:120729;a:1:{i:0;i:954;}i:120730;a:1:{i:0;i:955;}i:120731;a:1:{i:0;i:956;}i:120732;a:1:{i:0;i:957;}i:120733;a:1:{i:0;i:958;}i:120734;a:1:{i:0;i:959;}i:120735;a:1:{i:0;i:960;}i:120736;a:1:{i:0;i:961;}i:120737;a:1:{i:0;i:952;}i:120738;a:1:{i:0;i:963;}i:120739;a:1:{i:0;i:964;}i:120740;a:1:{i:0;i:965;}i:120741;a:1:{i:0;i:966;}i:120742;a:1:{i:0;i:967;}i:120743;a:1:{i:0;i:968;}i:120744;a:1:{i:0;i:969;}i:120763;a:1:{i:0;i:963;}i:1017;a:1:{i:0;i:963;}i:7468;a:1:{i:0;i:97;}i:7469;a:1:{i:0;i:230;}i:7470;a:1:{i:0;i:98;}i:7472;a:1:{i:0;i:100;}i:7473;a:1:{i:0;i:101;}i:7474;a:1:{i:0;i:477;}i:7475;a:1:{i:0;i:103;}i:7476;a:1:{i:0;i:104;}i:7477;a:1:{i:0;i:105;}i:7478;a:1:{i:0;i:106;}i:7479;a:1:{i:0;i:107;}i:7480;a:1:{i:0;i:108;}i:7481;a:1:{i:0;i:109;}i:7482;a:1:{i:0;i:110;}i:7484;a:1:{i:0;i:111;}i:7485;a:1:{i:0;i:547;}i:7486;a:1:{i:0;i:112;}i:7487;a:1:{i:0;i:114;}i:7488;a:1:{i:0;i:116;}i:7489;a:1:{i:0;i:117;}i:7490;a:1:{i:0;i:119;}i:8507;a:3:{i:0;i:102;i:1;i:97;i:2;i:120;}i:12880;a:3:{i:0;i:112;i:1;i:116;i:2;i:101;}i:13004;a:2:{i:0;i:104;i:1;i:103;}i:13006;a:2:{i:0;i:101;i:1;i:118;}i:13007;a:3:{i:0;i:108;i:1;i:116;i:2;i:100;}i:13178;a:2:{i:0;i:105;i:1;i:117;}i:13278;a:3:{i:0;i:118;i:1;i:8725;i:2;i:109;}i:13279;a:3:{i:0;i:97;i:1;i:8725;i:2;i:109;}}s:12:"norm_combcls";a:341:{i:820;i:1;i:821;i:1;i:822;i:1;i:823;i:1;i:824;i:1;i:2364;i:7;i:2492;i:7;i:2620;i:7;i:2748;i:7;i:2876;i:7;i:3260;i:7;i:4151;i:7;i:12441;i:8;i:12442;i:8;i:2381;i:9;i:2509;i:9;i:2637;i:9;i:2765;i:9;i:2893;i:9;i:3021;i:9;i:3149;i:9;i:3277;i:9;i:3405;i:9;i:3530;i:9;i:3642;i:9;i:3972;i:9;i:4153;i:9;i:5908;i:9;i:5940;i:9;i:6098;i:9;i:1456;i:10;i:1457;i:11;i:1458;i:12;i:1459;i:13;i:1460;i:14;i:1461;i:15;i:1462;i:16;i:1463;i:17;i:1464;i:18;i:1465;i:19;i:1467;i:20;i:1468;i:21;i:1469;i:22;i:1471;i:23;i:1473;i:24;i:1474;i:25;i:64286;i:26;i:1611;i:27;i:1612;i:28;i:1613;i:29;i:1614;i:30;i:1615;i:31;i:1616;i:32;i:1617;i:33;i:1618;i:34;i:1648;i:35;i:1809;i:36;i:3157;i:84;i:3158;i:91;i:3640;i:103;i:3641;i:103;i:3656;i:107;i:3657;i:107;i:3658;i:107;i:3659;i:107;i:3768;i:118;i:3769;i:118;i:3784;i:122;i:3785;i:122;i:3786;i:122;i:3787;i:122;i:3953;i:129;i:3954;i:130;i:3962;i:130;i:3963;i:130;i:3964;i:130;i:3965;i:130;i:3968;i:130;i:3956;i:132;i:801;i:202;i:802;i:202;i:807;i:202;i:808;i:202;i:795;i:216;i:3897;i:216;i:119141;i:216;i:119142;i:216;i:119150;i:216;i:119151;i:216;i:119152;i:216;i:119153;i:216;i:119154;i:216;i:12330;i:218;i:790;i:220;i:791;i:220;i:792;i:220;i:793;i:220;i:796;i:220;i:797;i:220;i:798;i:220;i:799;i:220;i:800;i:220;i:803;i:220;i:804;i:220;i:805;i:220;i:806;i:220;i:809;i:220;i:810;i:220;i:811;i:220;i:812;i:220;i:813;i:220;i:814;i:220;i:815;i:220;i:816;i:220;i:817;i:220;i:818;i:220;i:819;i:220;i:825;i:220;i:826;i:220;i:827;i:220;i:828;i:220;i:839;i:220;i:840;i:220;i:841;i:220;i:845;i:220;i:846;i:220;i:851;i:220;i:852;i:220;i:853;i:220;i:854;i:220;i:1425;i:220;i:1430;i:220;i:1435;i:220;i:1443;i:220;i:1444;i:220;i:1445;i:220;i:1446;i:220;i:1447;i:220;i:1450;i:220;i:1621;i:220;i:1622;i:220;i:1763;i:220;i:1770;i:220;i:1773;i:220;i:1841;i:220;i:1844;i:220;i:1847;i:220;i:1848;i:220;i:1849;i:220;i:1851;i:220;i:1852;i:220;i:1854;i:220;i:1858;i:220;i:1860;i:220;i:1862;i:220;i:1864;i:220;i:2386;i:220;i:3864;i:220;i:3865;i:220;i:3893;i:220;i:3895;i:220;i:4038;i:220;i:6459;i:220;i:8424;i:220;i:119163;i:220;i:119164;i:220;i:119165;i:220;i:119166;i:220;i:119167;i:220;i:119168;i:220;i:119169;i:220;i:119170;i:220;i:119178;i:220;i:119179;i:220;i:1434;i:222;i:1453;i:222;i:6441;i:222;i:12333;i:222;i:12334;i:224;i:12335;i:224;i:119149;i:226;i:1454;i:228;i:6313;i:228;i:12331;i:228;i:768;i:230;i:769;i:230;i:770;i:230;i:771;i:230;i:772;i:230;i:773;i:230;i:774;i:230;i:775;i:230;i:776;i:230;i:777;i:230;i:778;i:230;i:779;i:230;i:780;i:230;i:781;i:230;i:782;i:230;i:783;i:230;i:784;i:230;i:785;i:230;i:786;i:230;i:787;i:230;i:788;i:230;i:829;i:230;i:830;i:230;i:831;i:230;i:832;i:230;i:833;i:230;i:834;i:230;i:835;i:230;i:836;i:230;i:838;i:230;i:842;i:230;i:843;i:230;i:844;i:230;i:848;i:230;i:849;i:230;i:850;i:230;i:855;i:230;i:867;i:230;i:868;i:230;i:869;i:230;i:870;i:230;i:871;i:230;i:872;i:230;i:873;i:230;i:874;i:230;i:875;i:230;i:876;i:230;i:877;i:230;i:878;i:230;i:879;i:230;i:1155;i:230;i:1156;i:230;i:1157;i:230;i:1158;i:230;i:1426;i:230;i:1427;i:230;i:1428;i:230;i:1429;i:230;i:1431;i:230;i:1432;i:230;i:1433;i:230;i:1436;i:230;i:1437;i:230;i:1438;i:230;i:1439;i:230;i:1440;i:230;i:1441;i:230;i:1448;i:230;i:1449;i:230;i:1451;i:230;i:1452;i:230;i:1455;i:230;i:1476;i:230;i:1552;i:230;i:1553;i:230;i:1554;i:230;i:1555;i:230;i:1556;i:230;i:1557;i:230;i:1619;i:230;i:1620;i:230;i:1623;i:230;i:1624;i:230;i:1750;i:230;i:1751;i:230;i:1752;i:230;i:1753;i:230;i:1754;i:230;i:1755;i:230;i:1756;i:230;i:1759;i:230;i:1760;i:230;i:1761;i:230;i:1762;i:230;i:1764;i:230;i:1767;i:230;i:1768;i:230;i:1771;i:230;i:1772;i:230;i:1840;i:230;i:1842;i:230;i:1843;i:230;i:1845;i:230;i:1846;i:230;i:1850;i:230;i:1853;i:230;i:1855;i:230;i:1856;i:230;i:1857;i:230;i:1859;i:230;i:1861;i:230;i:1863;i:230;i:1865;i:230;i:1866;i:230;i:2385;i:230;i:2387;i:230;i:2388;i:230;i:3970;i:230;i:3971;i:230;i:3974;i:230;i:3975;i:230;i:5901;i:230;i:6458;i:230;i:8400;i:230;i:8401;i:230;i:8404;i:230;i:8405;i:230;i:8406;i:230;i:8407;i:230;i:8411;i:230;i:8412;i:230;i:8417;i:230;i:8423;i:230;i:8425;i:230;i:65056;i:230;i:65057;i:230;i:65058;i:230;i:65059;i:230;i:119173;i:230;i:119174;i:230;i:119175;i:230;i:119177;i:230;i:119176;i:230;i:119210;i:230;i:119211;i:230;i:119212;i:230;i:119213;i:230;i:789;i:232;i:794;i:232;i:12332;i:232;i:863;i:233;i:866;i:233;i:861;i:234;i:862;i:234;i:864;i:234;i:865;i:234;i:837;i:240;}}
\ No newline at end of file
diff -ruN 0.761/includes/classes/safehtml/HTMLSax3/Decorators.php 0.762/includes/classes/safehtml/HTMLSax3/Decorators.php
--- 0.761/includes/classes/safehtml/HTMLSax3/Decorators.php	1969-12-31 18:00:00.000000000 -0600
+++ 0.762/includes/classes/safehtml/HTMLSax3/Decorators.php	2006-01-21 15:02:11.000000000 -0600
@@ -0,0 +1,363 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4: */
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/3_0.txt.                                  |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Alexander Zhukov <alex@veresk.ru> Original port from Python |
+// | Authors: Harry Fuecks <hfuecks@phppatterns.com> Port to PEAR + more  |
+// | Authors: Many @ Sitepointforums Advanced PHP Forums                  |
+// +----------------------------------------------------------------------+
+//
+// $Id: Decorators.php,v 1.1 2006/01/21 21:02:11 larsneo Exp $
+//
+/**
+* Decorators for dealing with parser options
+* @package XML_HTMLSax3
+* @version $Id: Decorators.php,v 1.1 2006/01/21 21:02:11 larsneo Exp $
+* @see XML_HTMLSax3::set_option
+*/
+/**
+* Trims the contents of element data from whitespace at start and end
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_Trim {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original handler method
+    * @var string
+    * @access private
+    */
+    var $orig_method;
+    /**
+    * Constructs XML_HTMLSax3_Trim
+    * @param object handler object being decorated
+    * @param string original handler method
+    * @access protected
+    */
+    function XML_HTMLSax3_Trim(&$orig_obj, $orig_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_method = $orig_method;
+    }
+    /**
+    * Trims the data
+    * @param XML_HTMLSax3
+    * @param string element data
+    * @access protected
+    */
+    function trimData(&$parser, $data) {
+        $data = trim($data);
+        if ($data != '') {
+            $this->orig_obj->{$this->orig_method}($parser, $data);
+        }
+    }
+}
+/**
+* Coverts tag names to upper case
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_CaseFolding {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original open handler method
+    * @var string
+    * @access private
+    */
+    var $orig_open_method;
+    /**
+    * Original close handler method
+    * @var string
+    * @access private
+    */
+    var $orig_close_method;
+    /**
+    * Constructs XML_HTMLSax3_CaseFolding
+    * @param object handler object being decorated
+    * @param string original open handler method
+    * @param string original close handler method
+    * @access protected
+    */
+    function XML_HTMLSax3_CaseFolding(&$orig_obj, $orig_open_method, $orig_close_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_open_method = $orig_open_method;
+        $this->orig_close_method = $orig_close_method;
+    }
+    /**
+    * Folds up open tag callbacks
+    * @param XML_HTMLSax3
+    * @param string tag name
+    * @param array tag attributes
+    * @access protected
+    */
+    function foldOpen(&$parser, $tag, $attrs=array(), $empty = FALSE) {
+        $this->orig_obj->{$this->orig_open_method}($parser, strtoupper($tag), $attrs, $empty);
+    }
+    /**
+    * Folds up close tag callbacks
+    * @param XML_HTMLSax3
+    * @param string tag name
+    * @access protected
+    */
+    function foldClose(&$parser, $tag, $empty = FALSE) {
+        $this->orig_obj->{$this->orig_close_method}($parser, strtoupper($tag), $empty);
+    }
+}
+/**
+* Breaks up data by linefeed characters, resulting in additional
+* calls to the data handler
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_Linefeed {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original handler method
+    * @var string
+    * @access private
+    */
+    var $orig_method;
+    /**
+    * Constructs XML_HTMLSax3_LineFeed
+    * @param object handler object being decorated
+    * @param string original handler method
+    * @access protected
+    */
+    function XML_HTMLSax3_LineFeed(&$orig_obj, $orig_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_method = $orig_method;
+    }
+    /**
+    * Breaks the data up by linefeeds
+    * @param XML_HTMLSax3
+    * @param string element data
+    * @access protected
+    */
+    function breakData(&$parser, $data) {
+        $data = explode("\n",$data);
+        foreach ( $data as $chunk ) {
+            $this->orig_obj->{$this->orig_method}($parser, $chunk);
+        }
+    }
+}
+/**
+* Breaks up data by tab characters, resulting in additional
+* calls to the data handler
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_Tab {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original handler method
+    * @var string
+    * @access private
+    */
+    var $orig_method;
+    /**
+    * Constructs XML_HTMLSax3_Tab
+    * @param object handler object being decorated
+    * @param string original handler method
+    * @access protected
+    */
+    function XML_HTMLSax3_Tab(&$orig_obj, $orig_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_method = $orig_method;
+    }
+    /**
+    * Breaks the data up by linefeeds
+    * @param XML_HTMLSax3
+    * @param string element data
+    * @access protected
+    */
+    function breakData(&$parser, $data) {
+        $data = explode("\t",$data);
+        foreach ( $data as $chunk ) {
+            $this->orig_obj->{$this->orig_method}($this, $chunk);
+        }
+    }
+}
+/**
+* Breaks up data by XML entities and parses them with html_entity_decode(),
+* resulting in additional calls to the data handler<br />
+* Requires PHP 4.3.0+
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_Entities_Parsed {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original handler method
+    * @var string
+    * @access private
+    */
+    var $orig_method;
+    /**
+    * Constructs XML_HTMLSax3_Entities_Parsed
+    * @param object handler object being decorated
+    * @param string original handler method
+    * @access protected
+    */
+    function XML_HTMLSax3_Entities_Parsed(&$orig_obj, $orig_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_method = $orig_method;
+    }
+    /**
+    * Breaks the data up by XML entities
+    * @param XML_HTMLSax3
+    * @param string element data
+    * @access protected
+    */
+    function breakData(&$parser, $data) {
+        $data = preg_split('/(&.+?;)/',$data,-1,PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
+        foreach ( $data as $chunk ) {
+            $chunk = html_entity_decode($chunk,ENT_NOQUOTES);
+            $this->orig_obj->{$this->orig_method}($this, $chunk);
+        }
+    }
+}
+/**
+* Compatibility with older PHP versions
+*/
+if (version_compare(phpversion(), '4.3', '<') && !function_exists('html_entity_decode') ) {
+    function html_entity_decode($str, $style=ENT_NOQUOTES) {
+        return strtr($str,
+            array_flip(get_html_translation_table(HTML_ENTITIES,$style)));
+    }
+}
+/**
+* Breaks up data by XML entities but leaves them unparsed,
+* resulting in additional calls to the data handler<br />
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_Entities_Unparsed {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original handler method
+    * @var string
+    * @access private
+    */
+    var $orig_method;
+    /**
+    * Constructs XML_HTMLSax3_Entities_Unparsed
+    * @param object handler object being decorated
+    * @param string original handler method
+    * @access protected
+    */
+    function XML_HTMLSax3_Entities_Unparsed(&$orig_obj, $orig_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_method = $orig_method;
+    }
+    /**
+    * Breaks the data up by XML entities
+    * @param XML_HTMLSax3
+    * @param string element data
+    * @access protected
+    */
+    function breakData(&$parser, $data) {
+        $data = preg_split('/(&.+?;)/',$data,-1,PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
+        foreach ( $data as $chunk ) {
+            $this->orig_obj->{$this->orig_method}($this, $chunk);
+        }
+    }
+}
+
+/**
+* Strips the HTML comment markers or CDATA sections from an escape.
+* If XML_OPTIONS_FULL_ESCAPES is on, this decorator is not used.<br />
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_Escape_Stripper {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original handler method
+    * @var string
+    * @access private
+    */
+    var $orig_method;
+    /**
+    * Constructs XML_HTMLSax3_Entities_Unparsed
+    * @param object handler object being decorated
+    * @param string original handler method
+    * @access protected
+    */
+    function XML_HTMLSax3_Escape_Stripper(&$orig_obj, $orig_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_method = $orig_method;
+    }
+    /**
+    * Breaks the data up by XML entities
+    * @param XML_HTMLSax3
+    * @param string element data
+    * @access protected
+    */
+    function strip(&$parser, $data) {
+        // Check for HTML comments first
+        if ( substr($data,0,2) == '--' ) {
+            $patterns = array(
+                '/^\-\-/',          // Opening comment: --
+                '/\-\-$/',          // Closing comment: --
+            );
+            $data = preg_replace($patterns,'',$data);
+
+        // Check for XML CDATA sections (note: don't do both!)
+        } else if ( substr($data,0,1) == '[' ) {
+            $patterns = array(
+                '/^\[.*CDATA.*\[/s', // Opening CDATA
+                '/\].*\]$/s',       // Closing CDATA
+                );
+            $data = preg_replace($patterns,'',$data);
+        }
+
+        $this->orig_obj->{$this->orig_method}($this, $data);
+    }
+}
+?>
\ No newline at end of file
diff -ruN 0.761/includes/classes/safehtml/HTMLSax3/States.php 0.762/includes/classes/safehtml/HTMLSax3/States.php
--- 0.761/includes/classes/safehtml/HTMLSax3/States.php	1969-12-31 18:00:00.000000000 -0600
+++ 0.762/includes/classes/safehtml/HTMLSax3/States.php	2006-01-21 15:02:11.000000000 -0600
@@ -0,0 +1,287 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4: */
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/3_0.txt.                                  |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Alexander Zhukov <alex@veresk.ru> Original port from Python |
+// | Authors: Harry Fuecks <hfuecks@phppatterns.com> Port to PEAR + more  |
+// | Authors: Many @ Sitepointforums Advanced PHP Forums                  |
+// +----------------------------------------------------------------------+
+//
+// $Id: States.php,v 1.1 2006/01/21 21:02:11 larsneo Exp $
+//
+/**
+* Parsing states.
+* @package XML_HTMLSax3
+* @version $Id: States.php,v 1.1 2006/01/21 21:02:11 larsneo Exp $
+*/
+/**
+* Define parser states
+*/
+define('XML_HTMLSAX3_STATE_STOP', 0);
+define('XML_HTMLSAX3_STATE_START', 1);
+define('XML_HTMLSAX3_STATE_TAG', 2);
+define('XML_HTMLSAX3_STATE_OPENING_TAG', 3);
+define('XML_HTMLSAX3_STATE_CLOSING_TAG', 4);
+define('XML_HTMLSAX3_STATE_ESCAPE', 6);
+define('XML_HTMLSAX3_STATE_JASP', 7);
+define('XML_HTMLSAX3_STATE_PI', 8);
+/**
+* StartingState searches for the start of any XML tag
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_StartingState  {
+    /**
+    * @param XML_HTMLSax3_StateParser subclass
+    * @return constant XML_HTMLSAX3_STATE_TAG
+    * @access protected
+    */
+    function parse(&$context) {
+        $data = $context->scanUntilString('<');
+        if ($data != '') {
+            $context->handler_object_data->
+                {$context->handler_method_data}($context->htmlsax, $data);
+        }
+        $context->IgnoreCharacter();
+        return XML_HTMLSAX3_STATE_TAG;
+    }
+}
+/**
+* Decides which state to move one from after StartingState
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_TagState {
+    /**
+    * @param XML_HTMLSax3_StateParser subclass
+    * @return constant the next state to move into
+    * @access protected
+    */
+    function parse(&$context) {
+        switch($context->ScanCharacter()) {
+        case '/':
+            return XML_HTMLSAX3_STATE_CLOSING_TAG;
+            break;
+        case '?':
+            return XML_HTMLSAX3_STATE_PI;
+            break;
+        case '%':
+            return XML_HTMLSAX3_STATE_JASP;
+            break;
+        case '!':
+            return XML_HTMLSAX3_STATE_ESCAPE;
+            break;
+        default:
+            $context->unscanCharacter();
+            return XML_HTMLSAX3_STATE_OPENING_TAG;
+        }
+    }
+}
+/**
+* Dealing with closing XML tags
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_ClosingTagState {
+    /**
+    * @param XML_HTMLSax3_StateParser subclass
+    * @return constant XML_HTMLSAX3_STATE_START
+    * @access protected
+    */
+    function parse(&$context) {
+        $tag = $context->scanUntilCharacters('/>');
+        if ($tag != '') {
+            $char = $context->scanCharacter();
+            if ($char == '/') {
+                $char = $context->scanCharacter();
+                if ($char != '>') {
+                    $context->unscanCharacter();
+                }
+            }
+            $context->handler_object_element->
+                {$context->handler_method_closing}($context->htmlsax, $tag, FALSE);
+        }
+        return XML_HTMLSAX3_STATE_START;
+    }
+}
+/**
+* Dealing with opening XML tags
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_OpeningTagState {
+    /**
+    * Handles attributes
+    * @param string attribute name
+    * @param string attribute value
+    * @return void
+    * @access protected
+    * @see XML_HTMLSax3_AttributeStartState
+    */
+    function parseAttributes(&$context) {
+        $Attributes = array();
+    
+        $context->ignoreWhitespace();
+        $attributename = $context->scanUntilCharacters("=/> \n\r\t");
+        while ($attributename != '') {
+            $attributevalue = NULL;
+            $context->ignoreWhitespace();
+            $char = $context->scanCharacter();
+            if ($char == '=') {
+                $context->ignoreWhitespace();
+                $char = $context->ScanCharacter();
+                if ($char == '"') {
+                    $attributevalue= $context->scanUntilString('"');
+                    $context->IgnoreCharacter();
+                } else if ($char == "'") {
+                    $attributevalue = $context->scanUntilString("'");
+                    $context->IgnoreCharacter();
+                } else {
+                    $context->unscanCharacter();
+                    $attributevalue =
+                        $context->scanUntilCharacters("> \n\r\t");
+                }
+            } else if ($char !== NULL) {
+                $attributevalue = NULL;
+                $context->unscanCharacter();
+            }
+            $Attributes[$attributename] = $attributevalue;
+            
+            $context->ignoreWhitespace();
+            $attributename = $context->scanUntilCharacters("=/> \n\r\t");
+        }
+        return $Attributes;
+    }
+
+    /**
+    * @param XML_HTMLSax3_StateParser subclass
+    * @return constant XML_HTMLSAX3_STATE_START
+    * @access protected
+    */
+    function parse(&$context) {
+        $tag = $context->scanUntilCharacters("/> \n\r\t");
+        if ($tag != '') {
+            $this->attrs = array();
+            $Attributes = $this->parseAttributes($context);
+            $char = $context->scanCharacter();
+            if ($char == '/') {
+                $char = $context->scanCharacter();
+                if ($char != '>') {
+                    $context->unscanCharacter();
+                }
+                $context->handler_object_element->
+                    {$context->handler_method_opening}($context->htmlsax, $tag, 
+                    $Attributes, TRUE);
+                $context->handler_object_element->
+                    {$context->handler_method_closing}($context->htmlsax, $tag, 
+                    TRUE);
+            } else {
+                $context->handler_object_element->
+                    {$context->handler_method_opening}($context->htmlsax, $tag, 
+                    $Attributes, FALSE);
+            }
+        }
+        return XML_HTMLSAX3_STATE_START;
+    }
+}
+
+/**
+* Deals with XML escapes handling comments and CDATA correctly
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_EscapeState {
+    /**
+    * @param XML_HTMLSax3_StateParser subclass
+    * @return constant XML_HTMLSAX3_STATE_START
+    * @access protected
+    */
+    function parse(&$context) {
+        $char = $context->ScanCharacter();
+        if ($char == '-') {
+            $char = $context->ScanCharacter();
+            if ($char == '-') {
+                $context->unscanCharacter();
+                $context->unscanCharacter();
+                $text = $context->scanUntilString('-->');
+                $text .= $context->scanCharacter();
+                $text .= $context->scanCharacter();
+            } else {
+                $context->unscanCharacter();
+                $text = $context->scanUntilString('>');
+            }
+        } else if ( $char == '[') {
+            $context->unscanCharacter();
+            $text = $context->scanUntilString(']>');
+            $text.= $context->scanCharacter();
+        } else {
+            $context->unscanCharacter();
+            $text = $context->scanUntilString('>');
+        }
+
+        $context->IgnoreCharacter();
+        if ($text != '') {
+            $context->handler_object_escape->
+            {$context->handler_method_escape}($context->htmlsax, $text);
+        }
+        return XML_HTMLSAX3_STATE_START;
+    }
+}
+/**
+* Deals with JASP/ASP markup
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_JaspState {
+    /**
+    * @param XML_HTMLSax3_StateParser subclass
+    * @return constant XML_HTMLSAX3_STATE_START
+    * @access protected
+    */
+    function parse(&$context) {
+        $text = $context->scanUntilString('%>');
+        if ($text != '') {
+            $context->handler_object_jasp->
+                {$context->handler_method_jasp}($context->htmlsax, $text);
+        }
+        $context->IgnoreCharacter();
+        $context->IgnoreCharacter();
+        return XML_HTMLSAX3_STATE_START;
+    }
+}
+/**
+* Deals with XML processing instructions
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_PiState {
+    /**
+    * @param XML_HTMLSax3_StateParser subclass
+    * @return constant XML_HTMLSAX3_STATE_START
+    * @access protected
+    */
+    function parse(&$context) {
+        $target = $context->scanUntilCharacters(" \n\r\t");
+        $data = $context->scanUntilString('?>');
+        if ($data != '') {
+            $context->handler_object_pi->
+            {$context->handler_method_pi}($context->htmlsax, $target, $data);
+        }
+        $context->IgnoreCharacter();
+        $context->IgnoreCharacter();
+        return XML_HTMLSAX3_STATE_START;
+    }
+}
+?>
\ No newline at end of file
diff -ruN 0.761/includes/classes/safehtml/HTMLSax3.php 0.762/includes/classes/safehtml/HTMLSax3.php
--- 0.761/includes/classes/safehtml/HTMLSax3.php	1969-12-31 18:00:00.000000000 -0600
+++ 0.762/includes/classes/safehtml/HTMLSax3.php	2006-01-21 15:02:10.000000000 -0600
@@ -0,0 +1,687 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4: */
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/3_0.txt.                                  |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Alexander Zhukov <alex@veresk.ru> Original port from Python |
+// | Authors: Harry Fuecks <hfuecks@phppatterns.com> Port to PEAR + more  |
+// | Authors: Many @ Sitepointforums Advanced PHP Forums                  |
+// +----------------------------------------------------------------------+
+//
+// $Id: HTMLSax3.php,v 1.1 2006/01/21 21:02:10 larsneo Exp $
+//
+/**
+* Main parser components
+* @package XML_HTMLSax3
+* @version $Id: HTMLSax3.php,v 1.1 2006/01/21 21:02:10 larsneo Exp $
+*/
+/**
+* Required classes
+*/
+if (!defined('XML_HTMLSAX3')) {
+    define('XML_HTMLSAX3', 'XML/');
+}
+require_once(XML_HTMLSAX3 . 'HTMLSax3/States.php');
+require_once(XML_HTMLSAX3 . 'HTMLSax3/Decorators.php');
+
+/**
+* Base State Parser
+* @package XML_HTMLSax3
+* @access protected
+* @abstract
+*/
+class XML_HTMLSax3_StateParser {
+    /**
+    * Instance of user front end class to be passed to callbacks
+    * @var XML_HTMLSax3
+    * @access private
+    */
+    var $htmlsax;
+    /**
+    * User defined object for handling elements
+    * @var object
+    * @access private
+    */
+    var $handler_object_element;
+    /**
+    * User defined open tag handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_opening;
+    /**
+    * User defined close tag handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_closing;
+    /**
+    * User defined object for handling data in elements
+    * @var object
+    * @access private
+    */
+    var $handler_object_data;
+    /**
+    * User defined data handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_data;
+    /**
+    * User defined object for handling processing instructions
+    * @var object
+    * @access private
+    */
+    var $handler_object_pi;
+    /**
+    * User defined processing instruction handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_pi;
+    /**
+    * User defined object for handling JSP/ASP tags
+    * @var object
+    * @access private
+    */
+    var $handler_object_jasp;
+    /**
+    * User defined JSP/ASP handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_jasp;
+    /**
+    * User defined object for handling XML escapes
+    * @var object
+    * @access private
+    */
+    var $handler_object_escape;
+    /**
+    * User defined XML escape handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_escape;
+    /**
+    * User defined handler object or NullHandler
+    * @var object
+    * @access private
+    */
+    var $handler_default;
+    /**
+    * Parser options determining parsing behavior
+    * @var array
+    * @access private
+    */
+    var $parser_options = array();
+    /**
+    * XML document being parsed
+    * @var string
+    * @access private
+    */
+    var $rawtext;
+    /**
+    * Position in XML document relative to start (0)
+    * @var int
+    * @access private
+    */
+    var $position;
+    /**
+    * Length of the XML document in characters
+    * @var int
+    * @access private
+    */
+    var $length;
+    /**
+    * Array of state objects
+    * @var array
+    * @access private
+    */
+    var $State = array();
+
+    /**
+    * Constructs XML_HTMLSax3_StateParser setting up states
+    * @var XML_HTMLSax3 instance of user front end class
+    * @access protected
+    */
+    function XML_HTMLSax3_StateParser (& $htmlsax) {
+        $this->htmlsax = & $htmlsax;
+        $this->State[XML_HTMLSAX3_STATE_START] =& new XML_HTMLSax3_StartingState();
+
+        $this->State[XML_HTMLSAX3_STATE_CLOSING_TAG] =& new XML_HTMLSax3_ClosingTagState();
+        $this->State[XML_HTMLSAX3_STATE_TAG] =& new XML_HTMLSax3_TagState();
+        $this->State[XML_HTMLSAX3_STATE_OPENING_TAG] =& new XML_HTMLSax3_OpeningTagState();
+
+        $this->State[XML_HTMLSAX3_STATE_PI] =& new XML_HTMLSax3_PiState();
+        $this->State[XML_HTMLSAX3_STATE_JASP] =& new XML_HTMLSax3_JaspState();
+        $this->State[XML_HTMLSAX3_STATE_ESCAPE] =& new XML_HTMLSax3_EscapeState();
+    }
+
+    /**
+    * Moves the position back one character
+    * @access protected
+    * @return void
+    */
+    function unscanCharacter() {
+        $this->position -= 1;
+    }
+
+    /**
+    * Moves the position forward one character
+    * @access protected
+    * @return void
+    */
+    function ignoreCharacter() {
+        $this->position += 1;
+    }
+
+    /**
+    * Returns the next character from the XML document or void if at end
+    * @access protected
+    * @return mixed
+    */
+    function scanCharacter() {
+        if ($this->position < $this->length) {
+            return $this->rawtext{$this->position++};
+        }
+    }
+
+    /**
+    * Returns a string from the current position to the next occurance
+    * of the supplied string
+    * @param string string to search until
+    * @access protected
+    * @return string
+    */
+    function scanUntilString($string) {
+        $start = $this->position;
+        $this->position = strpos($this->rawtext, $string, $start);
+        if ($this->position === FALSE) {
+            $this->position = $this->length;
+        }
+        return substr($this->rawtext, $start, $this->position - $start);
+    }
+
+    /**
+    * Returns a string from the current position until the first instance of
+    * one of the characters in the supplied string argument
+    * @param string string to search until
+    * @access protected
+    * @return string
+    * @abstract
+    */
+    function scanUntilCharacters($string) {}
+
+    /**
+    * Moves the position forward past any whitespace characters
+    * @access protected
+    * @return void
+    * @abstract
+    */
+    function ignoreWhitespace() {}
+
+    /**
+    * Begins the parsing operation, setting up any decorators, depending on
+    * parse options invoking _parse() to execute parsing
+    * @param string XML document to parse
+    * @access protected
+    * @return void
+    */
+    function parse($data) {
+        if ($this->parser_options['XML_OPTION_TRIM_DATA_NODES']==1) {
+            $decorator =& new XML_HTMLSax3_Trim(
+                $this->handler_object_data,
+                $this->handler_method_data);
+            $this->handler_object_data =& $decorator;
+            $this->handler_method_data = 'trimData';
+        }
+        if ($this->parser_options['XML_OPTION_CASE_FOLDING']==1) {
+            $open_decor =& new XML_HTMLSax3_CaseFolding(
+                $this->handler_object_element,
+                $this->handler_method_opening,
+                $this->handler_method_closing);
+            $this->handler_object_element =& $open_decor;
+            $this->handler_method_opening ='foldOpen';
+            $this->handler_method_closing ='foldClose';
+        }
+        if ($this->parser_options['XML_OPTION_LINEFEED_BREAK']==1) {
+            $decorator =& new XML_HTMLSax3_Linefeed(
+                $this->handler_object_data,
+                $this->handler_method_data);
+            $this->handler_object_data =& $decorator;
+            $this->handler_method_data = 'breakData';
+        }
+        if ($this->parser_options['XML_OPTION_TAB_BREAK']==1) {
+            $decorator =& new XML_HTMLSax3_Tab(
+                $this->handler_object_data,
+                $this->handler_method_data);
+            $this->handler_object_data =& $decorator;
+            $this->handler_method_data = 'breakData';
+        }
+        if ($this->parser_options['XML_OPTION_ENTITIES_UNPARSED']==1) {
+            $decorator =& new XML_HTMLSax3_Entities_Unparsed(
+                $this->handler_object_data,
+                $this->handler_method_data);
+            $this->handler_object_data =& $decorator;
+            $this->handler_method_data = 'breakData';
+        }
+        if ($this->parser_options['XML_OPTION_ENTITIES_PARSED']==1) {
+            $decorator =& new XML_HTMLSax3_Entities_Parsed(
+                $this->handler_object_data,
+                $this->handler_method_data);
+            $this->handler_object_data =& $decorator;
+            $this->handler_method_data = 'breakData';
+        }
+        // Note switched on by default
+        if ($this->parser_options['XML_OPTION_STRIP_ESCAPES']==1) {
+            $decorator =& new XML_HTMLSax3_Escape_Stripper(
+                $this->handler_object_escape,
+                $this->handler_method_escape);
+            $this->handler_object_escape =& $decorator;
+            $this->handler_method_escape = 'strip';
+        }
+        $this->rawtext = $data;
+        $this->length = strlen($data);
+        $this->position = 0;
+        $this->_parse();
+    }
+
+    /**
+    * Performs the parsing itself, delegating calls to a specific parser
+    * state
+    * @param constant state object to parse with
+    * @access protected
+    * @return void
+    */
+    function _parse($state = XML_HTMLSAX3_STATE_START) {
+        do {
+            $state = $this->State[$state]->parse($this);
+        } while ($state != XML_HTMLSAX3_STATE_STOP &&
+                    $this->position < $this->length);
+    }
+}
+
+/**
+* Parser for PHP Versions below 4.3.0. Uses a slower parsing mechanism than
+* the equivalent PHP 4.3.0+  subclass of StateParser
+* @package XML_HTMLSax3
+* @access protected
+* @see XML_HTMLSax3_StateParser_Gtet430
+*/
+class XML_HTMLSax3_StateParser_Lt430 extends XML_HTMLSax3_StateParser {
+    /**
+    * Constructs XML_HTMLSax3_StateParser_Lt430 defining available
+    * parser options
+    * @var XML_HTMLSax3 instance of user front end class
+    * @access protected
+    */
+    function XML_HTMLSax3_StateParser_Lt430(& $htmlsax) {
+        parent::XML_HTMLSax3_StateParser($htmlsax);
+        $this->parser_options['XML_OPTION_TRIM_DATA_NODES'] = 0;
+        $this->parser_options['XML_OPTION_CASE_FOLDING'] = 0;
+        $this->parser_options['XML_OPTION_LINEFEED_BREAK'] = 0;
+        $this->parser_options['XML_OPTION_TAB_BREAK'] = 0;
+        $this->parser_options['XML_OPTION_ENTITIES_PARSED'] = 0;
+        $this->parser_options['XML_OPTION_ENTITIES_UNPARSED'] = 0;
+        $this->parser_options['XML_OPTION_STRIP_ESCAPES'] = 0;
+    }
+
+    /**
+    * Returns a string from the current position until the first instance of
+    * one of the characters in the supplied string argument
+    * @param string string to search until
+    * @access protected
+    * @return string
+    */
+    function scanUntilCharacters($string) {
+        $startpos = $this->position;
+        while ($this->position < $this->length && strpos($string, $this->rawtext{$this->position}) === FALSE) {
+            $this->position++;
+        }
+        return substr($this->rawtext, $startpos, $this->position - $startpos);
+    }
+
+    /**
+    * Moves the position forward past any whitespace characters
+    * @access protected
+    * @return void
+    */
+    function ignoreWhitespace() {
+        while ($this->position < $this->length && 
+            strpos(" \n\r\t", $this->rawtext{$this->position}) !== FALSE) {
+            $this->position++;
+        }
+    }
+
+    /**
+    * Begins the parsing operation, setting up the unparsed XML entities
+    * decorator if necessary then delegating further work to parent
+    * @param string XML document to parse
+    * @access protected
+    * @return void
+    */
+    function parse($data) {
+        parent::parse($data);
+    }
+}
+
+/**
+* Parser for PHP Versions equal to or greater than 4.3.0. Uses a faster
+* parsing mechanism than the equivalent PHP < 4.3.0 subclass of StateParser
+* @package XML_HTMLSax3
+* @access protected
+* @see XML_HTMLSax3_StateParser_Lt430
+*/
+class XML_HTMLSax3_StateParser_Gtet430 extends XML_HTMLSax3_StateParser {
+    /**
+    * Constructs XML_HTMLSax3_StateParser_Gtet430 defining available
+    * parser options
+    * @var XML_HTMLSax3 instance of user front end class
+    * @access protected
+    */
+    function XML_HTMLSax3_StateParser_Gtet430(& $htmlsax) {
+        parent::XML_HTMLSax3_StateParser($htmlsax);
+        $this->parser_options['XML_OPTION_TRIM_DATA_NODES'] = 0;
+        $this->parser_options['XML_OPTION_CASE_FOLDING'] = 0;
+        $this->parser_options['XML_OPTION_LINEFEED_BREAK'] = 0;
+        $this->parser_options['XML_OPTION_TAB_BREAK'] = 0;
+        $this->parser_options['XML_OPTION_ENTITIES_PARSED'] = 0;
+        $this->parser_options['XML_OPTION_ENTITIES_UNPARSED'] = 0;
+        $this->parser_options['XML_OPTION_STRIP_ESCAPES'] = 0;
+    }
+    /**
+    * Returns a string from the current position until the first instance of
+    * one of the characters in the supplied string argument.
+    * @param string string to search until
+    * @access protected
+    * @return string
+    */
+    function scanUntilCharacters($string) {
+        $startpos = $this->position;
+        $length = strcspn($this->rawtext, $string, $startpos);
+        $this->position += $length;
+        return substr($this->rawtext, $startpos, $length);
+    }
+
+    /**
+    * Moves the position forward past any whitespace characters
+    * @access protected
+    * @return void
+    */
+    function ignoreWhitespace() {
+        $this->position += strspn($this->rawtext, " \n\r\t", $this->position);
+    }
+
+    /**
+    * Begins the parsing operation, setting up the parsed and unparsed
+    * XML entity decorators if necessary then delegating further work
+    * to parent
+    * @param string XML document to parse
+    * @access protected
+    * @return void
+    */
+    function parse($data) {
+        parent::parse($data);
+    }
+}
+
+/**
+* Default NullHandler for methods which were not set by user
+* @package XML_HTMLSax3
+* @access protected
+*/
+class XML_HTMLSax3_NullHandler {
+    /**
+    * Generic handler method which does nothing
+    * @access protected
+    * @return void
+    */
+    function DoNothing() {
+    }
+}
+
+/**
+* User interface class. All user calls should only be made to this class
+* @package XML_HTMLSax3
+* @access public
+*/
+class XML_HTMLSax3 {
+    /**
+    * Instance of concrete subclass of XML_HTMLSax3_StateParser
+    * @var XML_HTMLSax3_StateParser
+    * @access private
+    */
+    var $state_parser;
+
+    /**
+    * Constructs XML_HTMLSax3 selecting concrete StateParser subclass
+    * depending on PHP version being used as well as setting the default
+    * NullHandler for all callbacks<br />
+    * <b>Example:</b>
+    * <pre>
+    * $myHandler = & new MyHandler();
+    * $parser = new XML_HTMLSax3();
+    * $parser->set_object($myHandler);
+    * $parser->set_option('XML_OPTION_CASE_FOLDING');
+    * $parser->set_element_handler('myOpenHandler','myCloseHandler');
+    * $parser->set_data_handler('myDataHandler');
+    * $parser->parser($xml);
+    * </pre>
+    * @access public
+    */
+    function XML_HTMLSax3() {
+        if (version_compare(phpversion(), '4.3', 'ge')) {
+            $this->state_parser =& new XML_HTMLSax3_StateParser_Gtet430($this);
+        } else {
+            $this->state_parser =& new XML_HTMLSax3_StateParser_Lt430($this);
+        }
+        $nullhandler =& new XML_HTMLSax3_NullHandler();
+        $this->set_object($nullhandler);
+        $this->set_element_handler('DoNothing', 'DoNothing');
+        $this->set_data_handler('DoNothing');
+        $this->set_pi_handler('DoNothing');
+        $this->set_jasp_handler('DoNothing');
+        $this->set_escape_handler('DoNothing');
+    }
+
+    /**
+    * Sets the user defined handler object. Returns a PEAR Error
+    * if supplied argument is not an object.
+    * @param object handler object containing SAX callback methods
+    * @access public
+    * @return mixed
+    */
+    function set_object(&$object) {
+        if ( is_object($object) ) {
+            $this->state_parser->handler_default =& $object;
+            return true;
+        } else {
+            require_once('PEAR.php');
+            PEAR::raiseError('XML_HTMLSax3::set_object requires '.
+                'an object instance');
+        }
+    }
+
+    /**
+    * Sets a parser option. By default all options are switched off.
+    * Returns a PEAR Error if option is invalid<br />
+    * <b>Available options:</b>
+    * <ul>
+    * <li>XML_OPTION_TRIM_DATA_NODES: trim whitespace off the beginning
+    * and end of data passed to the data handler</li>
+    * <li>XML_OPTION_LINEFEED_BREAK: linefeeds result in additional data
+    * handler calls</li>
+    * <li>XML_OPTION_TAB_BREAK: tabs result in additional data handler
+    * calls</li>
+    * <li>XML_OPTION_ENTITIES_UNPARSED: XML entities are returned as
+    * seperate data handler calls in unparsed form</li>
+    * <li>XML_OPTION_ENTITIES_PARSED: (PHP 4.3.0+ only) XML entities are
+    * returned as seperate data handler calls and are parsed with 
+    * PHP's html_entity_decode() function</li>
+    * <li>XML_OPTION_STRIP_ESCAPES: strips out the -- -- comment markers
+    * or CDATA markup inside an XML escape, if found.</li>
+    * </ul>
+    * To get HTMLSax to behave in the same way as the native PHP SAX parser,
+    * using it's default state, you need to switch on XML_OPTION_LINEFEED_BREAK,
+    * XML_OPTION_ENTITIES_PARSED and XML_OPTION_CASE_FOLDING
+    * @param string name of parser option
+    * @param int (optional) 1 to switch on, 0 for off
+    * @access public
+    * @return boolean
+    */
+    function set_option($name, $value=1) {
+        if ( array_key_exists($name,$this->state_parser->parser_options) ) {
+            $this->state_parser->parser_options[$name] = $value;
+            return true;
+        } else {
+            require_once('PEAR.php');
+            PEAR::raiseError('XML_HTMLSax3::set_option('.$name.') illegal');
+        }
+    }
+
+    /**
+    * Sets the data handler method which deals with the contents of XML
+    * elements.<br />
+    * The handler method must accept two arguments, the first being an
+    * instance of XML_HTMLSax3 and the second being the contents of an
+    * XML element e.g.
+    * <pre>
+    * function myDataHander(& $parser,$data){}
+    * </pre>
+    * @param string name of method
+    * @access public
+    * @return void
+    * @see set_object
+    */
+    function set_data_handler($data_method) {
+        $this->state_parser->handler_object_data =& $this->state_parser->handler_default;
+        $this->state_parser->handler_method_data = $data_method;
+    }
+
+    /**
+    * Sets the open and close tag handlers
+    * <br />The open handler method must accept three arguments; the parser,
+    * the tag name and an array of attributes e.g.
+    * <pre>
+    * function myOpenHander(& $parser,$tagname,$attrs=array()){}
+    * </pre>
+    * The close handler method must accept two arguments; the parser and
+    * the tag name e.g.
+    * <pre>
+    * function myCloseHander(& $parser,$tagname){}
+    * </pre>
+    * @param string name of open method
+    * @param string name of close method
+    * @access public
+    * @return void
+    * @see set_object
+    */
+    function set_element_handler($opening_method, $closing_method) {
+        $this->state_parser->handler_object_element =& $this->state_parser->handler_default;
+        $this->state_parser->handler_method_opening = $opening_method;
+        $this->state_parser->handler_method_closing = $closing_method;
+    }
+
+    /**
+    * Sets the processing instruction handler method e.g. for PHP open
+    * and close tags<br />
+    * The handler method must accept three arguments; the parser, the
+    * PI target and data inside the PI
+    * <pre>
+    * function myPIHander(& $parser,$target, $data){}
+    * </pre>
+    * @param string name of method
+    * @access public
+    * @return void
+    * @see set_object
+    */
+    function set_pi_handler($pi_method) {
+        $this->state_parser->handler_object_pi =& $this->state_parser->handler_default;
+        $this->state_parser->handler_method_pi = $pi_method;
+    }
+
+    /**
+    * Sets the XML escape handler method e.g. for comments and doctype
+    * declarations<br />
+    * The handler method must accept two arguments; the parser and the
+    * contents of the escaped section
+    * <pre>
+    * function myEscapeHander(& $parser, $data){}
+    * </pre>
+    * @param string name of method
+    * @access public
+    * @return void
+    * @see set_object
+    */
+    function set_escape_handler($escape_method) {
+        $this->state_parser->handler_object_escape =& $this->state_parser->handler_default;
+        $this->state_parser->handler_method_escape = $escape_method;
+    }
+
+    /**
+    * Sets the JSP/ASP markup handler<br />
+    * The handler method must accept two arguments; the parser and
+    * body of the JASP tag
+    * <pre>
+    * function myJaspHander(& $parser, $data){}
+    * </pre>
+    * @param string name of method
+    * @access public
+    * @return void
+    * @see set_object
+    */
+    function set_jasp_handler ($jasp_method) {
+        $this->state_parser->handler_object_jasp =& $this->state_parser->handler_default;
+        $this->state_parser->handler_method_jasp = $jasp_method;
+    }
+
+    /**
+    * Returns the current string position of the "cursor" inside the XML
+    * document
+    * <br />Intended for use from within a user defined handler called
+    * via the $parser reference e.g.
+    * <pre>
+    * function myDataHandler(& $parser,$data) {
+    *     echo( 'Current position: '.$parser->get_current_position() );
+    * }
+    * </pre>
+    * @access public
+    * @return int
+    * @see get_length
+    */
+    function get_current_position() {
+        return $this->state_parser->position;
+    }
+
+    /**
+    * Returns the string length of the XML document being parsed
+    * @access public
+    * @return int
+    */
+    function get_length() {
+        return $this->state_parser->length;
+    }
+
+    /**
+    * Start parsing some XML
+    * @param string XML document
+    * @access public
+    * @return void
+    */
+    function parse($data) {
+        $this->state_parser->parse($data);
+    }
+}
+?>
\ No newline at end of file
diff -ruN 0.761/includes/classes/safehtml/safehtml.php 0.762/includes/classes/safehtml/safehtml.php
--- 0.761/includes/classes/safehtml/safehtml.php	1969-12-31 18:00:00.000000000 -0600
+++ 0.762/includes/classes/safehtml/safehtml.php	2006-01-21 15:02:10.000000000 -0600
@@ -0,0 +1,670 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * SafeHTML Parser
+ *
+ * PHP versions 4 and 5
+ *
+ * @category   HTML
+ * @package    SafeHTML
+ * @author     Roman Ivanov <thingol@mail.ru>
+ * @copyright  2004-2005 Roman Ivanov
+ * @license    http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
+ * @version    1.3.7
+ * @link       http://pixel-apes.com/safehtml/
+ */
+
+
+/**
+ * This package requires HTMLSax3 package
+ */
+require_once(XML_HTMLSAX3 . 'HTMLSax3.php');
+
+ 
+/**
+ *
+ * SafeHTML Parser
+ *
+ * This parser strips down all potentially dangerous content within HTML:
+ * <ul>
+ * <li>opening tag without its closing tag</li>
+ * <li>closing tag without its opening tag</li>
+ * <li>any of these tags: "base", "basefont", "head", "html", "body", "applet", 
+ * "object", "iframe", "frame", "frameset", "script", "layer", "ilayer", "embed", 
+ * "bgsound", "link", "meta", "style", "title", "blink", "xml" etc.</li>
+ * <li>any of these attributes: on*, data*, dynsrc</li>
+ * <li>javascript:/vbscript:/about: etc. protocols</li>
+ * <li>expression/behavior etc. in styles</li>
+ * <li>any other active content</li>
+ * </ul>
+ * It also tries to convert code to XHTML valid, but htmltidy is far better 
+ * solution for this task.
+ *
+ * <b>Example:</b>
+ * <pre>
+ * $parser =& new SafeHTML();
+ * $result = $parser->parse($doc);
+ * </pre>
+ *
+ * @category   HTML
+ * @package    SafeHTML
+ * @author     Roman Ivanov <thingol@mail.ru>
+ * @copyright  1997-2005 Roman Ivanov
+ * @license    http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/SafeHTML
+ */
+class SafeHTML 
+{
+    /**
+     * Storage for resulting HTML output
+     *
+     * @var string
+     * @access private
+     */
+    var $_xhtml = '';
+    
+    /**
+     * Array of counters for each tag
+     *
+     * @var array
+     * @access private
+     */
+    var $_counter = array();
+    
+    /**
+     * Stack of unclosed tags
+     *
+     * @var array
+     * @access private
+     */
+    var $_stack = array();
+    
+    /**
+     * Array of counters for tags that must be deleted with all content
+     *
+     * @var array
+     * @access private
+     */
+    var $_dcCounter = array();
+    
+    /**
+     * Stack of unclosed tags that must be deleted with all content
+     *
+     * @var array
+     * @access private
+     */
+    var $_dcStack = array();
+    
+    /**
+     * Stores level of list (ol/ul) nesting
+     *
+     * @var int
+     * @access private
+     */
+    var $_listScope = 0; 
+    
+    /**
+     * Stack of unclosed list tags 
+     *
+     * @var array
+     * @access private
+     */
+    var $_liStack = array();
+
+    /**
+     * Array of prepared regular expressions for protocols (schemas) matching
+     *
+     * @var array
+     * @access private
+     */
+    var $_protoRegexps = array();
+    
+    /**
+     * Array of prepared regular expressions for CSS matching
+     *
+     * @var array
+     * @access private
+     */
+    var $_cssRegexps = array();
+
+    /**
+     * List of single tags ("<tag />")
+     *
+     * @var array
+     * @access public
+     */
+    var $singleTags = array('area', 'br', 'img', 'input', 'hr', 'wbr', );
+
+    /**
+     * List of dangerous tags (such tags will be deleted)
+     *
+     * @var array
+     * @access public
+     */
+    var $deleteTags = array(
+        'applet', 'base',   'basefont', 'bgsound', 'blink',  'body', 
+        'embed',  'frame',  'frameset', 'head',    'html',   'ilayer', 
+        'iframe', 'layer',  'link',     'meta',    'object', 'style', 
+        'title',  'script', 
+        );
+
+    /**
+     * List of dangerous tags (such tags will be deleted, and all content 
+     * inside this tags will be also removed)
+     *
+     * @var array
+     * @access public
+     */
+    var $deleteTagsContent = array('script', 'style', 'title', 'xml', );
+
+    /**
+     * Type of protocols filtering ('white' or 'black')
+     *
+     * @var string
+     * @access public
+     */
+    var $protocolFiltering = 'white';
+
+    /**
+     * List of "dangerous" protocols (used for blacklist-filtering)
+     *
+     * @var array
+     * @access public
+     */
+    var $blackProtocols = array(
+        'about',   'chrome',     'data',       'disk',     'hcp',     
+        'help',    'javascript', 'livescript', 'lynxcgi',  'lynxexec', 
+        'ms-help', 'ms-its',     'mhtml',      'mocha',    'opera',   
+        'res',     'resource',   'shell',      'vbscript', 'view-source', 
+        'vnd.ms.radio',          'wysiwyg', 
+        );
+
+    /**
+     * List of "safe" protocols (used for whitelist-filtering)
+     *
+     * @var array
+     * @access public
+     */
+    var $whiteProtocols = array(
+        'ed2k',   'file', 'ftp',  'gopher', 'http',  'https', 
+        'irc',    'mailto', 'news', 'nntp', 'telnet', 'webcal', 
+        'xmpp',   'callto',
+        );
+
+    /**
+     * List of attributes that can contain protocols
+     *
+     * @var array
+     * @access public
+     */
+    var $protocolAttributes = array(
+        'action', 'background', 'codebase', 'dynsrc', 'href', 'lowsrc', 'src', 
+        );
+
+    /**
+     * List of dangerous CSS keywords
+     *
+     * Whole style="" attribute will be removed, if parser will find one of 
+     * these keywords
+     *
+     * @var array
+     * @access public
+     */
+    var $cssKeywords = array(
+        'absolute', 'behavior',       'behaviour',   'content', 'expression', 
+        'fixed',    'include-source', 'moz-binding',
+        );
+
+    /**
+     * List of tags that can have no "closing tag"
+     *
+     * @var array
+     * @access public
+     * @deprecated XHTML does not allow such tags
+     */
+    var $noClose = array();
+
+    /**
+     * List of block-level tags that terminates paragraph
+     *
+     * Paragraph will be closed when this tags opened
+     *
+     * @var array
+     * @access public
+     */
+    var $closeParagraph = array(
+        'address', 'blockquote', 'center', 'dd',      'dir',       'div', 
+        'dl',      'dt',         'h1',     'h2',      'h3',        'h4', 
+        'h5',      'h6',         'hr',     'isindex', 'listing',   'marquee', 
+        'menu',    'multicol',   'ol',     'p',       'plaintext', 'pre', 
+        'table',   'ul',         'xmp', 
+        );
+
+    /**
+     * List of table tags, all table tags outside a table will be removed
+     *
+     * @var array
+     * @access public
+     */
+    var $tableTags = array(
+        'caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', 
+        'thead',   'tr', 
+        );
+
+    /**
+     * List of list tags
+     *
+     * @var array
+     * @access public
+     */
+    var $listTags = array('dir', 'menu', 'ol', 'ul', 'dl', );
+
+    /**
+     * List of dangerous attributes
+     *
+     * @var array
+     * @access public
+     */
+    var $attributes = array('dynsrc', 'id', 'name', );
+
+    /**
+     * List of allowed "namespaced" attributes
+     *
+     * @var array
+     * @access public
+     */
+    var $attributesNS = array('xml:lang', );
+
+    /**
+     * Constructs class
+     *
+     * @access public
+     */
+    function SafeHTML() 
+    {
+        //making regular expressions based on Proto & CSS arrays
+        foreach ($this->blackProtocols as $proto) {
+            $preg = "/[\s\x01-\x1F]*";
+            for ($i=0; $i<strlen($proto); $i++) {
+                $preg .= $proto{$i} . "[\s\x01-\x1F]*";
+            }
+            $preg .= ":/i";
+            $this->_protoRegexps[] = $preg;
+        }
+
+        foreach ($this->cssKeywords as $css) {
+            $this->_cssRegexps[] = '/' . $css . '/i';
+        }
+        return true;
+    }
+
+    /**
+     * Handles the writing of attributes - called from $this->_openHandler()
+     *
+     * @param array $attrs array of attributes $name => $value
+     * @return boolean
+     * @access private
+     */
+    function _writeAttrs ($attrs) 
+    {
+        if (is_array($attrs)) {
+            foreach ($attrs as $name => $value) {
+
+                $name = strtolower($name);
+
+                if (strpos($name, 'on') === 0) {
+                    continue;
+                }
+                if (strpos($name, 'data') === 0) {
+                    continue;
+                }
+                if (in_array($name, $this->attributes)) {
+                    continue;
+                }
+                if (!preg_match("/^[a-z0-9]+$/i", $name)) {
+                    if (!in_array($name, $this->attributesNS))
+                    {
+                        continue;
+                    }
+                }
+
+                if (($value === TRUE) || (is_null($value))) {
+                    $value = $name;
+                }
+
+                if ($name == 'style') {
+                   
+                   // removes insignificant backslahes
+                   $value = str_replace("\\", '', $value);
+
+                   // removes CSS comments
+                   while (1)
+                   {
+                     $_value = preg_replace("!/\*.*?\*/!s", '', $value);
+                     if ($_value == $value) break;
+                     $value = $_value;
+                   }
+                   
+                   // replace all & to &amp;
+                   $value = str_replace('&amp;', '&', $value);
+                   $value = str_replace('&', '&amp;', $value);
+
+                   foreach ($this->_cssRegexps as $css) {
+                       if (preg_match($css, $value)) { 
+                           continue 2;
+                       }
+                   }
+                   foreach ($this->_protoRegexps as $proto) {
+                       if (preg_match($proto, $value)) {
+                           continue 2;
+                       }
+                   }
+                }
+
+                $tempval = preg_replace('/&#(\d+);?/me', "chr('\\1')", $value); //"'
+                $tempval = preg_replace('/&#x([0-9a-f]+);?/mei', "chr(hexdec('\\1'))", $tempval);
+
+                if ((in_array($name, $this->protocolAttributes)) && 
+                    (strpos($tempval, ':') !== false)) 
+                {
+                    if ($this->protocolFiltering == 'black') {
+                        foreach ($this->_protoRegexps as $proto) {
+                            if (preg_match($proto, $tempval)) continue 2;
+                        }
+                    } else {
+                        $_tempval = explode(':', $tempval);
+                        $proto = $_tempval[0];
+                        if (!in_array($proto, $this->whiteProtocols)) {
+                            continue;
+                        }
+                    }
+                }
+
+                $value = str_replace("\"", "&quot;", $value);
+                $this->_xhtml .= ' ' . $name . '="' . $value . '"';
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Opening tag handler - called from HTMLSax
+     *
+     * @param object $parser HTML Parser
+     * @param string $name   tag name
+     * @param array  $attrs  tag attributes
+     * @return boolean
+     * @access private
+     */
+    function _openHandler(&$parser, $name, $attrs) 
+    {
+        $name = strtolower($name);
+
+        if (in_array($name, $this->deleteTagsContent)) {
+            array_push($this->_dcStack, $name);
+            $this->_dcCounter[$name] = isset($this->_dcCounter[$name]) ? $this->_dcCounter[$name]+1 : 1;
+        }
+        if (count($this->_dcStack) != 0) {
+            return true;
+        }
+
+        if (in_array($name, $this->deleteTags)) {
+            return true;
+        }
+        
+        if (!preg_match("/^[a-z0-9]+$/i", $name)) {
+            if (preg_match("!(?:\@|://)!i", $name)) {
+                $this->_xhtml .= '&lt;' . $name . '&gt;';
+            }
+            return true;
+        }
+
+        if (in_array($name, $this->singleTags)) {
+            $this->_xhtml .= '<' . $name;
+            $this->_writeAttrs($attrs);
+            $this->_xhtml .= ' />';
+            return true;
+        }
+
+        // TABLES: cannot open table elements when we are not inside table
+        if ((isset($this->_counter['table'])) && ($this->_counter['table'] <= 0) 
+            && (in_array($name, $this->tableTags))) 
+        {
+            return true;
+        }
+
+        // PARAGRAPHS: close paragraph when closeParagraph tags opening
+        if ((in_array($name, $this->closeParagraph)) && (in_array('p', $this->_stack))) {
+            $this->_closeHandler($parser, 'p');
+        }
+
+        // LISTS: we should close <li> if <li> of the same level opening
+        if ($name == 'li' && count($this->_liStack) && 
+            $this->_listScope == $this->_liStack[count($this->_liStack)-1]) 
+        {
+            $this->_closeHandler($parser, 'li');
+        }
+
+        // LISTS: we want to know on what nesting level of lists we are
+        if (in_array($name, $this->listTags)) {
+            $this->_listScope++;
+        }
+        if ($name == 'li') {
+            array_push($this->_liStack, $this->_listScope);
+        }
+            
+        $this->_xhtml .= '<' . $name;
+        $this->_writeAttrs($attrs);
+        $this->_xhtml .= '>';
+        array_push($this->_stack,$name);
+        $this->_counter[$name] = isset($this->_counter[$name]) ? $this->_counter[$name]+1 : 1;
+        return true;
+    }
+
+    /**
+     * Closing tag handler - called from HTMLSax
+     *
+     * @param object $parsers HTML parser
+     * @param string $name    tag name
+     * @return boolean
+     * @access private
+     */
+    function _closeHandler(&$parser, $name) 
+    {
+
+        $name = strtolower($name);
+
+        if (isset($this->_dcCounter[$name]) && ($this->_dcCounter[$name] > 0) && 
+            (in_array($name, $this->deleteTagsContent))) 
+        {
+           while ($name != ($tag = array_pop($this->_dcStack))) {
+            $this->_dcCounter[$tag]--;
+           }
+
+           $this->_dcCounter[$name]--;
+        }
+
+        if (count($this->_dcStack) != 0) {
+            return true;
+        }
+
+        if ((isset($this->_counter[$name])) && ($this->_counter[$name] > 0)) {
+           while ($name != ($tag = array_pop($this->_stack))) {
+               $this->_closeTag($tag);
+           }
+
+           $this->_closeTag($name);
+        }
+        return true;
+    }
+
+    /**
+     * Closes tag 
+     *
+     * @param string $tag tag name
+     * @return boolean
+     * @access private
+     */
+    function _closeTag($tag) 
+    {
+        if (!in_array($tag, $this->noClose)) {
+            $this->_xhtml .= '</' . $tag . '>';
+        }
+
+        $this->_counter[$tag]--;
+
+        if (in_array($tag, $this->listTags)) {
+            $this->_listScope--;
+        }
+
+        if ($tag == 'li') {
+            array_pop($this->_liStack);
+        }
+        return true;
+    }
+
+    /**
+     * Character data handler - called from HTMLSax
+     *
+     * @param object $parser HTML parser
+     * @param string $data   textual data
+     * @return boolean
+     * @access private
+     */
+    function _dataHandler(&$parser, $data) 
+    {
+        if (count($this->_dcStack) == 0) {
+            $this->_xhtml .= $data;
+        }
+        return true;
+    }
+
+    /**
+     * Escape handler - called from HTMLSax
+     *
+     * @param object $parser HTML parser
+     * @param string $data   comments or other type of data
+     * @return boolean
+     * @access private
+     */
+    function _escapeHandler(&$parser, $data) 
+    {
+        return true;
+    }
+
+    /**
+     * Returns the XHTML document
+     *
+     * @return string Processed (X)HTML document
+     * @access public
+     */
+    function getXHTML () 
+    {
+        while ($tag = array_pop($this->_stack)) {
+            $this->_closeTag($tag);
+        }
+        
+        return $this->_xhtml;
+    }
+
+    /**
+     * Clears current document data
+     *
+     * @return boolean
+     * @access public
+     */
+    function clear() 
+    {
+        $this->_xhtml = '';
+        return true;
+    }
+
+    /**
+     * Main parsing fuction
+     *
+     * @param string $doc HTML document for processing
+     * @return string Processed (X)HTML document
+     * @access public
+     */
+    function parse($doc) 
+    {
+
+       // Save all '<' symbols
+       $doc = preg_replace("/<(?=[^a-zA-Z\/\!\?\%])/", '&lt;', $doc);
+
+       // Web documents shouldn't contains \x00 symbol
+       $doc = str_replace("\x00", '', $doc);
+
+       // Opera6 bug workaround
+       $doc = str_replace("\xC0\xBC", '&lt;', $doc);
+       
+       // UTF-7 encoding ASCII decode
+       $doc = $this->repackUTF7($doc);
+
+       // Instantiate the parser
+       $parser=& new XML_HTMLSax3();
+
+       // Set up the parser
+       $parser->set_object($this);
+
+       $parser->set_element_handler('_openHandler','_closeHandler');
+       $parser->set_data_handler('_dataHandler');
+       $parser->set_escape_handler('_escapeHandler');
+
+       $parser->parse($doc);
+
+       return $this->getXHTML();
+
+    }
+
+
+    /**
+     * UTF-7 decoding fuction
+     *
+     * @param string $str HTML document for recode ASCII part of UTF-7 back to ASCII
+     * @return string Decoded document
+     * @access private
+     */
+    function repackUTF7($str)
+    {
+       return preg_replace_callback('!\+([0-9a-zA-Z/]+)\-!', array($this, 'repackUTF7Callback'), $str);
+    }
+
+    /**
+     * Additional UTF-7 decoding fuction
+     *
+     * @param string $str String for recode ASCII part of UTF-7 back to ASCII
+     * @return string Recoded string
+     * @access private
+     */
+    function repackUTF7Callback($str)
+    {
+       $str = base64_decode($str[1]);
+       $str = preg_replace_callback('/^((?:\x00.)*)((?:[^\x00].)+)/', array($this, 'repackUTF7Back'), $str);
+       return preg_replace('/\x00(.)/', '$1', $str);
+    }
+
+    /**
+     * Additional UTF-7 encoding fuction
+     *
+     * @param string $str String for recode ASCII part of UTF-7 back to ASCII
+     * @return string Recoded string
+     * @access private
+     */
+    function repackUTF7Back($str)
+    {
+       return $str[1].'+'.rtrim(base64_encode($str[2]), '=').'-';
+    }
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * c-hanging-comment-ender-p: nil
+ * End:
+ */
+
+?>
diff -ruN 0.761/includes/pnAPI.php 0.762/includes/pnAPI.php
--- 0.761/includes/pnAPI.php	2005-09-26 08:36:56.000000000 -0500
+++ 0.762/includes/pnAPI.php	2006-01-27 02:56:48.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnAPI.php,v 1.136 2005/09/26 13:36:56 drak Exp $
+// $Id: pnAPI.php,v 1.145 2006/01/27 08:56:48 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -56,7 +56,7 @@
 * Core version informations - should be upgraded on each release for
 * better control on config settings
 */
-define('_PN_VERSION_NUM', '0.7.6.1');
+define('_PN_VERSION_NUM', '0.7.6.2');
 define('_PN_VERSION_ID', 'PostNuke');
 define('_PN_VERSION_SUB', 'Phoenix');
 
@@ -80,7 +80,7 @@
 	if (!isset($name)) {
 		return null;
 	}
-	
+
     if (isset($GLOBALS['pnconfig'][$name])) {
         $result = $GLOBALS['pnconfig'][$name];
     } else {
@@ -119,7 +119,7 @@
    		 // Update my vars
 		$GLOBALS['pnconfig'][$name] = $value;
  		return true;
-    } 
+    }
 	return false;
 }
 
@@ -182,7 +182,7 @@
 
     // Initialize the (ugly) additional header array
 	$GLOBALS['additional_header'] = array();
-    
+
     // load ADODB
     pnADODBInit();
 
@@ -252,11 +252,19 @@
 
     // Cross-Site Scripting attack defense - Sent by larsneo
     // some syntax checking against injected javascript
-    if (pnConfigGetVar('pnAntiCracker') == 1) {
+    if (pnConfigGetVar('pnAntiCracker') == '1') {
     	  include 'includes/pnAntiCracker.php';
         pnSecureInput();
     }
 
+    // load safehtml class for xss filtering
+    // the XML_HTMLSAX3 define is also needed inside the class so we
+    // cannot use the path directly in the include.
+    if (pnConfigGetVar('safehtml') == '1') {
+        define('XML_HTMLSAX3', 'includes/classes/safehtml/');
+        include XML_HTMLSAX3 . 'safehtml.php';
+    }
+
     // Banner system
     // TODO - move to banners module
     if (pnModAvailable('Banners')) {
@@ -526,8 +534,8 @@
 function pnStripslashes (&$value)
 {
 	if(empty($value))
-		return; 
-	
+		return;
+
     if (!is_array($value)) {
         $value = stripslashes($value);
     } else {
@@ -636,14 +644,30 @@
         }
     }
 
+    if (pnConfigGetVar('safehtml') == '1') {
+        // prepare safehtml class
+        static $safehtml;
+        if(!isset($safehtml)) {
+            $safehtml =& new SafeHTML();
+        }
+     }
     $resarray = array();
     foreach (func_get_args() as $var) {
+        if (pnConfigGetVar('safehtml') == '1') {
+            $safehtml->clear();       
+            $var = $safehtml->parse($var);
+        }
         // Preparse var to mark the HTML that we want
         if (!empty($allowedtags))
             $var = preg_replace($allowedtags, "\022\\1\024", $var);
 
-        // Prepare var
-        $var = htmlspecialchars($var);
+        if (pnConfigGetVar('safehtml') != '1') {
+            // Prepare var
+            $var = htmlspecialchars($var);
+        }
+        
+        // scramble mailadress
+        $var = preg_replace($search, $replace, $var);
 
         // Fix the HTML that we want
         $var = preg_replace_callback('/\022([^\024]*)\024/',
@@ -824,9 +848,9 @@
 
 /**
  * validate a postnuke variable
- * 
- * @access public 
- * @author Damien Bonvillain 
+ *
+ * @access public
+ * @author Damien Bonvillain
  * @author Gregor J. Rothfuss
  * @author Jrg Napp
  * @since 1.23 - 2002/02/01
@@ -840,14 +864,14 @@
     if (!isset($var) || !isset($type)) {
         return false;
     }
-    
+
     // typecasting (might be useless in this function)
     $var = (string)$var;
     $type = (string)$type;
 
     static $maxlength = array('modvar' => 64,
                               'func'   => 512,
-                              'api'    => 187, 
+                              'api'    => 187,
                               'theme'  => 200,
                               'uname'  => 25,
                               'config' => 64);
@@ -869,27 +893,27 @@
     // special cases
     if ($type == 'mod' && $var == '/PNConfig') {
         return true;
-    } 
+    }
 
-    if ($type == 'config' && ($var == 'dbtype') || 
+    if ($type == 'config' && ($var == 'dbtype') ||
                              ($var == 'dbhost') ||
-                             ($var == 'dbuname') || 
-                             ($var == 'dbpass') || 
-                             ($var == 'dbname') || 
-                             ($var == 'system') || 
-                             ($var == 'prefix') || 
+                             ($var == 'dbuname') ||
+                             ($var == 'dbpass') ||
+                             ($var == 'dbname') ||
+                             ($var == 'system') ||
+                             ($var == 'prefix') ||
                              ($var == 'encoded')) {
         // The database parameter are not allowed to change
         return false;
-    } 
-    
+    }
+
     if ($type == 'email' || $type == 'url') {
         if (pnConfigGetVar('idnnames') == 1) {
             // transfer between the encoded (Punycode) notation and the decoded (8bit) notation.
             include_once 'includes/classes/idna/idna_convert.class.php';
             $IDN = new idna_convert();
             $var = $IDN->encode($var);
-        } 
+        }
         // all characters must be 7 bit ascii
         $length = strlen($var);
         $idx = 0;
@@ -897,8 +921,8 @@
             $c = $var[$idx++];
             if (ord($c) > 127) {
                 return false;
-            } 
-        } 
+            }
+        }
     }
 
     if ($type == 'url') {
@@ -906,29 +930,36 @@
         $url_array = @parse_url($var);
         if (!empty($url_array) && empty($url_array['scheme'])) {
             return false;
-        } 
-    } 
-
-    // variable passed special checks. We now to generic checkings. 
+        }
+    }
     
+    if ($type == 'uname') {
+        // check for invalid characters
+        if ( strstr($var, chr(160)) || strstr($var, chr(173)) ) {
+            return false;
+        }
+    }	
+
+    // variable passed special checks. We now to generic checkings.
+
     // check for maximal length
     if (isset($maxlength[$type]) && strlen($var) > $maxlength[$type]) {
         return false;
-    } 
+    }
 
     // check for minimal length
     if (isset($minlength[$type]) && strlen($var) < $minlength[$type]) {
         return false;
-    } 
+    }
 
     // check for regular expression
     if (isset($regexp[$type]) && !preg_match($regexp[$type], $var)) {
         return false;
-    } 
-    
+    }
+
     // all tests for illegal entries failed, so we assume the var is ok ;-)
     return true;
-} 
+}
 
 /**
 * get status message from previous operation
@@ -1013,7 +1044,7 @@
 {
     // very basic input validation against HTTP response splitting
     $redirecturl = str_replace(array('\r', '\n', '%0d', '%0a'), '', $redirecturl);
-    
+
     // check if the headers have already been sent
     if (headers_sent()) {
         return false;
@@ -1028,15 +1059,13 @@
         // Absolute URL - simple redirect
         header("Location: $redirecturl");
         return true;
-    } else {
-        // Removing leading slashes from redirect url
-        $redirecturl = preg_replace('!^/*!', '', $redirecturl);
-        // Get base URL
-        $baseurl = pnGetBaseURL();
-        header("Location: $baseurl$redirecturl");
-		return true;
     }
-	return false;
+    // Removing leading slashes from redirect url
+    $redirecturl = preg_replace('!^/*!', '', $redirecturl);
+    // Get base URL
+    $baseurl = pnGetBaseURL();
+    header("Location: $baseurl$redirecturl");
+    return true;
 }
 
 /**
@@ -1070,10 +1099,12 @@
 		if(empty($time)) {
 			return;
 		}
-		
+
         if (pnUserLoggedIn()) {
             $time += (pnUserGetVar('timezone_offset') - pnConfigGetVar('timezone_offset')) * 3600;
-        }
+        } else {
+			$time += (12 - pnConfigGetVar('timezone_offset')) * 3600;
+		}
         return($time);
     }
 }
@@ -1097,7 +1128,7 @@
     if(empty($to) || !isset($subject)) {
     	return false;
     }
-		
+
     // set initial return value until we know we have a valid return
     $return = false;
 
diff -ruN 0.761/includes/pnBlocks.php 0.762/includes/pnBlocks.php
--- 0.761/includes/pnBlocks.php	2005-08-29 11:48:18.000000000 -0500
+++ 0.762/includes/pnBlocks.php	2005-09-28 07:37:08.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: pnBlocks.php,v 1.22 2005/08/29 16:48:18 markwest Exp $
+// File: $Id: pnBlocks.php,v 1.23 2005/09/28 12:37:08 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -133,9 +133,13 @@
         // New-style blocks
         return $displayfunc($blockinfo);
     } else {
-        // Old-style blocks
-        if (isset($blocks_modules[0][$block]['func_display'])) {
+		$modid = pnModGetIDFromName($modname);
+		if (isset($blocks_modules[0][$block]['func_display'])) {
             return $blocks_modules[0][$block]['func_display']($blockinfo);
+		// support old style blocks within modules 
+        } else if (isset($blocks_modules[$modid][$block]['func_display'])) {
+            return $blocks_modules[$modid][$block]['func_display']($blockinfo);
+            // Old-style blocks
         } else {
             if(pnSecAuthAction(0, '.*', '.*', ACCESS_ADMIN)) {
                 $blockinfo['title'] = pnVarPrepForDisplay(_UNKNOWNBLOCKTYPE) . " $block!";
diff -ruN 0.761/includes/pnLang.php 0.762/includes/pnLang.php
--- 0.761/includes/pnLang.php	2005-09-22 23:26:59.000000000 -0500
+++ 0.762/includes/pnLang.php	2005-10-05 01:49:17.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnLang.php,v 1.19 2005/09/23 04:26:59 davidnelson Exp $
+// $Id: pnLang.php,v 1.20 2005/10/05 06:49:17 davidnelson Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -581,6 +581,7 @@
 	$lang['sas'] = _LANGUAGE_SAS; // Sasak
 	$lang['sat'] = _LANGUAGE_SAT; // Santali
 	$lang['sco'] = _LANGUAGE_SCO; // Scots
+	$lang['scr'] = _LANGUAGE_SCR; // Serbo-Croatian
 	$lang['sel'] = _LANGUAGE_SEL; // Selkup
 	$lang['sem'] = _LANGUAGE_SEM; // Semitic (Other)
 	$lang['sga'] = _LANGUAGE_SGA; // Irish, Old
diff -ruN 0.761/includes/pnMod.php 0.762/includes/pnMod.php
--- 0.761/includes/pnMod.php	2005-08-22 15:02:22.000000000 -0500
+++ 0.762/includes/pnMod.php	2006-01-22 08:33:56.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnMod.php,v 1.62 2005/08/22 20:02:22 markwest Exp $
+// $Id: pnMod.php,v 1.64 2006/01/22 14:33:56 drak Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -37,10 +37,10 @@
  */
 function pnModVarExists($modname, $name)
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$modname = isset($modname) ? ((string)$modname) : '';
 	$name = isset($name) ? ((string)$name) : '';
-		
+
 	// make sure we have the necessary parameters
 	if(!pnVarValidate($modname, 'mod') || !pnVarValidate($name, 'modvar')){
 		return false;
@@ -142,14 +142,14 @@
  */
 function pnModSetVar($modname, $name, $value='')
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$modname = isset($modname) ? ((string)$modname) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($modname, 'mod') || !isset($name)) {
     	return false;
 	}
-	        
+
     global $pnmodvar;
 
     $dbconn =& pnDBGetConn(true);
@@ -191,10 +191,10 @@
  */
 function pnModDelVar($modname, $name='')
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$modname = isset($modname) ? ((string)$modname) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($modname, 'modvar')) {
 		return false;
 	}
@@ -242,14 +242,14 @@
  */
 function pnModGetIDFromName($module)
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$module = isset($module) ? ((string)$module) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($module, 'mod')) {
 		return false;
 	}
-	
+
 	if (substr($module,0,3) == 'NS-') {
 	    $module = substr($module,3);
 	}
@@ -485,10 +485,10 @@
  */
 function pnModAPILoad($modname, $type = 'user', $force = false)
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$modname = isset($modname) ? ((string)$modname) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($modname, 'mod')) {
 		return false;
 	}
@@ -544,10 +544,10 @@
  */
 function &pnModDBInfoLoad($modname, $directory = '', $force=false)
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$modname = isset($modname) ? ((string)$modname) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($modname, 'mod')) {
 		$result = false;
 		return $result;
@@ -598,16 +598,20 @@
  */
 function pnModLoad($modname, $type = 'user', $force = false)
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$modname = isset($modname) ? ((string)$modname) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($modname, 'mod')) {
 		return false;
 	}
-	
+
+	if (strtolower(substr($type, -3)) == 'api') {
+        return false;
+    }
+
 	static $loaded = array();
-    
+
     if (!empty($loaded[strtolower("$modname$type")])) {
         // Already loaded from somewhere else
         return $modname;
@@ -656,10 +660,10 @@
  */
 function pnModAPIFunc($modname, $type = 'user', $func = 'main', $args = array())
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$modname = isset($modname) ? ((string)$modname) : '';
-	
-	// validate 
+
+	// validate
     if (!pnVarValidate($modname, 'mod')) {
 		return null;
 	}
@@ -714,14 +718,14 @@
  */
 function pnModFunc($modname, $type = 'user', $func = 'main', $args = array())
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$modname = isset($modname) ? ((string)$modname) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($modname, 'mod')) {
 		return null;
 	}
-    
+
 	list ($osmodname, $ostype, $osfunc) = pnVarPrepForOS($modname, $type, $func);
 
     // Build function name and call function
@@ -770,10 +774,10 @@
  */
 function pnModURL($modname, $type = 'user', $func = 'main', $args = array(), $ssl=null)
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$modname = isset($modname) ? ((string)$modname) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($modname, 'mod')) {
 		return null;
 	}
@@ -850,10 +854,10 @@
  */
 function pnModAvailable($modname = null)
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$modname = isset($modname) ? ((string)$modname) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($modname, 'mod')) {
 		return false;
 	}
@@ -932,14 +936,14 @@
     $hooktype,
     $hookfunc)
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$hookmodule = isset($hookmodule) ? ((string)$hookmodule) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($hookmodule, 'mod')) {
 		return false;
 	}
-	
+
     // Get database info
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
@@ -990,14 +994,14 @@
     $hooktype,
     $hookfunc)
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$hookmodule = isset($hookmodule) ? ((string)$hookmodule) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($hookmodule, 'mod')) {
 		return false;
 	}
-	
+
     // Get database info
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
@@ -1038,7 +1042,7 @@
 	if (!isset($hookaction)) {
 		return null;
 	}
-	
+
 	if (isset($extrainfo['module']) &&
 	    (pnModAvailable($extrainfo['module']) || strtolower($hookobject) == 'module')) {
 		$modname = $extrainfo['module'];
@@ -1132,11 +1136,11 @@
  */
 function pnModIsHooked($tmodule, $smodule)
 {
-    // define input, all numbers and booleans to strings 
+    // define input, all numbers and booleans to strings
 	$tmodule = isset($tmodule) ? ((string)$tmodule) : '';
 	$smodule = isset($smodule) ? ((string)$smodule) : '';
-	
-	// validate 
+
+	// validate
     if (!pnVarValidate($tmodule, 'mod') || !pnVarValidate($smodule, 'mod') ) {
 		return false;
 	}
@@ -1186,10 +1190,10 @@
  */
 function pnModLangLoad($modname, $type = 'user', $api = false)
 {
-	// define input, all numbers and booleans to strings 
+	// define input, all numbers and booleans to strings
 	$modname = isset($modname) ? ((string)$modname) : '';
 
-	// validate 
+	// validate
     if (!pnVarValidate($modname, 'mod')) {
 		return false;
 	}
diff -ruN 0.761/includes/pnRender.class.php 0.762/includes/pnRender.class.php
--- 0.761/includes/pnRender.class.php	2005-07-23 10:39:54.000000000 -0500
+++ 0.762/includes/pnRender.class.php	2005-09-30 10:02:16.000000000 -0500
@@ -1,6 +1,6 @@
 <?php
 /**
- * $Id: pnRender.class.php,v 1.8 2005/07/23 15:39:54 markwest Exp $
+ * $Id: pnRender.class.php,v 1.9 2005/09/30 15:02:16 landseer Exp $
  *
  * * pnRender *
  *
@@ -479,10 +479,6 @@
      */
     function add_core_data()
     {
-        $userdata = pnUserGetVars(pnSessionGetVar('uid'));
-        if($userdata==false) {
-            return false;
-        }
         $pncore = array();
         $pncore['version_num'] = _PN_VERSION_NUM;
         $pncore['version_id'] = _PN_VERSION_ID;
@@ -503,7 +499,7 @@
         $colors['textcolor2'] = pnThemeGetVar('textcolor2');
 
         // add userdata
-        $pncore['user'] = $userdata;
+        $pncore['user'] = pnUserGetVars(pnSessionGetVar('uid'));
 
         // add modvars of current module
         $pncore[$this->module] = pnModGetVar($this->module);
diff -ruN 0.761/includes/pnUser.php 0.762/includes/pnUser.php
--- 0.761/includes/pnUser.php	2005-08-21 11:56:03.000000000 -0500
+++ 0.762/includes/pnUser.php	2006-02-07 09:04:15.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: pnUser.php,v 1.32 2005/08/21 16:56:03 markwest Exp $
+// File: $Id: pnUser.php,v 1.33 2006/02/07 15:04:15 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -62,9 +62,9 @@
 	}
 	
     if (!pnUserLoggedIn()) {
-    // get the database connection
-    $dbconn =& pnDBGetConn(true);
-    $pntable =& pnDBGetTables();
+        // get the database connection
+        $dbconn =& pnDBGetConn(true);
+        $pntable =& pnDBGetTables();
 
         // Get user information
         $userscolumn = &$pntable['users_column'];
@@ -114,11 +114,11 @@
             pnSessionSetVar('rememberme', 1);
         }
 
-    // now we've logged in the permissions previously calculated are invalid
-    $GLOBALS['authinfogathered'] = 0;
-     }
+        // now we've logged in the permissions previously calculated are invalid
+        $GLOBALS['authinfogathered'] = 0;
+    }
 
-     return true;
+    return true;
 }
 
 /**
diff -ruN 0.761/index.php 0.762/index.php
--- 0.761/index.php	2005-05-13 07:51:40.000000000 -0500
+++ 0.762/index.php	2006-01-17 13:41:14.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: index.php,v 1.41 2005/05/13 12:51:40 landseer Exp $
+// File: $Id: index.php,v 1.45 2006/01/17 19:41:14 hammerhead Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -71,9 +71,7 @@
 $modinfo = pnModGetInfo(pnModGetIDFromName($module));
 
 if ($type<>'init' && !pnModAvailable($modinfo['name'])) {
-    // itevo, mna: set an appropriate http error message
-    header("HTTP/1.0 404 Not Found");
-    // /itevo;
+    header('HTTP/1.0 404 Not Found');
     include ('header.php');
     echo 'Module <strong>' . pnVarPrepForDisplay($module) . '</strong> not available';
     include ('footer.php');
@@ -93,10 +91,18 @@
         $arguments = array();
     }
 
+    // temporary additional security check.....
+    if ($type == 'admin' && $func == 'updateconfig' && !pnSecAuthAction(0, "$modinfo[name]::", '::', ACCESS_ADMIN)) {
+        header('HTTP/1.0 403 Access Denied');
+        include ('header.php');
+        echo _MODULENOAUTH;
+        include ('footer.php');
+        exit;
+    }
+
     // we need to force the mod load if we want to call a modules interactive init
     // function because the modules is not active right now
     $force_modload = ($type=='init') ? true : false;
-    // it should be $module not $name [class007]
     if (pnModLoad($modinfo['name'], $type, $force_modload)) {
         // Run the function
         $return = pnModFunc($modinfo['name'], $type, $func, $arguments);
@@ -111,11 +117,9 @@
         include_once('header.php');
         if ($return === false) {
             // Failed to load the module
-            // itevo, mna: set an appropriate http error message
-            header("HTTP/1.0 404 Not Found");
-            // /itevo;
+            header('HTTP/1.0 404 Not Found');
             echo 'Failed to load module <strong>' . pnVarPrepForDisplay($module) .'</strong> (at function: "<strong>'. pnVarPrepForDisplay($func).'</strong>")';
-        } elseif (is_string($return) && strlen($return) > 1) {
+        } elseif (is_string($return) && strlen($return) > 0) {
             // Text
             echo $return;
         } elseif (is_array($return)) {
@@ -140,14 +144,11 @@
         $file = 'index';
     }
     define('LOADED_AS_MODULE', '1');
-    // added for the module/system seperation [class007]
     if (file_exists('modules/' . pnVarPrepForOS($modinfo['directory']) . '/' . pnVarPrepForOS($file) . '.php')) {
         include 'modules/' . pnVarPrepForOS($modinfo['directory']) . '/' . pnVarPrepForOS($file) . '.php';
     } else {
         // Failed to load the module
-        // itevo, mna: set an appropriate http error message
-        header("HTTP/1.0 404 Not Found");
-        // /itevo;
+        header('HTTP/1.0 404 Not Found');
         include ('header.php');
         echo 'Failed to load module <strong>' . pnVarPrepForDisplay($modinfo['name']) . '</strong>';
         include ('footer.php');
diff -ruN 0.761/language/eng/user.php 0.762/language/eng/user.php
--- 0.761/language/eng/user.php	2004-05-24 03:17:28.000000000 -0500
+++ 0.762/language/eng/user.php	2005-09-28 04:09:38.000000000 -0500
@@ -30,4 +30,5 @@
 define('_INFOCHANGED','Account information changed. Returning to your account page.');
 define('_LOGOUTEXIT','Log-out');
 define('_THISISYOURPAGE','This is your personal home page on this site');
+define('_USERPROFILELINK', 'Profile');
 ?>
\ No newline at end of file
diff -ruN 0.761/language/languages.php 0.762/language/languages.php
--- 0.761/language/languages.php	2005-09-22 23:28:32.000000000 -0500
+++ 0.762/language/languages.php	2005-10-05 00:00:36.000000000 -0500
@@ -391,6 +391,7 @@
 define('_LANGUAGE_SAS', 'Sasak');
 define('_LANGUAGE_SAT', 'Santali');
 define('_LANGUAGE_SCO', 'Scots');
+define('_LANGUAGE_SCR', 'Serbo-Croatian');
 define('_LANGUAGE_SEL', 'Selkup');
 define('_LANGUAGE_SEM', 'Semitic (Other)');
 define('_LANGUAGE_SGA', 'Irish, Old');
diff -ruN 0.761/modules/AddStory/addstory_functions.php 0.762/modules/AddStory/addstory_functions.php
--- 0.761/modules/AddStory/addstory_functions.php	2005-09-21 04:15:44.000000000 -0500
+++ 0.762/modules/AddStory/addstory_functions.php	2005-10-10 09:08:16.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: addstory_functions.php,v 1.6 2005/09/21 09:15:44 chestnut Exp $
+// File: $Id: addstory_functions.php,v 1.7 2005/10/10 14:08:16 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -145,8 +145,23 @@
     withcomments($comm);
   // new function !
   buildLanguageMenu(true,$alanguage);
+
+    $bbcode = array('', '', '');
+    if(pnModIsHooked('pn_bbcode', 'Submit_News') && pnModIsHooked('pn_bbcode', 'AddStory') && pnModIsHooked('pn_bbcode', 'News')) {
+        $bbcode[0] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'articletext'));
+        $bbcode[1] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'extendedtext'));
+        $bbcode[2] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'notestext'));
+    }
+    $bbsmile = array('', '', '');
+    if(pnModIsHooked('pn_bbsmile', 'Submit_News') && pnModIsHooked('pn_bbsmile', 'AddStory') && pnModIsHooked('pn_bbsmile', 'News')) {
+        pnModAPILoad('pn_bbsmile', 'user');
+        $bbsmile[0] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'articletext'));
+        $bbsmile[1] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'extendedtext'));
+        $bbsmile[2] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'notestext'));
+    }
+
     echo '<br /><strong>'._STORYTEXT.'</strong><br />'
-        .'<textarea cols="80" rows="10" name="hometext">';
+        .'<textarea cols="80" rows="10" name="hometext" id="articletext">';
     // Remove br tags only if format of hometext is 'text'.
     if ($format_type_home == 0)
     {
@@ -154,13 +169,15 @@
     } else {
         echo pnVarPrepForDisplay($hometext);
     }
-    echo '</textarea>';
+    echo '</textarea><br />'
+        . $bbcode[0]
+        . $bbsmile[0] ;
 
     // Choose format type for hometext.
     buildFormatTypeMenu("format_type_home", $format_type_home);
 
     echo '<br /><strong>'._EXTENDEDTEXT.'</strong><br />'
-        .'<textarea cols="80" rows="10" name="bodytext">';
+        .'<textarea cols="80" rows="10" name="bodytext" id="extendedtext">';
     // Remove br tags only if format of bodytext is 'text'
     // The bodytext flag is in bits 2 and 3.
     if ($format_type_body == 0) {
@@ -168,13 +185,21 @@
     } else {
         echo pnVarPrepForDisplay($bodytext);
     }
-    echo '</textarea><br />'._PAGEBREAK.'<br />';
+    echo '</textarea><br />'
+       . $bbcode[1]
+       . $bbsmile[1]
+       . _PAGEBREAK.'<br />';
     // Choose format type for hometext.
     buildFormatTypeMenu("format_type_body", $format_type_body);
 
   echo '<br />'._AREYOUSURE.'<br />';
     if (pnSecAuthAction(0, 'Stories::', "$subject::", ACCESS_EDIT)) {
-        echo '<strong>'._NOTES.'</strong><br /><textarea cols="80" rows="5" name="notes">' . pnVarPrepForDisplay(unnltobr($notes)) . '</textarea><br />';
+        echo '<strong>'._NOTES.'</strong><br />'
+           . '<textarea cols="80" rows="5" name="notes" id="notestext">'
+           . pnVarPrepForDisplay(unnltobr($notes)) . '</textarea>'
+           . '<br />'
+           . $bbcode[2]
+           . $bbsmile[2];
     } else {
         echo '<input type="hidden" value="' . pnVarPrepForDisplay($notes). '" />';
     }
diff -ruN 0.761/modules/AddStory/admin.php 0.762/modules/AddStory/admin.php
--- 0.761/modules/AddStory/admin.php	2005-04-03 14:36:52.000000000 -0500
+++ 0.762/modules/AddStory/admin.php	2006-01-03 05:54:12.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: admin.php,v 1.11 2005/04/03 19:36:52 larsneo Exp $
+// File: $Id: admin.php,v 1.14 2006/01/03 11:54:12 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -71,7 +71,7 @@
         $automated = 0;
     }
 
-     
+
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
@@ -128,8 +128,8 @@
     buildProgramStoryMenu($automated);
     buildCalendarMenu(false, $year, $day, $month, $hour, $min);
     echo '<input type="hidden" name="module" value="AddStory" />'
-        .'<input type="hidden" name="qid" size="50" value="' . pnVarPrepForDisplay($qid) . '\" />'
-        .'<input type="hidden" name="uid" size="50" value="' . pnVarPrepForDisplay($uid) . '\" />'
+        .'<input type="hidden" name="qid" size="50" value="' . pnVarPrepForDisplay($qid) . '" />'
+        .'<input type="hidden" name="uid" size="50" value="' . pnVarPrepForDisplay($uid) . '" />'
         .'<input type="hidden" name="authid" value="' . pnSecGenAuthKey() . '" />'
         .'<br /><select name="op">'
         .'<option value="DeleteStory">'._DELETESTORY.'</option>'
@@ -203,7 +203,7 @@
     if (isset($format_type_home) && isset($format_type_body)) {
         $format_type = ($format_type_body%4)*4 + $format_type_home%4;
     }
-    
+
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
@@ -306,7 +306,7 @@
                                       'comm',
                                       'format_type_home',
                                       'format_type_body');
-    
+
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
     // check for valid topic
@@ -520,7 +520,7 @@
 function editStory()
 {
     $sid = pnVarCleanFromInput('sid');
-       
+
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
@@ -799,7 +799,7 @@
     }
 
     $format_type = (($format_type_body%4)*4) + ($format_type_home%4);
-    
+
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
@@ -1558,14 +1558,13 @@
             while(list($qid, $subject, $timestamp, $alanguage) = $result->fields) {
                 echo "<tr>\n";
                 echo '<td align="center">';
-
                 //echo '<table><tr><td><div style="text-align:center">'."\n";
                 if (pnSecAuthAction(0, 'Stories::Story', '::', ACCESS_EDIT)) {
                     echo '<form action="admin.php" method="post"><div>'."\n"
-                     .'<input type="hidden" name="module" value="AddStory" />'."\n"
-                     .'<input type="hidden" name="qid" value="'.pnVarPrepForDisplay($qid).'" />'."\n"
-                     .'<select name="op">'."\n"
-                     .'<option value="DisplayStory" selected="selected">'._PREVIEWSTORY.'</option>'."\n";
+                        .'<input type="hidden" name="module" value="AddStory" />'."\n"
+                        .'<input type="hidden" name="qid" value="'.pnVarPrepForDisplay($qid).'" />'."\n"
+                        .'<select name="op">'."\n"
+                        .'<option value="DisplayStory" selected="selected">'._PREVIEWSTORY.'</option>'."\n";
 // jgm - this option doesn't work, removeStory() deletes stories from the stories table, not the
 //       queue.  Commented out until someone can get around to fixing it
 // TODO - create a removeQueue() or whatever to remove the story directly from the queue
@@ -1575,15 +1574,14 @@
                     if (pnSecAuthAction(0, 'Stories::Story', '::', ACCESS_DELETE)) {
                         echo '<option value="ArchiveStory">'._ARCHIVE.'</option>'."\n";
                     }
-                echo  '</select>&nbsp;'."\n"
-                     .'<input type="hidden" name="authid" value="' . pnSecGenAuthKey() . '" />'
-                     .'<input type="submit" value="'._GO.'" />'."\n"
-                     .'</div></form>'."\n"
-                     //.'</div>'."\n";
-                     .'</td>';
+                    echo '</select>&nbsp;'."\n"
+                        .'<input type="hidden" name="authid" value="' . pnSecGenAuthKey() . '" />'
+                        .'<input type="submit" value="'._GO.'" />'."\n"
+                        .'</div></form>'."\n";
+                        //.'</div>'."\n";
                 }
                 //echo '</td></tr></table>'."\n";
-
+                echo '</td>'."\n";
                 echo '<td>'."\n";
 
                 if ($subject == '') {
@@ -1601,9 +1599,9 @@
                 $result->MoveNext();
             }
         if ($dummy < 1) {
-        echo '<tr><td align="center"><strong>'._NOSUBMISSIONS.'</strong></form></td></tr></table>'."\n";
+            echo '<tr><td align="center"><strong>'._NOSUBMISSIONS.'</strong></form></td></tr></table>'."\n";
         } else {
-        echo '</table>'."\n";
+            echo '</table>'."\n";
         }
     }
     CloseTable();
@@ -1650,7 +1648,7 @@
 
 	OpenTable();
     while(list($subject) = $result->fields) {
-        echo '<strong>'._ARCHIVECHOSE.'</strong> :'.pnVarPrepForDisplay($subject);
+        echo '<strong>'._ARCHIVECHOSE.'</strong> '.pnVarPrepForDisplay($subject);
         $result->MoveNext();
     }
     echo '<form action="admin.php" method="post"><div>'
diff -ruN 0.761/modules/Admin/pnadminapi.php 0.762/modules/Admin/pnadminapi.php
--- 0.761/modules/Admin/pnadminapi.php	2005-08-22 07:00:35.000000000 -0500
+++ 0.762/modules/Admin/pnadminapi.php	2006-01-03 03:46:49.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadminapi.php,v 1.26 2005/08/22 12:00:35 drak Exp $
+// $Id: pnadminapi.php,v 1.26.2.1 2006/01/03 09:46:49 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -721,7 +721,6 @@
 
 	// check our input and get the module information
 	if (!isset($modname) || !is_string($modname) || !is_array($modinfo = pnModGetInfo(pnModGetIDFromName($modname)))) {
-		echo 'got here';
 		pnSessionSetVar(_MODARGSERROR);
 		return false;
 	}
diff -ruN 0.761/modules/Admin/pnadmin.php 0.762/modules/Admin/pnadmin.php
--- 0.761/modules/Admin/pnadmin.php	2005-08-19 11:52:18.000000000 -0500
+++ 0.762/modules/Admin/pnadmin.php	2006-01-12 06:12:57.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.70 2005/08/19 16:52:18 landseer Exp $
+// $Id: pnadmin.php,v 1.70.2.1 2006/01/12 12:12:57 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -44,7 +44,6 @@
  * @author Mark West
  * @return string HTML string
  */
-
 function Admin_admin_main()
 {
     // Security check - important to do this as early as possible to avoid
@@ -75,7 +74,6 @@
  * @author Mark West
  * @return string HTML string
  */
-
 function Admin_admin_new()
 {
     // Create output object - this object will store all of our output so that
@@ -104,7 +102,6 @@
  * @param string $args['description'] the description of the category to be created
  * @return mixed category id if create successful, false otherwise
  */
-
 function Admin_admin_create($args)
 {
     // Get parameters from whatever input we need.  All arguments to this
@@ -171,7 +168,6 @@
  * @param int $args['objectid'] generic object id maps to cid if present
  * @return string HTML string
  */
-
 function Admin_admin_modify($args)
 {
     // Get parameters from whatever input we need.  All arguments to this
@@ -248,7 +244,6 @@
  * @param string $args['description'] the description of the item to be updated
  * @return bool true if update successful, false otherwise
  */
-
 function Admin_admin_update($args)
 {
     // Get parameters from whatever input we need.  All arguments to this
@@ -341,7 +336,6 @@
  * @param bool $args['confirmation'] confirmation that this item can be deleted
  * @return mixed HTML string if confirmation is null, true if delete successful, false otherwise
  */
-
 function Admin_admin_delete($args)
 {
     // Get parameters from whatever input we need.  All arguments to this
@@ -452,27 +446,25 @@
  * @param int $startnum the starting id to view from - optional
  * @return string HTML string
  */
-
 function Admin_admin_view()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing.
+    if (!pnSecAuthAction(0, 'Admin::', '::', ACCESS_EDIT)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
     // assumptions that will not hold in future versions of PostNuke
     $startnum = pnVarCleanFromInput('startnum');
+
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
     $pnRender =& new pnRender('Admin');
     // As Admin output changes often, we do not want caching.
     $pnRender->caching = false;
-    // Security check - important to do this as early as possible to avoid
-    // potential security holes or just too much wasted processing.  However,
-    // in this case we had to wait until we could obtain the item name to
-    // complete the instance information so this is the first chance we get to
-    // do the check
-    if (!pnSecAuthAction(0, 'Admin::', '::', ACCESS_EDIT)) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
 
     // The user API function is called.  This takes the number of items
     // required and the first number in the list of all items, which we
@@ -526,6 +518,8 @@
  */
 function Admin_admin_adminpanel($args)
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing.
     if (!pnSecAuthAction(0, '::', '::', ACCESS_EDIT)) {
         // suppress admin display - return to index.
         pnRedirect('index.php');
@@ -661,7 +655,6 @@
  * @author Mark West
  * @return string HTML string
  */
-
 function Admin_admin_modifyconfig()
 {
     // Security check - important to do this as early as possible to avoid
@@ -722,6 +715,12 @@
  */
 function Admin_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Admin::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Confirm authorisation code.  This checks that the form had a valid
     // authorisation code attached to it.  If it did not then the function will
     // proceed no further as it is possible that this is an attempt at sending
@@ -801,7 +800,6 @@
         // function should be obtained from pnVarCleanFromInput(), getting them
         // from other places such as the environment is not allowed, as that makes
         // assumptions that will not hold in future versions of PostNuke
-
         $category = pnVarCleanFromInput($adminmodule['name']);
 
         // The user API function is called.  This takes the number of items
diff -ruN 0.761/modules/Admin/pnlang/eng/admin.php 0.762/modules/Admin/pnlang/eng/admin.php
--- 0.761/modules/Admin/pnlang/eng/admin.php	2005-07-29 03:45:06.000000000 -0500
+++ 0.762/modules/Admin/pnlang/eng/admin.php	2006-02-02 04:16:15.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: admin.php,v 1.20 2005/07/29 08:45:06 larsneo Exp $
+// $Id: admin.php,v 1.20.2.1 2006/02/02 10:16:15 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -36,8 +36,8 @@
 
 define('_ADMIN_MAGIC_QUOTES','Notice: <a href="http://php.net/magic_quotes">magic_quotes_gpc</a> is off!');
 define('_ADMIN_REGISTER_GLOBALS','Notice: <a href="http://php.net/register_globals">register_globals</a> is on!');
-define('_ADMIN_CONFIG_PHP','Notice: config.php is writable (hint: chmod 644)!');
-define('_ADMIN_CONFIG_OLD_PHP','Notice: config-old.php is writable (hint chmod 644)!');
+define('_ADMIN_CONFIG_PHP','Notice: config.php is writable (hint: chmod 644 or chmod 444)!');
+define('_ADMIN_CONFIG_OLD_PHP','Notice: config-old.php is writable (hint: chmod 644 or chmod 444)!');
 define('_ADMIN_PNTEMP_HTACCESS','Notice: /pnTemp-folder should be secured with .htaccess.');
 define('_ADMINCONTINUE','Continue');
 define('_ADMININSTALLWARNING','Warning! Please remove the file  install.php and the folder called install from the root of your PostNuke web site before proceeding');
diff -ruN 0.761/modules/Admin/pntemplates/plugins/function.admincategorymenu.php 0.762/modules/Admin/pntemplates/plugins/function.admincategorymenu.php
--- 0.761/modules/Admin/pntemplates/plugins/function.admincategorymenu.php	2005-08-18 13:13:24.000000000 -0500
+++ 0.762/modules/Admin/pntemplates/plugins/function.admincategorymenu.php	2005-12-25 04:55:50.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: function.admincategorymenu.php,v 1.4 2005/08/18 18:13:24 landseer Exp $
+// $Id: function.admincategorymenu.php,v 1.4.2.2 2005/12/25 10:55:50 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -28,7 +28,7 @@
  *
  * @package      PostNuke_System_Modules
  * @subpackage   Admin
- * @version      $Id: function.admincategorymenu.php,v 1.4 2005/08/18 18:13:24 landseer Exp $
+ * @version      $Id: function.admincategorymenu.php,v 1.4.2.2 2005/12/25 10:55:50 landseer Exp $
  * @author       The PostNuke development team
  * @link         http://www.postnuke.com  The PostNuke Home Page
  * @copyright    Copyright (C) 2002 by the PostNuke Development Team
diff -ruN 0.761/modules/Admin/pntemplates/plugins/function.articles.php 0.762/modules/Admin/pntemplates/plugins/function.articles.php
--- 0.761/modules/Admin/pntemplates/plugins/function.articles.php	2005-05-03 02:50:47.000000000 -0500
+++ 0.762/modules/Admin/pntemplates/plugins/function.articles.php	2006-01-04 16:30:25.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: function.articles.php,v 1.2 2005/05/03 07:50:47 markwest Exp $
+// $Id: function.articles.php,v 1.2.2.1 2006/01/04 22:30:25 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -28,7 +28,7 @@
  * 
  * @package      PostNuke_System_Modules
  * @subpackage   Admin
- * @version      $Id: function.articles.php,v 1.2 2005/05/03 07:50:47 markwest Exp $
+ * @version      $Id: function.articles.php,v 1.2.2.1 2006/01/04 22:30:25 landseer Exp $
  * @author       The PostNuke development team
  * @link         http://www.postnuke.com  The PostNuke Home Page
  * @copyright    Copyright (C) 2002 by the PostNuke Development Team
@@ -106,7 +106,7 @@
             }
             echo  '<tr>'."\n"
                  .'<td align="right"><strong>'.pnVarPrepForDisplay($sid).'</strong></td>'
-                 .'<td align="left" style="width:100%"><a href="modules.php?name=News&amp;file=article&amp;sid='.$sid.'">'.pnVarPrepHTMLDisplay($title).'</a></td>'."\n"
+                 .'<td align="left" style="width:100%"><a href="modules.php?name=News&amp;file=article&amp;sid='.$sid.'">'.pnVarPrepForDisplay($title).'</a></td>'."\n"
                  .'<td align="center">'.language_name($alanguage).'</td>'."\n"
                  .'<td align="right">'.pnVarPrepForDisplay($topicname).'</td>'."\n";
             if ($cid == 0) {
diff -ruN 0.761/modules/Admin/pntemplates/plugins/function.automatednews.php 0.762/modules/Admin/pntemplates/plugins/function.automatednews.php
--- 0.761/modules/Admin/pntemplates/plugins/function.automatednews.php	2004-12-12 16:29:32.000000000 -0600
+++ 0.762/modules/Admin/pntemplates/plugins/function.automatednews.php	2006-01-03 03:46:50.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: function.automatednews.php,v 1.1 2004/12/12 22:29:32 markwest Exp $
+// $Id: function.automatednews.php,v 1.1.2.1 2006/01/03 09:46:50 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -28,7 +28,7 @@
  * 
  * @package      PostNuke_System_Modules
  * @subpackage   Admin
- * @version      $Id: function.automatednews.php,v 1.1 2004/12/12 22:29:32 markwest Exp $
+ * @version      $Id: function.automatednews.php,v 1.1.2.1 2006/01/03 09:46:50 markwest Exp $
  * @author       The PostNuke development team
  * @link         http://www.postnuke.com  The PostNuke Home Page
  * @copyright    Copyright (C) 2002 by the PostNuke Development Team
@@ -95,7 +95,7 @@
                     if (pnSecAuthAction(0, 'Stories::Story', "$said:$cattitle:", ACCESS_DELETE)) {
 	                    echo '-<a href="admin.php?module=AddStory&op=autoDelete&amp;anid='.$anid.'">'._DELETE.'</a>'."\n";
                     }
-                    echo ')';
+                    echo ')</td>';
                 }
                 echo  '<td style="width:100%">&nbsp;'.pnVarPrepForDisplay($title).'&nbsp;('.pnVarPrepForDisplay($cattitle).')&nbsp;</td>'."\n"
                      .'<td align="center">&nbsp;'.language_name($alanguage).'&nbsp;</td>'."\n"
diff -ruN 0.761/modules/Admin_Messages/pnadmin.php 0.762/modules/Admin_Messages/pnadmin.php
--- 0.761/modules/Admin_Messages/pnadmin.php	2005-01-10 07:31:27.000000000 -0600
+++ 0.762/modules/Admin_Messages/pnadmin.php	2006-01-12 06:20:17.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.33 2005/01/10 13:31:27 markwest Exp $
+// $Id: pnadmin.php,v 1.33.2.1 2006/01/12 12:20:17 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -76,6 +76,12 @@
  */
 function Admin_Messages_admin_new()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Admin_Messages::', '::', ACCESS_ADD)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
 	$pnRender =& new pnRender('Admin_Messages');
@@ -83,12 +89,6 @@
 	// As Admin output changes often, we do not want caching.
 	$pnRender->caching = false;
 
-    // Security check - important to do this as early as possible to avoid
-    // potential security holes or just too much wasted processing
-    if (!pnSecAuthAction(0, 'Admin_Messages::', '::', ACCESS_ADD)) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     // Return the output that has been generated by this function
     return $pnRender->fetch('admin_messages_admin_new.htm');
 }
@@ -497,6 +497,12 @@
  */
 function Admin_Messages_admin_view()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Admin_Messages::', '::', ACCESS_EDIT)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
@@ -510,10 +516,6 @@
 	// As Admin output changes often, we do not want caching.
 	$pnRender->caching = false;
 
-    if (!pnSecAuthAction(0, 'Admin_Messages::', '::', ACCESS_EDIT)) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     // The user API function is called.  This takes the number of items
     // required and the first number in the list of all items, which we
     // obtained from the input and gets us the information on the appropriate
@@ -621,6 +623,12 @@
  */
 function Admin_Messages_admin_modifyconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Admin_Messages::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
 	$pnRender =& new pnRender('Admin_Messages');
@@ -628,12 +636,6 @@
 	// As Admin output changes often, we do not want caching.
 	$pnRender->caching = false;
 
-    // Security check - important to do this as early as possible to avoid
-    // potential security holes or just too much wasted processing
-    if (!pnSecAuthAction(0, 'Admin_Messages::', '::', ACCESS_ADMIN)) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     // Number of items to display per page
     $pnRender->assign(pnModGetVar('Admin_Messages'));
 
@@ -651,6 +653,12 @@
  */
 function Admin_Messages_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Admin_Messages::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
diff -ruN 0.761/modules/Admin_Messages/pnlang/eng/init.php 0.762/modules/Admin_Messages/pnlang/eng/init.php
--- 0.761/modules/Admin_Messages/pnlang/eng/init.php	2005-05-28 06:22:16.000000000 -0500
+++ 0.762/modules/Admin_Messages/pnlang/eng/init.php	2005-11-30 16:01:17.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: init.php,v 1.7 2005/05/28 11:22:16 hammerhead Exp $
+// $Id: init.php,v 1.7.2.1 2005/11/30 22:01:17 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -35,7 +35,7 @@
 */
 
 // Messages
-define('_MESSAGE_00_a','Welcome to PostNuke, the =-Phoenix-= release (0.760)');
+define('_MESSAGE_00_a','Welcome to PostNuke, the =-Phoenix-= release (0.762)');
 define('_MESSAGE_00_b','<p><a href="http://www.postnuke.com">PostNuke</a> is a weblog/content management system (CMS). It is far more secure and stable than competing products, and is able to work in high-volume environments with ease.<br /><br />
 Some of the key features of PostNuke are:</p>
 <ul>
diff -ruN 0.761/modules/Autolinks/pnadmin.php 0.762/modules/Autolinks/pnadmin.php
--- 0.761/modules/Autolinks/pnadmin.php	2005-01-10 08:10:14.000000000 -0600
+++ 0.762/modules/Autolinks/pnadmin.php	2006-01-12 07:22:36.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.29 2005/01/10 14:10:14 markwest Exp $
+// $Id: pnadmin.php,v 1.29.2.1 2006/01/12 13:22:36 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -422,6 +422,11 @@
  */
 function autolinks_admin_updateconfig()
 {
+    // Security check
+    if (!pnSecAuthAction(0, 'Autolinks::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     list($linkfirst,
          $invisilinks,
 		 $itemsperpage,
diff -ruN 0.761/modules/AvantGo/pnadmin.php 0.762/modules/AvantGo/pnadmin.php
--- 0.761/modules/AvantGo/pnadmin.php	2005-01-10 08:25:32.000000000 -0600
+++ 0.762/modules/AvantGo/pnadmin.php	2006-01-12 07:24:14.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.11 2005/01/10 14:25:32 markwest Exp $
+// $Id: pnadmin.php,v 1.11.2.1 2006/01/12 13:24:14 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -78,18 +78,18 @@
  */
 function AvantGo_admin_view()
 {
-    // Get parameters from whatever input we need.  All arguments to this
-    // function should be obtained from pnVarCleanFromInput(), getting them
-    // from other places such as the environment is not allowed, as that makes
-    // assumptions that will not hold in future versions of PostNuke
-    $startnum = pnVarCleanFromInput('startnum');
-
     // Security check - important to do this as early as possible to avoid
     // potential security holes or just too much wasted processing
     if (!pnSecAuthAction(0, 'AvantGo::', '::', ACCESS_EDIT)) {
         return pnVarPrepHTMLDisplay(_MODULENOAUTH);
     }
 
+    // Get parameters from whatever input we need.  All arguments to this
+    // function should be obtained from pnVarCleanFromInput(), getting them
+    // from other places such as the environment is not allowed, as that makes
+    // assumptions that will not hold in future versions of PostNuke
+    $startnum = pnVarCleanFromInput('startnum');
+
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
     $pnRender =& new pnRender('AvantGo');
@@ -170,6 +170,12 @@
  */
 function AvantGo_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'AvantGo::', '::', ACCESS_EDIT)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
diff -ruN 0.761/modules/Banners/admin.php 0.762/modules/Banners/admin.php
--- 0.761/modules/Banners/admin.php	2005-02-04 00:30:24.000000000 -0600
+++ 0.762/modules/Banners/admin.php	2006-01-12 08:50:50.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: admin.php,v 1.5 2005/02/04 06:30:24 jorg Exp $
+// File: $Id: admin.php,v 1.6 2006/01/12 14:50:50 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -951,6 +951,12 @@
 function banners_admin_getConfig()
 {
     include 'header.php';
+    
+    if (!(pnSecAuthAction(0, 'Banners::Banner', '::', ACCESS_ADMIN))) {
+        echo _BANNERSNOAUTH;
+        include 'footer.php';
+    }
+    
     $bgcolor2 = $GLOBALS["bgcolor2"];
 
     // prepare vars
@@ -982,6 +988,12 @@
 
 function banners_admin_setConfig($var)
 {
+    if (!(pnSecAuthAction(0, 'Banners::Banner', '::', ACCESS_ADMIN))) {
+        include 'header.php';
+        echo _BANNERSNOAUTH;
+        include 'footer.php';
+    }
+    
     if (!pnSecConfirmAuthKey()) {
         include 'header.php';
         echo _BADAUTHKEY;
@@ -1024,7 +1036,7 @@
 
    extract($var);
 
-    if (!(pnSecAuthAction(0, 'Banners::Banner', '::', ACCESS_READ))) {
+    if (!(pnSecAuthAction(0, 'Banners::Banner', '::', ACCESS_ADMIN))) {
         include 'header.php';
         echo _BANNERSNOAUTH;
         include 'footer.php';
diff -ruN 0.761/modules/Blocks/pnadmin.php 0.762/modules/Blocks/pnadmin.php
--- 0.761/modules/Blocks/pnadmin.php	2005-08-29 11:45:47.000000000 -0500
+++ 0.762/modules/Blocks/pnadmin.php	2006-01-12 06:42:53.000000000 -0600
@@ -1,5 +1,5 @@
 <?php 
-// $Id: pnadmin.php,v 1.42.2.1 2005/08/29 16:45:47 markwest Exp $
+// $Id: pnadmin.php,v 1.42.2.2 2006/01/12 12:42:53 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -53,7 +53,6 @@
 
     pnRedirect(pnModURL('Blocks', 'admin', 'view'));
     return true;
-
 } 
 
 /**
@@ -230,7 +229,6 @@
  */
 function blocks_admin_showactive()
 {
-
     pnSessionDelVar('blocks_show_all');
     pnRedirect(pnModURL('Blocks', 'admin', 'view'));
     return true;
@@ -748,7 +746,6 @@
     pnRedirect(pnModURL('Blocks', 'admin', 'view'));
 
     return true;
-
 } 
 
 /**
@@ -785,6 +782,12 @@
  */
 function blocks_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Blocks::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    } 
+
     $collapseable = pnVarCleanFromInput('collapseable');
 
     if (!pnSecConfirmAuthKey()) {
diff -ruN 0.761/modules/Blocks/pntemplates/plugins/function.blocksadminlinks.php 0.762/modules/Blocks/pntemplates/plugins/function.blocksadminlinks.php
--- 0.761/modules/Blocks/pntemplates/plugins/function.blocksadminlinks.php	2004-07-16 10:09:15.000000000 -0500
+++ 0.762/modules/Blocks/pntemplates/plugins/function.blocksadminlinks.php	2005-11-29 09:09:35.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: function.blocksadminlinks.php,v 1.5 2004/07/16 15:09:15 markwest Exp $
+// $Id: function.blocksadminlinks.php,v 1.5.2.1 2005/11/29 15:09:35 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -28,7 +28,7 @@
  * 
  * @package      PostNuke_System_Modules
  * @subpackage   Blocks
- * @version      $Id: function.blocksadminlinks.php,v 1.5 2004/07/16 15:09:15 markwest Exp $
+ * @version      $Id: function.blocksadminlinks.php,v 1.5.2.1 2005/11/29 15:09:35 landseer Exp $
  * @author       The PostNuke development team
  * @link         http://www.postnuke.com  The PostNuke Home Page
  * @copyright    Copyright (C) 2002 by the PostNuke Development Team
@@ -77,20 +77,20 @@
     $adminlinks = "<span class=\"$class\">$start ";
 
     if (pnSecAuthAction(0, 'Blocks::', "::", ACCESS_ADMIN)) {
-		$adminlinks .= "<a href=\"" . pnVarPrepHTMLDisplay(pnModURL('Blocks', 'admin', 'new')) . "\">" . _NEWBLOCK . "</a> ";
+		$adminlinks .= "<a href=\"" . pnVarPrepForDisplay(pnModURL('Blocks', 'admin', 'new')) . "\">" . _NEWBLOCK . "</a> ";
     }
     if (pnSecAuthAction(0, 'Blocks::', "::", ACCESS_ADMIN)) {
-		$adminlinks .= "$seperator <a href=\"" . pnVarPrepHTMLDisplay(pnModURL('Blocks', 'admin', 'view')) . "\">" . _VIEWBLOCKS . "</a> ";
+		$adminlinks .= "$seperator <a href=\"" . pnVarPrepForDisplay(pnModURL('Blocks', 'admin', 'view')) . "\">" . _VIEWBLOCKS . "</a> ";
     }
     if (pnSecAuthAction(0, 'Blocks::', "::", ACCESS_ADMIN)) {
 		if (pnSessionGetVar('blocks_show_all')) {
-			$adminlinks .= "$seperator <a href=\"" . pnVarPrepHTMLDisplay(pnModURL('Blocks', 'admin', 'showactive')) . "\">" . _SHOWACTIVEBLOCKS . "</a> ";
+			$adminlinks .= "$seperator <a href=\"" . pnVarPrepForDisplay(pnModURL('Blocks', 'admin', 'showactive')) . "\">" . _SHOWACTIVEBLOCKS . "</a> ";
 		} else {
-			$adminlinks .= "$seperator <a href=\"" . pnVarPrepHTMLDisplay(pnModURL('Blocks', 'admin', 'showall')) . "\">" . _SHOWALLBLOCKS . "</a> ";
+			$adminlinks .= "$seperator <a href=\"" . pnVarPrepForDisplay(pnModURL('Blocks', 'admin', 'showall')) . "\">" . _SHOWALLBLOCKS . "</a> ";
 		} 
     }
     if (pnSecAuthAction(0, 'Blocks::', "::", ACCESS_ADMIN)) {
-		$adminlinks .= "$seperator <a href=\"" . pnVarPrepHTMLDisplay(pnModURL('Blocks', 'admin', 'modifyconfig')) . "\">" . _MODIFYCONFIG . "</a> ";
+		$adminlinks .= "$seperator <a href=\"" . pnVarPrepForDisplay(pnModURL('Blocks', 'admin', 'modifyconfig')) . "\">" . _MODIFYCONFIG . "</a> ";
     }
 
 	$adminlinks .= "$end</span>\n";
diff -ruN 0.761/modules/Censor/pnadmin.php 0.762/modules/Censor/pnadmin.php
--- 0.761/modules/Censor/pnadmin.php	2005-01-10 08:28:40.000000000 -0600
+++ 0.762/modules/Censor/pnadmin.php	2006-01-12 06:50:29.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.23 2005/01/10 14:28:40 markwest Exp $
+// $Id: pnadmin.php,v 1.23.2.1 2006/01/12 12:50:29 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -75,6 +75,12 @@
  */
 function Censor_admin_modify($args)
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Censor::', ":CensorList:", ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
@@ -89,12 +95,6 @@
     // arguments *after* we have obtained any form-based input through
     extract($args);
 
-    // Security check - important to do this as early as possible to avoid
-    // potential security holes or just too much wasted processing
-    if (!pnSecAuthAction(0, 'Censor::', ":CensorList:", ACCESS_OVERVIEW)) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
 	$pnRender =& new pnRender('Censor');
@@ -126,6 +126,12 @@
  */
 function Censor_admin_update($args)
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Censor::', ":CensorList:", ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     list($censormode,
          $censorlist,
          $censorreplace) = pnVarCleanFromInput('censormode',
diff -ruN 0.761/modules/Comments/admin.php 0.762/modules/Comments/admin.php
--- 0.761/modules/Comments/admin.php	2005-09-21 13:05:30.000000000 -0500
+++ 0.762/modules/Comments/admin.php	2006-01-12 08:48:20.000000000 -0600
@@ -1,5 +1,5 @@
 <?PHP
-// File: $Id: admin.php,v 1.6 2005/09/21 18:05:30 hammerhead Exp $
+// File: $Id: admin.php,v 1.7 2006/01/12 14:48:20 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -31,7 +31,6 @@
     die ('Access Denied');
 }
 
-if (pnSecAuthAction(0, 'Comments::', '::', ACCESS_ADMIN)) {
 modules_get_language();
 modules_get_manual();
 
@@ -156,6 +155,12 @@
 {
     include 'header.php';
 
+    if (!pnSecAuthAction(0, 'Comments::', '::', ACCESS_ADMIN)) {
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+    
     // prepare vars
     $sel_moderate['0'] = '';
     $sel_moderate['1'] = '';
@@ -204,6 +209,13 @@
 
 function comments_admin_setConfig()
 {
+    if (!pnSecAuthAction(0, 'Comments::', '::', ACCESS_ADMIN)) {
+        include('header.php');
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+    	
     if (!pnSecConfirmAuthKey()) {
         include 'header.php';
         echo _BADAUTHKEY;
@@ -234,6 +246,13 @@
 
 function comments_admin_main($var)
 {
+    if (!pnSecAuthAction(0, 'Comments::', '::', ACCESS_ADMIN)) {
+        include('header.php');
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+    	
    list($op,
    	$ok,
    	$tid,
@@ -274,10 +293,6 @@
         comments_admin_getConfig();
         break;
    }
-}
 
-} else {
-    echo 'Access Denied';
 }
-
 ?>
\ No newline at end of file
diff -ruN 0.761/modules/Comments/index.php 0.762/modules/Comments/index.php
--- 0.761/modules/Comments/index.php	2005-09-24 13:32:54.000000000 -0500
+++ 0.762/modules/Comments/index.php	2006-02-02 04:12:40.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: index.php,v 1.14 2005/09/24 18:32:54 chestnut Exp $
+// File: $Id: index.php,v 1.18 2006/02/02 10:12:40 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -952,7 +952,7 @@
 
     if ((!pnSecAuthAction(0, 'Stories::Story', "$info[aid]:$info[cattitle]:$info[sid]", ACCESS_COMMENT)) ||
          !pnSecAuthAction(0, 'Topics::Topic', "$info[topicname]::$info[tid]", ACCESS_READ) ||
-         !pnConfigGetVar('anonpost') ||
+         (!pnUserLoggedIn() && !pnConfigGetVar('anonpost')) ||
          $info['withcomm'] == 1) {
 
          OpenTable2();
@@ -1087,7 +1087,7 @@
                                           'posttype',
                                           'req');
 
-    if (!isset($pid) && !is_numeric($pid)) {
+    if (!isset($pid) || !is_numeric($pid)) {
         $pid = 0;
     }
 
@@ -1098,7 +1098,7 @@
 
     if ((!pnSecAuthAction(0, 'Stories::Story', "$info[aid]:$info[cattitle]:$info[sid]", ACCESS_COMMENT)) ||
          !pnSecAuthAction(0, 'Topics::Topic', "$info[topicname]::$info[tid]", ACCESS_READ) ||
-         !pnConfigGetVar('anonpost') ||
+         (!pnUserLoggedIn() && !pnConfigGetVar('anonpost')) ||
          $info['withcomm'] == 1) {
 
          include('header.php');
@@ -1275,11 +1275,13 @@
 }
 list($sid,
    $pid,
+   $tid,
    $mode,
    $order,
    $thold,
    $moderate) = pnVarCleanFromInput('sid',
                    'pid',
+                   'tid',
                    'mode',
                    'order',
                    'thold',
diff -ruN 0.761/modules/Credits/pntemplates/credits_user_main.htm 0.762/modules/Credits/pntemplates/credits_user_main.htm
--- 0.761/modules/Credits/pntemplates/credits_user_main.htm	2005-08-08 10:14:51.000000000 -0500
+++ 0.762/modules/Credits/pntemplates/credits_user_main.htm	2005-12-14 09:23:48.000000000 -0600
@@ -1,4 +1,4 @@
-<!--[*  $Id: credits_user_main.htm,v 1.5 2005/08/08 15:14:51 markwest Exp $  *]-->
+<!--[*  $Id: credits_user_main.htm,v 1.5.2.1 2005/12/14 15:23:48 markwest Exp $  *]-->
 <!--[include file="credits_user_menu.htm]-->
 <div style="text-align:center;"><!--[pnml name=_CREDITSPOSTNUKE html=1]--></div>
 <div style="text-align:center;">
@@ -31,9 +31,16 @@
       <td><!--[$modules[modulesinfo].version|default:""|pnvarprepfordisplay]--></td>
       <td><!--[$modules[modulesinfo].description|default:""|pnvarprepfordisplay]--></td>
       <td>
+		<!--[strip]-->
 	  	<!--[section name=contacts loop=$modules[modulesinfo].contact]-->
-			<a href="<!--[$modules[modulesinfo].contact[contacts]|pnvarprepfordisplay]-->"><!--[$modules[modulesinfo].author[contacts]|pnvarprephtmldisplay]--></a><!--[if $smarty.section.contacts.last neq true]-->, <!--[/if]-->
+			<!--[if $modules[modulesinfo].contact[contacts] neq '']-->
+			<a href="<!--[$modules[modulesinfo].contact[contacts]|trim|pnvarprepfordisplay]-->"><!--[$modules[modulesinfo].author[contacts]|trim|pnvarprephtmldisplay]--></a>
+			<!--[else]-->
+			<!--[$modules[modulesinfo].author[contacts]|trim|pnvarprephtmldisplay]-->
+			<!--[/if]-->
+            <!--[if $smarty.section.contacts.last neq true]-->, <!--[/if]-->
 		<!--[/section]-->
+		<!--[/strip]-->
 	  </td>
 	  <td align="left">&nbsp;
           <!--[if $modules[modulesinfo].credits != ""]-->
diff -ruN 0.761/modules/Credits/pnuser.php 0.762/modules/Credits/pnuser.php
--- 0.761/modules/Credits/pnuser.php	2005-08-08 10:14:52.000000000 -0500
+++ 0.762/modules/Credits/pnuser.php	2005-12-14 09:23:36.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: pnuser.php,v 1.32 2005/08/08 15:14:52 markwest Exp $
+// File: $Id: pnuser.php,v 1.32.2.1 2005/12/14 15:23:36 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -38,7 +38,7 @@
  *
  * Lists Information and Credits for all User Modules.
  * @author Rob Brandt
- * @version $Revision: 1.32 $
+ * @version $Revision: 1.32.2.1 $
  * @return HTML output string
  * @todo add support for user mods in system directory
  */
@@ -50,12 +50,12 @@
     }
 
     // If the user is site admin then get all modules including admin only modules
-	if (pnSecAuthAction(0, '::', '::', ACCESS_ADMIN)) {
+    if (pnSecAuthAction(0, '::', '::', ACCESS_ADMIN)) {
         $mods = pnModGetAllMods();
-		$cacheid = 0;
+        $cacheid = 0;
     } else {
         $mods = pnModGetUserMods();
-		$cacheid = 1;
+        $cacheid = 1;
     }
 
     // highly unlikely but check if we have no modules returned
@@ -65,49 +65,52 @@
 
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
-	$pnRender =& new pnRender('Credits');
+    $pnRender =& new pnRender('Credits');
 
-	// For caching reasons you must pass a cache ID. This could be done as a 
-	// separate parameter to every method that uses caching (like fetch, is_cached
-	// etc.) or by assigning the ID to the cache_id property like it is done in
-	// this case. 
-	// Here the output only changes based on the security check to we use the
-	// cacheid flag set earlier
-	$pnRender->cache_id = $cacheid;
-
-	// check out if the contents are cached.
-	// If this is the case, we do not need to make DB queries.
-	if ($pnRender->is_cached('credits_user_main.htm')) {
-	   return $pnRender->fetch('credits_user_main.htm');
-	}
+    // For caching reasons you must pass a cache ID. This could be done as a
+    // separate parameter to every method that uses caching (like fetch, is_cached
+    // etc.) or by assigning the ID to the cache_id property like it is done in
+    // this case.
+    // Here the output only changes based on the security check to we use the
+    // cacheid flag set earlier
+    $pnRender->cache_id = $cacheid;
+
+    // check out if the contents are cached.
+    // If this is the case, we do not need to make DB queries.
+    if ($pnRender->is_cached('credits_user_main.htm')) {
+       return $pnRender->fetch('credits_user_main.htm');
+    }
 
     $modules = array();
     foreach($mods as $mod) {
 		$f = $mod['directory'];
 		$fos = pnVarPrepForOS($mod['directory']);
-        // Add applicable actions
-        //$actions = array();
-        $modversion = '';
-        $modversion['displayname'] = $mod['displayname'];
-        $modversion['filename'] = $f;
-        $modversion['name'] = '';
-        $modversion['version'] = '';
-        $modversion['description'] = '';
-        $modversion['credits'] = '';
-        $modversion['help'] = '';
-        $modversion['changelog'] = '';
-        $modversion['license'] = '';
-        $modversion['official'] = 0;
-        $modversion['author'] = '';
-        $modversion['contact'] = '';
-	    $modversion['admin'] = 0;
-		if (file_exists("modules/$fos/Version.php")) {
+		
+		pnModLangLoad($fos, 'version');
+		
+		// Add applicable actions
+		//$actions = array();
+		$modversion = '';
+		$modversion['displayname'] = $mod['displayname'];
+		$modversion['filename']    = $f;
+		$modversion['name']        = '';
+		$modversion['version']     = '';
+		$modversion['description'] = '';
+		$modversion['credits']     = '';
+		$modversion['help']        = '';
+		$modversion['changelog']   = '';
+		$modversion['license']     = '';
+		$modversion['official']    = 0;
+		$modversion['author']      = '';
+		$modversion['contact']     = '';
+		$modversion['admin']       = 0;
+	    if (file_exists("modules/$fos/Version.php")) {
             include "modules/$fos/Version.php";
-		} else if (file_exists("modules/$fos/pnversion.php")) {
+    	} else if (file_exists("modules/$fos/pnversion.php")) {
             include "modules/$fos/pnversion.php";
-		} else if (file_exists("system/$fos/Version.php")) {
+	    } else if (file_exists("system/$fos/Version.php")) {
             include "system/$fos/Version.php";
-		} else if (file_exists("system/$fos/pnversion.php")) {
+	    } else if (file_exists("system/$fos/pnversion.php")) {
             include "system/$fos/pnversion.php";
         } else {
             $modversion['name'] = $f;
@@ -116,41 +119,42 @@
         }
 
 		// check for the existence of the files
-		if (!file_exists('modules/'.$mod['directory'].'/'.$modversion['credits']) && 
-		    !file_exists('system/'.$mod['directory'].'/'.$modversion['credits'])) {
-				$modversion['credits'] = '';
+		if (!file_exists('modules/'.$mod['directory'].'/'.$modversion['credits']) &&
+			!file_exists('system/'.$mod['directory'].'/'.$modversion['credits'])) {
+			$modversion['credits'] = '';
 		}
-		if (!file_exists('modules/'.$mod['directory'].'/'.$modversion['help']) && 
-		    !file_exists('system/'.$mod['directory'].'/'.$modversion['help'])) {
-				$modversion['help'] = '';
+		if (!file_exists('modules/'.$mod['directory'].'/'.$modversion['help']) &&
+			!file_exists('system/'.$mod['directory'].'/'.$modversion['help'])) {
+			$modversion['help'] = '';
 		}
-		if (!file_exists('modules/'.$mod['directory'].'/'.$modversion['changelog']) && 
-		    !file_exists('system/'.$mod['directory'].'/'.$modversion['changelog'])) {
-				$modversion['changelog'] = '';
+		if (!file_exists('modules/'.$mod['directory'].'/'.$modversion['changelog']) &&
+			!file_exists('system/'.$mod['directory'].'/'.$modversion['changelog'])) {
+			$modversion['changelog'] = '';
 		}
-		if (!file_exists('modules/'.$mod['directory'].'/'.$modversion['license']) && 
-		    !file_exists('system/'.$mod['directory'].'/'.$modversion['license'])) {
-				$modversion['license'] = '';
+		if (!file_exists('modules/'.$mod['directory'].'/'.$modversion['license']) &&
+			!file_exists('system/'.$mod['directory'].'/'.$modversion['license'])) {
+			$modversion['license'] = '';
 		}
-
-		// explode the contact and author arrays to allow for 
+	
+		// explode the contact and author arrays to allow for
 		// multiple authors and contacts
 		$modversion['author'] = explode(',', $modversion['author']);
 		$modversion['contact'] = explode(',', $modversion['contact']);
 
 		// check if an e-mail address is given as the contact
 		foreach($modversion['contact'] as $key => $contact) {
-			$key = trim($key);
 			$contact = trim($contact);
 			if (eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $contact)) {
-				$modversion['contact'][$key] = 'mailto:' . $contact; 
-			}
+				$modversion['contact'][$key] = 'mailto:' . $contact;
+			} else {
+                $modversion['contact'][$key] = $contact;
+            }
 		}
 		$modules[] = $modversion;
     }
 
     // assign content to user
-	$pnRender->assign('modules', $modules);
+    $pnRender->assign('modules', $modules);
 
     return $pnRender->fetch('credits_user_main.htm');
 }
@@ -160,7 +164,7 @@
  *
  * Displays modules documentation
  * @author Rob Brandt
- * @version $Revision: 1.32 $
+ * @version $Revision: 1.32.2.1 $
  * @return HTML output string
  * @todo add support for user mods in system directory
  * @todo template output
@@ -173,8 +177,8 @@
 
 	list($mod,
 	     $filetype) = pnVarCleanFromInput('mod',
-		                                  'filetype');
-	extract($args);
+									  	  'filetype');
+	  extract($args);
 
 	// work out the version number, the display name for the module (or core)
 	// and the directory(ies) to locate the files
@@ -186,7 +190,7 @@
 		$moduledir1 = 'docs/';
 		$moduledir2 = '';
 	} else {
-		$modinfo = pnModGetInfo(pnModGetIDFromName($mod));
+		$modinfo =& pnModGetInfo(pnModGetIDFromName($mod));
 		if (!is_array($modinfo)) {
 			return pnVarPrepHTMLDisplay(_CREDITSNOEXIST);
 		}
@@ -194,36 +198,36 @@
 		$moduledir2 = 'system/';
 	}
 
-	// locate the correct file
+    // locate the correct file
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
-	$pnRender =& new pnRender('Credits');
+    $pnRender =& new pnRender('Credits');
 
-	// For caching reasons you must pass a cache ID. This could be done as a 
+	// For caching reasons you must pass a cache ID. This could be done as a
 	// separate parameter to every method that uses caching (like fetch, is_cached
 	// etc.) or by assigning the ID to the cache_id property like it is done in
-	// this case. 
+	// this case.
 	// In this case we use hash of the path and filename
 	$pnRender->cache_id = md5($modinfo['directory'].$filetype);
 
 	// check out if the contents are cached.
 	// If this is the case, we do not need to make DB queries.
 	if ($pnRender->is_cached('credits_user_display.htm')) {
-	   return $pnRender->fetch('credits_user_display.htm');
+		return $pnRender->fetch('credits_user_display.htm');
 	}
 
 	// now lets locate the module version info
 	if ($mod == 'core') {
 		switch ($filetype) {
-			case 'credits':
-				$filename = 'docs/CREDITS.txt';
-				break;
-			case 'help':
-				$filename = 'docs/manual.txt';
-				break;
-			case 'license':
-				$filename = 'docs/COPYING.txt';
-				break;
+		case 'credits':
+			$filename = 'docs/CREDITS.txt';
+			break;
+		case 'help':
+			$filename = 'docs/manual.txt';
+			break;
+		case 'license':
+			$filename = 'docs/COPYING.txt';
+			break;
 		}
 	} else {
 		$f = $modinfo['directory'];
@@ -277,15 +281,15 @@
 	}
 
     // assign the values to the template
-	$pnRender->assign('heading', constant('_CREDITS' . strtoupper($filetype)));
-	$pnRender->assign($modinfo);
-	$pnRender->assign('thefile', $thefile);
-	$pnRender->assign('filetype', $filetype);
+    $pnRender->assign('heading', constant('_CREDITS' . strtoupper($filetype)));
+    $pnRender->assign($modinfo);
+    $pnRender->assign('thefile', $thefile);
+    $pnRender->assign('filetype', $filetype);
 
-	// create a fake numeric item id to allow display hooks work properly
-	$pnRender->assign('itemid', $pnRender->cache_id);
+    // create a fake numeric item id to allow display hooks work properly
+    $pnRender->assign('itemid', $pnRender->cache_id);
 
-	return $pnRender->fetch('credits_user_display.htm');
+    return $pnRender->fetch('credits_user_display.htm');
 }
 
 ?>
\ No newline at end of file
diff -ruN 0.761/modules/Downloads/admin.php 0.762/modules/Downloads/admin.php
--- 0.761/modules/Downloads/admin.php	2005-02-22 12:54:32.000000000 -0600
+++ 0.762/modules/Downloads/admin.php	2006-01-12 08:44:06.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: admin.php,v 1.35 2005/02/22 18:54:32 larsneo Exp $
+// File: $Id: admin.php,v 1.38 2006/01/12 14:44:06 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -38,7 +38,6 @@
 include_once ("modules/$ModName/dl-categories.php");
 include_once ("modules/$ModName/dl-util.php");
 
-if (pnSecAuthAction(0, "Downloads::", "::", ACCESS_ADMIN)) {
 
 /**
  * Downloads Modified Web Downloads
@@ -345,21 +344,21 @@
         echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";  // changed layout into a table
         echo " <tr><td colspan=\"4\">"
         .'<strong>'._DOWNLOADID.": $lid</strong></td></tr>"
-        ."\n<tr><td colspan=\"4\">"._DOWNLOADNAME.": <input type=\"text\" name=\"title\" value=\"$title\" size=\"50\" maxlength=\"100\" /></td></tr>"
-        ."\n<tr><td colspan=\"4\">"._FILEURL.": <input type=\"text\" name=\"url\" value=\"$url\" size=\"50\" maxlength=\"254\" />&nbsp;[ <a href=\"$url\">"._CHECK."</a> ]</td></tr>"
-        ."\n<tr><td colspan=\"4\">"._DESCRIPTION.": <br /><textarea name=\"description\" cols=\"80\" rows=\"10\">$description</textarea></td></tr>"
-        ."\n<tr><td colspan=\"4\">"._AUTHORNAME.": <input type=\"text\" name=\"name\" size=\"20\" maxlength=\"100\" value=\"$name\" />&nbsp;&nbsp;"
-        .""._AUTHOREMAIL.": <input type=\"text\" name=\"email\" size=\"20\" maxlength=\"100\" value=\"$email\" /></td></tr>"
-        ."\n<tr><td colspan=\"4\">"._FILESIZE.": <input type=\"text\" name=\"filesize\" size=\"12\" maxlength=\"11\" value=\"$filesize\" /></td></tr>"
-        ."\n<tr><td colspan=\"4\">"._VERSION.": <input type=\"text\" name=\"version\" size=\"11\" maxlength=\"10\" value=\"$version\" /></td></tr>"
-        ."\n<tr><td colspan=\"4\">"._HOMEPAGE.": <input type=\"text\" name=\"homepage\" size=\"50\" maxlength=\"200\" value=\"http://$homepage\" /> [ <a href=\"http://$homepage\">"._VISIT."</a> ]</td></tr>"
-        ."\n<tr><td colspan=\"4\">"._HITS.": <input type=\"text\" name=\"hits\" value=\"$hits\" size=\"12\" maxlength=\"11\" /></td></tr>";
+        ."\n<tr><td colspan=\"4\">"._DOWNLOADNAME.": <input type=\"text\" name=\"title\" value=\"".pnVarPrepForDisplay($title)."\" size=\"50\" maxlength=\"100\" /></td></tr>"
+        ."\n<tr><td colspan=\"4\">"._FILEURL.": <input type=\"text\" name=\"url\" value=\"$url\" size=\"50\" maxlength=\"254\" />&nbsp;[ <a href=\"".pnVarPrepForDisplay($url)."\">"._CHECK."</a> ]</td></tr>"
+        ."\n<tr><td colspan=\"4\">"._DESCRIPTION.": <br /><textarea name=\"description\" cols=\"80\" rows=\"10\">".pnVarPrepForDisplay($description)."</textarea></td></tr>"
+        ."\n<tr><td colspan=\"4\">"._AUTHORNAME.": <input type=\"text\" name=\"name\" size=\"20\" maxlength=\"100\" value=\"".pnVarPrepForDisplay($name)."\" />&nbsp;&nbsp;"
+        .""._AUTHOREMAIL.": <input type=\"text\" name=\"email\" size=\"20\" maxlength=\"100\" value=\"".pnVarPrepForDisplay($email)."\" /></td></tr>"
+        ."\n<tr><td colspan=\"4\">"._FILESIZE.": <input type=\"text\" name=\"filesize\" size=\"12\" maxlength=\"11\" value=\"".pnVarPrepForDisplay($filesize)."\" /></td></tr>"
+        ."\n<tr><td colspan=\"4\">"._VERSION.": <input type=\"text\" name=\"version\" size=\"11\" maxlength=\"10\" value=\"".pnVarPrepForDisplay($version)."\" /></td></tr>"
+        ."\n<tr><td colspan=\"4\">"._HOMEPAGE.": <input type=\"text\" name=\"homepage\" size=\"50\" maxlength=\"200\" value=\"http://".pnVarPrepForDisplay($homepage)."\" /> [ <a href=\"http://".pnVarPrepForDisplay($homepage)."\">"._VISIT."</a> ]</td></tr>"
+        ."\n<tr><td colspan=\"4\">"._HITS.": <input type=\"text\" name=\"hits\" value=\"".pnVarPrepForDisplay($hits)."\" size=\"12\" maxlength=\"11\" /></td></tr>";
         $column = &$pntable['downloads_categories_column'];
         $result2 =& $dbconn->Execute("SELECT $column[cid],
                                           $column[title]
                                    FROM $pntable[downloads_categories]
                                    ORDER BY $column[title]");
-        echo "<tr><td valign=\"top\"><input type=\"hidden\" name=\"lid\" value=\"$lid\" />"
+        echo "<tr><td valign=\"top\"><input type=\"hidden\" name=\"lid\" value=\"".(int)$lid."\" />"
         .""._CATEGORY.": <select name=\"cat\">";
 
         while(list($ccid, $ctitle) = $result2->fields) {
@@ -718,13 +717,13 @@
     $totalbrokendownloads = $result->PO_RecordCount();
     echo '<h2>'._DUSERREPBROKEN." (".pnVarPrepForDisplay($totalbrokendownloads).")</h2><div style=\"text-align:center\">"
     .""._DIGNOREINFO.'<br />'
-    .""._DDELETEINFO.'</div><br />'
-    ."<table width=\"100%\">";
+    .""._DDELETEINFO.'</div><br />';
     if ($totalbrokendownloads==0) {
         echo '<h2>'._DNOREPORTEDBROKEN.'</h2>';
     } else {
         $colorswitch = $GLOBALS['bgcolor2'];
-        echo "<tr>"
+        echo "<table width=\"100%\">"
+            ."<tr>"
             ."<td><strong>"._DOWNLOAD."</strong></td>"
             ."<td><strong>"._SUBMITTER."</strong></td>"
             ."<td><strong>"._DOWNLOADOWNER."</strong></td>"
@@ -761,16 +760,16 @@
             ."<td style=\"background-color:$colorswitch\"><a href=\"$url\">".pnVarPrepForDisplay($title)."</a>"
             ."</td>";
             if ($email=='') {
-        echo "<td style=\"background-color:$colorswitch\">".pnVarPrepForDisplay($modifysubmitter)."";
-        } else {
-        echo "<td style=\"background-color:$colorswitch\"><a href=\"mailto:$email\">".pnVarPrepForDisplay($modifysubmitter)."</a>";
-        }
+                echo "<td style=\"background-color:$colorswitch\">".pnVarPrepForDisplay($modifysubmitter)."";
+            } else {
+                echo "<td style=\"background-color:$colorswitch\"><a href=\"mailto:$email\">".pnVarPrepForDisplay($modifysubmitter)."</a>";
+            }
             echo "</td>";
             if ($owneremail=='') {
-        echo "<td style=\"background-color:$colorswitch\">".pnVarPrepForDisplay($owner)."";
-        } else {
-        echo "<td style=\"background-color:$colorswitch\"><a href=\"mailto:$owneremail\">".pnVarPrepForDisplay($owner)."</a>";
-        }
+                echo "<td style=\"background-color:$colorswitch\">".pnVarPrepForDisplay($owner)."";
+            } else {
+                 echo "<td style=\"background-color:$colorswitch\"><a href=\"mailto:$owneremail\">".pnVarPrepForDisplay($owner)."</a>";
+            }
             echo "</td>"
             ."<td style=\"background-color:$colorswitch\"><div style=\"text-align:center\"><a href=\"admin.php?module=".$GLOBALS['module']."&amp;op=DownloadsIgnoreBrokenDownloads&amp;lid=$lid&amp;authid=" . pnSecGenAuthKey() . "\">X</a></div>"
             ."</td>"
@@ -778,15 +777,15 @@
             ."</td>"
             ."<td style=\"background-color:$colorswitch\"><div style=\"text-align:center\"><a href=\"admin.php?module=".$GLOBALS['module']."&amp;op=DownloadsModDownload&amp;lid=$lid&amp;authid=" . pnSecGenAuthKey() . "\">X</a></div>"
             ."</td>"
-        ."</tr>";
+            ."</tr>";
             if ($colorswitch == $GLOBALS['bgcolor2']) {
-        $colorswitch = $GLOBALS['bgcolor1'];
+                $colorswitch = $GLOBALS['bgcolor1'];
             } else {
-        $colorswitch = $GLOBALS['bgcolor2'];
-        }
+                $colorswitch = $GLOBALS['bgcolor2'];
+            }
         }
+        echo "</table>";
     }
-    echo "</table>";
     CloseTable();
     include 'footer.php';
 }
@@ -944,7 +943,7 @@
             ."<tr><td valign=\"top\" style=\"width:45%\"><span class=\"pn-sub\">"._AUTHOREMAIL.": ".pnVarPrepForDisplay($origemail)."</span></td></tr>"
             ."<tr><td valign=\"top\" style=\"width:45%\"><span class=\"pn-sub\">"._FILESIZE.": ".pnVarPrepForDisplay($origfilesize)."</span></td></tr>"
             ."<tr><td valign=\"top\" style=\"width:45%\"><span class=\"pn-sub\">"._VERSION.": ".pnVarPrepForDisplay($origversion)."</span></td></tr>"
-            ."<tr><td valign=\"top\" style=\"width:45%\"><span class=\"pn-sub\">"._HOMEPAGE.": <a href=\"$orighomepage\">".pnVarPrepForDisplay($orighomepage)."</a></span></td></tr>"
+            ."<tr><td valign=\"top\" style=\"width:45%\"><span class=\"pn-sub\">"._HOMEPAGE.": <a href=\"".pnVarPrepForDisplay($orighomepage)."\">".pnVarPrepForDisplay($orighomepage)."</a></span></td></tr>"
             ."</table>"
             ."</td>"
             ."</tr>"
@@ -963,7 +962,7 @@
             ."<tr><td valign=\"top\" style=\"width:45%\"><span class=\"pn-sub\">"._AUTHOREMAIL.": ".pnVarPrepForDisplay($email)."</span></td></tr>"
             ."<tr><td valign=\"top\" style=\"width:45%\"><span class=\"pn-sub\">"._FILESIZE.": ".pnVarPrepForDisplay($filesize)."</span></td></tr>"
             ."<tr><td valign=\"top\" style=\"width:45%\"><span class=\"pn-sub\">"._VERSION.": ".pnVarPrepForDisplay($version)."</span></td></tr>"
-            ."<tr><td valign=\"top\" style=\"width:45%\"><span class=\"pn-sub\">"._HOMEPAGE.": <a href=\"$homepage\">".pnVarPrepForDisplay($homepage)."</a></span></td></tr>"
+            ."<tr><td valign=\"top\" style=\"width:45%\"><span class=\"pn-sub\">"._HOMEPAGE.": <a href=\"".pnVarPrepForDisplay($homepage)."\">".pnVarPrepForDisplay($homepage)."</a></span></td></tr>"
             ."</table>"
             ."</td>"
             ."</tr>"
@@ -1039,7 +1038,7 @@
                               $column[filesize]='" . pnVarPrepForStore($filesize) . "',
                               $column[version]='" . pnVarPrepForStore($version) . "',
                               $column[homepage]='" . pnVarPrepForStore($homepage) . "'
-                        WHERE $column[lid] = '" . pnVarPrepForStore($lid)."'");
+                        WHERE $column[lid] = '" . (int)pnVarPrepForStore($lid)."'");
 
 		$changerow = &$pntable['downloads_modrequest_column']['requestid'];
         $dbconn->Execute("DELETE FROM $pntable[downloads_modrequest]
@@ -1643,6 +1642,12 @@
 
     include ('header.php');
 
+    if (!pnSecAuthAction(0, "Downloads::", "::", ACCESS_ADMIN)) {
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+
     // prepare vars
     $sel_perpage['10'] = '';
     $sel_perpage['15'] = '';
@@ -1812,6 +1817,13 @@
 
 function downloads_admin_setConfig($var) {
 
+    if (!pnSecAuthAction(0, "Downloads::", "::", ACCESS_ADMIN)) {
+        include('header.php');
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+
     // Escape some characters in these variables.
     // hehe, I like doing this, much cleaner :-)
     $fixvars = array();
@@ -1840,6 +1852,12 @@
 }
 
 function downloads_admin_main($var) {
+    if (!pnSecAuthAction(0, "Downloads::", "::", ACCESS_ADMIN)) {
+        include('header.php');
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
     $op = pnVarCleanFromInput('op');
     extract($var);
     switch ($op)
@@ -1956,8 +1974,5 @@
                     downloads();
                     break;
       }
-   }
-} else {
-    echo "Access Denied";
 }
 ?>
\ No newline at end of file
diff -ruN 0.761/modules/Downloads/dl-categories.php 0.762/modules/Downloads/dl-categories.php
--- 0.761/modules/Downloads/dl-categories.php	2005-02-16 07:49:03.000000000 -0600
+++ 0.762/modules/Downloads/dl-categories.php	2005-12-15 15:22:00.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: dl-categories.php,v 1.41 2005/02/16 13:49:03 markwest Exp $
+// File: $Id: dl-categories.php,v 1.42 2005/12/15 21:22:00 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -839,7 +839,7 @@
 		if ($homepage == "") {
 			echo '<br />';
 		} else {
-			echo "<br /><a href=\"$homepage\">"._HOMEPAGE."</a> | ";
+			echo "<br /><a href=\"".pnVarPrepForDisplay($homepage)."\">"._HOMEPAGE."</a> | ";
 		}
 
 		if (downloads_authitem((downloads_ItemCIDFromLID($lid)), (downloads_ItemSIDFromLID($lid)), $lid, ACCESS_COMMENT) ) {
diff -ruN 0.761/modules/Ephemerids/pnadmin.php 0.762/modules/Ephemerids/pnadmin.php
--- 0.761/modules/Ephemerids/pnadmin.php	2005-01-10 08:37:56.000000000 -0600
+++ 0.762/modules/Ephemerids/pnadmin.php	2006-01-12 07:27:08.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.24 2005/01/10 14:37:56 markwest Exp $
+// $Id: pnadmin.php,v 1.24.2.1 2006/01/12 13:27:08 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -600,6 +600,12 @@
  */
 function Ephemerids_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Ephemerids::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
diff -ruN 0.761/modules/Example/pnadmin.php 0.762/modules/Example/pnadmin.php
--- 0.761/modules/Example/pnadmin.php	2005-08-28 16:38:44.000000000 -0500
+++ 0.762/modules/Example/pnadmin.php	2006-01-12 05:59:12.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.33.2.1 2005/08/28 21:38:44 markwest Exp $
+// $Id: pnadmin.php,v 1.33.2.2 2006/01/12 11:59:12 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -35,7 +35,7 @@
  *
  * @package      PostNuke_Miscellaneous_Modules
  * @subpackage   Example
- * @version      $Id: pnadmin.php,v 1.33.2.1 2005/08/28 21:38:44 markwest Exp $
+ * @version      $Id: pnadmin.php,v 1.33.2.2 2006/01/12 11:59:12 markwest Exp $
  * @author       Jim McDonald
  * @author       The PostNuke Development Team
  * @link         http://www.postnuke.com  The PostNuke Home Page
@@ -495,16 +495,18 @@
  */
 function Example_admin_view()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Example::', '::', ACCESS_EDIT)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
     // assumptions that will not hold in future versions of PostNuke
     $startnum = pnVarCleanFromInput('startnum');
 
-    if (!pnSecAuthAction(0, 'Example::', '::', ACCESS_EDIT)) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
     $pnRender =& new pnRender('Example');
@@ -624,6 +626,12 @@
  */
 function Example_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Example::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
diff -ruN 0.761/modules/FAQ/admin.php 0.762/modules/FAQ/admin.php
--- 0.761/modules/FAQ/admin.php	2005-02-04 00:30:27.000000000 -0600
+++ 0.762/modules/FAQ/admin.php	2006-01-12 08:38:18.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: admin.php,v 1.36 2005/02/04 06:30:27 jorg Exp $
+// File: $Id: admin.php,v 1.37 2006/01/12 14:38:18 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -34,8 +34,6 @@
 
 $ModName = basename(dirname( __FILE__ ));
 
-if (pnSecAuthAction(0, 'FAQ::', '::', ACCESS_ADMIN)) {
-
 modules_get_language();
 modules_get_manual();
 
@@ -49,6 +47,12 @@
 {
     include 'header.php';
 
+    if (!pnSecAuthAction(0, 'FAQ::', '::', ACCESS_ADMIN)) {
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
@@ -139,6 +143,12 @@
 {
     include 'header.php';
 
+    if (!pnSecAuthAction(0, 'FAQ::', '::', ACCESS_ADMIN)) {
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
@@ -190,6 +200,12 @@
 {
     include 'header.php';
 
+    if (!pnSecAuthAction(0, 'FAQ::', '::', ACCESS_ADMIN)) {
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
@@ -263,6 +279,13 @@
 
 function faq_admin_FaqCatGoSave($var)
 {
+    if (!pnSecAuthAction(0, 'FAQ::', '::', ACCESS_ADMIN)) {
+        include('header.php');
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+
     list($id,
          $id_cat,
          $question,
@@ -319,6 +342,13 @@
 
 function faq_admin_FaqCatGoAdd($var)
 {
+    if (!pnSecAuthAction(0, 'FAQ::', '::', ACCESS_ADMIN)) {
+        include('header.php');
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+
     list($id_cat,
          $question,
          $answer) = pnVarCleanFromInput('id_cat',
@@ -363,6 +393,13 @@
 
 function faq_admin_FaqCatGoDel($var)
 {
+    if (!pnSecAuthAction(0, 'FAQ::', '::', ACCESS_ADMIN)) {
+        include('header.php');
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+
     $authid = pnVarCleanFromInput('authid');
 
     if (!pnSecConfirmAuthKey()) {
@@ -407,6 +444,12 @@
 {
     include 'header.php';
 
+    if (!pnSecAuthAction(0, 'FAQ::', '::', ACCESS_ADMIN)) {
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
@@ -451,8 +494,4 @@
     include 'footer.php';
 }
 
-} else {
-    echo 'Access Denied';
-}
-
 ?>
\ No newline at end of file
diff -ruN 0.761/modules/FAQ/index.php 0.762/modules/FAQ/index.php
--- 0.761/modules/FAQ/index.php	2005-09-27 04:01:52.000000000 -0500
+++ 0.762/modules/FAQ/index.php	2006-02-09 07:40:06.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: index.php,v 1.56 2005/09/27 09:01:52 chestnut Exp $
+// $Id: index.php,v 1.59 2006/02/09 13:40:06 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -46,7 +46,7 @@
 modules_get_language();
 
 // Security check
-if (!pnSecAuthAction(0, 'FAQ::', '::', ACCESS_READ)) {
+if (!pnSecAuthAction(0, 'FAQ::', '::', ACCESS_OVERVIEW)) {
     include 'header.php';
     echo _BADAUTHKEY;
     include 'footer.php';
@@ -146,7 +146,7 @@
             echo '<ul>';
         }
 
-        $requesturi = pnServerGetVar('REQUEST_URI');
+        $requesturi = pnVarPrepForDisplay(pnServerGetVar('REQUEST_URI'));
         while(list($id, $id_cat, $question, $answer) = $result->fields) {
             $result->MoveNext();
             list($answer) = pnModCallHooks('item', 'transform', '', array($answer));
diff -ruN 0.761/modules/Groups/pnadmin.php 0.762/modules/Groups/pnadmin.php
--- 0.761/modules/Groups/pnadmin.php	2005-07-24 17:24:55.000000000 -0500
+++ 0.762/modules/Groups/pnadmin.php	2006-01-12 07:03:22.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.42 2005/07/24 22:24:55 markwest Exp $
+// $Id: pnadmin.php,v 1.42.2.1 2006/01/12 13:03:22 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -41,19 +41,12 @@
  * designer feels should be the default function (often this is the
  * view() function)
  * @author Mark West
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @return string HTML output string
  * @todo template output
  */
 function Groups_admin_main()
 {
-    // Create output object - this object will store all of our output so that
-    // we can return it easily when required
-    $pnRender =& new pnRender('Groups');
-
-    // As Admin output changes often, we do not want caching.
-    $pnRender->caching = false;
-
     // Security check - important to do this as early as possible to avoid
     // potential security holes or just too much wasted processing.  For the
     // main function we want to check that the user has at least edit privilege
@@ -79,6 +72,13 @@
         return pnVarPrepHTMLDisplay(_MODULENOAUTH);
     }
 
+    // Create output object - this object will store all of our output so that
+    // we can return it easily when required
+    $pnRender =& new pnRender('Groups');
+
+    // As Admin output changes often, we do not want caching.
+    $pnRender->caching = false;
+
     // Return the output that has been generated by this function
     return $pnRender->fetch('groups_admin_main.htm');
 }
@@ -88,12 +88,18 @@
  * This is a standard function that is called whenever an administrator
  * wishes to create a new group
  * @author Mark West
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @return string HTML output string
  * @todo template output
  */
 function Groups_admin_new()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Groups::', '::', ACCESS_ADD)) {
+        pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
     $pnRender =& new pnRender('Groups');
@@ -101,12 +107,6 @@
     // As Admin output changes often, we do not want caching.
     $pnRender->caching = false;
 
-    // Security check - important to do this as early as possible to avoid
-    // potential security holes or just too much wasted processing
-    if (!pnSecAuthAction(0, 'Groups::', '::', ACCESS_ADD)) {
-        pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     // Return the output that has been generated by this function
     return $pnRender->fetch('groups_admin_new.htm');
 }
@@ -115,7 +115,7 @@
  * This is a standard function that is called with the results of the
  * form supplied by groups admin_new() to create a new group
  * @author Mark West
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @param string 'name' the name of the group to be created
  * @return bool true if group created succesfully, false otherwise
  */
@@ -148,14 +148,6 @@
     // the security check is carried out within the API function and as such we
     // do not duplicate the work here
 
-    // Load API.  All of the actual work for the creation of the new item is
-    // done within the API, so we need to load that in before we can do
-    // anything.  If the API fails to load an appropriate error message is
-    // posted and the function returns
-    if (!pnModAPILoad('Groups', 'admin')) {
-        return pnVarPrepHTMLDisplay(_LOADFAILED);
-    }
-
     // The API function is called.  Note that the name of the API function and
     // the name of this function are identical, this helps a lot when
     // programming more complex modules.  The arguments to the function are
@@ -197,7 +189,7 @@
  * This is a standard function that is called whenever an administrator
  * wishes to modify a current group item
  * @author Mark West
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @param int 'gid' the id of the group to be modified
  * @param int 'objectid' generic object id mapped onto gid if present
  * @return string HTML output string
@@ -234,21 +226,6 @@
         $gid = $objectid;
     }
 
-    // Create output object - this object will store all of our output so that
-    // we can return it easily when required
-    $pnRender =& new pnRender('Groups');
-
-    // As Admin output changes often, we do not want caching.
-    $pnRender->caching = false;
-
-    // Load API.  Note that this is loading the user API, that is because the
-    // user API contains the function to obtain item information which is the
-    // first thing that we need to do.  If the API fails to load an appropriate
-    // error message is posted and the function returns
-    if (!pnModAPILoad('Groups', 'user')) {
-        return pnVarPrepHTMLDisplay(_LOADFAILED);
-    }
-
     // The user API function is called.  This takes the item ID which we
     // obtained from the input and gets us the information on the appropriate
     // item.  If the item does not exist we post an appropriate message and
@@ -271,6 +248,13 @@
         return pnVarPrepHTMLDisplay(_MODULENOAUTH);
     }
 
+    // Create output object - this object will store all of our output so that
+    // we can return it easily when required
+    $pnRender =& new pnRender('Groups');
+
+    // As Admin output changes often, we do not want caching.
+    $pnRender->caching = false;
+
     // Add a hidden variable for the item id.  This needs to be passed on to
     // the update function so that it knows which item for which item to carry
     // out the update
@@ -288,7 +272,7 @@
  * This is a standard function that is called with the results of the
  * form supplied by groups_admin_modify() to update a current group item
  * @author Mark West
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @param int 'gid' the id of the group to be modified
  * @param int 'objectid' generic object id mapped onto gid if present
  * @param string 'name' the name of the group to be updated
@@ -340,14 +324,6 @@
     // the security check is carried out within the API function and as such we
     // do not duplicate the work here
 
-    // Load API.  All of the actual work for the update of the new item is done
-    // within the API, so we need to load that in before we can do anything.
-    // If the API fails to load an appropriate error message is posted and the
-    // function returns
-    if (!pnModAPILoad('Groups', 'admin')) {
-        return pnVarPrepHTMLDisplay(_LOADFAILED);
-    }
-
     // The API function is called.  Note that the name of the API function and
     // the name of this function are identical, this helps a lot when
     // programming more complex modules.  The arguments to the function are
@@ -386,7 +362,7 @@
  * other, so either or both can be used as seen appropriate by the module
  * developer
  * @author Mark West
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @param int 'gid' the id of the item to be deleted
  * @param bool 'confirmation' confirmation that this item can be deleted
  * @param int 'objectid' generic object id mapped onto gid if present
@@ -426,14 +402,6 @@
          $gid = $objectid;
      }
 
-    // Load API.  Note that this is loading the user API, that is because the
-    // user API contains the function to obtain item information which is the
-    // first thing that we need to do.  If the API fails to load an appropriate
-    // error message is posted and the function returns
-    if (!pnModAPILoad('Groups', 'user')) {
-        return pnVarPrepHTMLDisplay(_LOADFAILED);
-    }
-
     // The user API function is called.  This takes the item ID which we
     // obtained from the input and gets us the information on the appropriate
     // item.  If the item does not exist we post an appropriate message and
@@ -500,14 +468,6 @@
         return true;
     }
 
-    // Load API.  All of the actual work for the deletion of the item is done
-    // within the API, so we need to load that in before before we can do
-    // anything.  If the API fails to load an appropriate error message is
-    // posted and the function returns
-    if (!pnModAPILoad('Groups', 'admin')) {
-        return pnVarPrepHTMLDisplay(_LOADFAILED);
-    }
-
     // The API function is called.  Note that the name of the API function and
     // the name of this function are identical, this helps a lot when
     // programming more complex modules.  The arguments to the function are
@@ -537,7 +497,7 @@
  * View all groups
  * this function creates a tabular output of all group items in the module
  * @author Mark West
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @return string HTML output string
  * @todo template output
  * @todo add pager for function
@@ -550,21 +510,12 @@
     // assumptions that will not hold in future versions of PostNuke
     $startnum = pnVarCleanFromInput('startnum');
 
-    // Load API.  Note that this is loading the user API, that is because the
-    // user API contains the function to obtain item information which is the
-    // first thing that we need to do.  If the API fails to load an appropriate
-    // error message is posted and the function returns
-    if (!pnModAPILoad('Groups', 'user')) {
-        return pnVarPrepHTMLDisplay(_LOADFAILED);
-    }
-
     // we need this value multiple times, so we keep it
     $itemsperpage = pnModGetVar('Groups', 'itemsperpage');
 
     // get th defaul user group
     $defaultgroup = pnModGetVar('Groups', 'defaultgroup');
 
-
     // The user API function is called.  This takes the number of items
     // required and the first number in the list of all items, which we
     // obtained from the input and gets us the information on the appropriate
@@ -638,7 +589,7 @@
  * This is a standard function to display members of a group
  * @author Mark West
  * @link http://www.markwest.me.uk/
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @param int 'gid' the id of the group to list membership for
  * @param int 'objectid' generic object id mapped onto gid if present
  * @return string HTML output string
@@ -692,6 +643,12 @@
         $letter = 'A';
     }
 
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Groups::', "$item[name]::$item[gid]", ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
     $pnRender =& new pnRender('Groups');
@@ -699,23 +656,9 @@
     // As Admin output changes often, we do not want caching.
     $pnRender->caching = false;
 
-    // Security check - important to do this as early as possible to avoid
-    // potential security holes or just too much wasted processing
-    if (!pnSecAuthAction(0, 'Groups::', "$item[name]::$item[gid]", ACCESS_ADMIN)) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     // add group id to form as hidden component
     $pnRender->assign('gid', $gid);
 
-    // Load API.  Note that this is loading the user API, that is because the
-    // user API contains the function to obtain item information which is the
-    // first thing that we need to do.  If the API fails to load an appropriate
-    // error message is posted and the function returns
-    if (!pnModAPILoad('Groups', 'user')) {
-        return pnVarPrepHTMLDisplay(_LOADFAILED);
-    }
-
     // The user API function is called.  This takes the number of items
     // required and the first number in the list of all items, which we
     // obtained from the input and gets us the information on the appropriate
@@ -826,7 +769,7 @@
 /**
  * This is a standard function to add a user to a group
  * @author Mark West
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @param int 'gid' the id of the group
  * @param mixed 'uid' the id of the user (int) or an array of userids
  * @return string true is user added succesfully, false otherwise
@@ -858,14 +801,6 @@
         return true;
     }
 
-    // Load API.  All of the actual work for the update of the new item is done
-    // within the API, so we need to load that in before we can do anything.
-    // If the API fails to load an appropriate error message is posted and the
-    // function returns
-    if (!pnModAPILoad('Groups', 'admin')) {
-        return pnVarPrepHTMLDisplay(_LOADFAILED);
-    }
-
     // The API function is called.  Note that the name of the API function and
     // the name of this function are identical, this helps a lot when
     // programming more complex modules.  The arguments to the function are
@@ -909,7 +844,7 @@
 /**
  * This is a standard function to add a user to a group
  * @author Mark West
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @param int 'gid' the id of the group
  * @param int 'uid' the id of the user
  * @return string true is user added succesfully, false otherwise
@@ -941,14 +876,6 @@
         return true;
     }
 
-    // Load API.  All of the actual work for the update of the new item is done
-    // within the API, so we need to load that in before we can do anything.
-    // If the API fails to load an appropriate error message is posted and the
-    // function returns
-    if (!pnModAPILoad('Groups', 'admin')) {
-        return pnVarPrepHTMLDisplay(_LOADFAILED);
-    }
-
     // The API function is called.  Note that the name of the API function and
     // the name of this function are identical, this helps a lot when
     // programming more complex modules.  The arguments to the function are
@@ -980,12 +907,18 @@
  * This is a standard function to modify the configuration parameters of the
  * module
  * @author Mark West
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @since 1.14
  * @return string HTML string
  */
 function Groups_admin_modifyconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Groups::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
     $pnRender =& new pnRender('Groups');
@@ -993,20 +926,9 @@
     // As Admin output changes often, we do not want caching.
     $pnRender->caching = false;
 
-    // Security check - important to do this as early as possible to avoid
-    // potential security holes or just too much wasted processing
-    if (!pnSecAuthAction(0, 'Groups::', '::', ACCESS_ADMIN)) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     // assign the module vars
     $pnRender->assign(pnModGetVar('Groups'));
 
-    // load the user API
-    if (!pnModAPILoad('Groups', 'user')) {
-        return pnVarPrepHTMLDisplay(_LOADFAILED);
-    }
-
     // get all groups from the API
     $groups = pnModAPIFunc('Groups', 'user', 'getall');
 
@@ -1027,12 +949,18 @@
  * This is a standard function to update the configuration parameters of the
  * module given the information passed back by the modification form
  * @author Mark West
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.42.2.1 $
  * @since 1.14
  * @return bool true
  */
 function Groups_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Groups::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
diff -ruN 0.761/modules/Languages/admin.php 0.762/modules/Languages/admin.php
--- 0.761/modules/Languages/admin.php	2005-07-02 14:56:53.000000000 -0500
+++ 0.762/modules/Languages/admin.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,775 +0,0 @@
-<?php
-// $Id: admin.php,v 1.10 2005/07/02 19:56:53 jorg Exp $
-// ----------------------------------------------------------------------
-// PostNuke Content Management System
-// Copyright (C) 2001 by the PostNuke Development Team.
-// http://www.postnuke.com/
-// ----------------------------------------------------------------------
-// Based on:
-// PHP-NUKE Web Portal System - http://phpnuke.org/
-// Thatware - http://thatware.org/
-// ----------------------------------------------------------------------
-// LICENSE
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License (GPL)
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// To read the license please visit http://www.gnu.org/copyleft/gpl.html
-// ----------------------------------------------------------------------
-// Original Author of file: PN boys and girls band
-// Purpose of file: language file management
-// ----------------------------------------------------------------------
-
-if (!defined('LOADED_AS_MODULE')) { die ('Access Denied'); }
-
-   include_once('modules/Languages/menu.php');
-   include_once('modules/Languages/database.php');
-   modules_get_language();
-   modules_get_manual();
-
-   function languages_option($module,$op,$language,$text,$img)
-   {
-      menu_add_option('admin.php?module='.$module.'&amp;op='.$op.'&amp;language='.$language,$text,$img);
-   }
-
-   function languages_menu($module,$language)
-   {
-      menu_title('admin.php?module='.$module.'&amp;op=main&amp;language='.$language,_LANG_CURENT.' : '.language_name($language));
-      menu_graphic(false);
-      menu_help();
-      languages_option($module,'getConfig',$language,_LANGCONF,'');
-      languages_option($module,'select',$language,_LANG_SELECT,'');
-      languages_option($module,'constant',$language,_LANG_LOAD_CONSTANT,'');
-      languages_option($module,'translation',$language,_LANG_LOAD_TRANSLATION,'');
-      languages_option($module,'missing',$language,_LANG_ADD_MISSING,'');
-      languages_option($module,'generate',$language,_LANG_GENERATE,'');
-//    languages_option($module,'hardcode',$language,_LANG_HARDCODE,'');
-   }
-
-   function languages_file($file)
-   {
-
-      $part = explode('/',substr($file,2));
-      if (!isset($part[3])) $part[3] = '';
-      if ($part[0]=='modules')
-      {
-         if ($part[2]=='api.php')
-            return 'GLOBAL';
-         if (($part[2]=='data.php') or ($part[2].'/'.$part[3]=='admin/links') or $part[1].'/'.$part[2]=='NS-Admin/tools.php')
-            return 'ADMIN';
-         if ($part[1].'/'.$part[2]=='NS-User/tools.php')
-            return 'USER';
-         if ($part[2]=='pnblocks')
-            return 'NONCOREBLOCK-'.$part[1].'-'.ereg_replace('\.php$','',$part[2]);
-         if (($part[2]=='pnadmin.php') or ($part[2]=='pnadminapi.php') or ($part[2]=='pnuser.php') or ($part[2]=='pnuserapi.php') or ($part[2]=='pninit.php'))
-            return 'NEWMODULE-'.$part[1].'-'.ereg_replace('\.php$','',$part[2]);
-         if (substr($part[1],0,3)=='NS-')
-            $part[1][2] = '_';
-//            $part[1] = substr($part[1],3);
-         return 'MODULE-'.$part[1];
-      }
-      elseif (($part[0]=='includes') and ($part[1]=='blocks'))
-         return 'COREBLOCK-'.ereg_replace('\.php$','',$part[2]);
-      elseif ($part[0]=='install')
-      {
-         return 'INSTALL';
-      }
-      elseif ($part[0]=='admin.php')
-      {
-         return 'ADMIN';
-      }
-      elseif ($part[0]=='themes')
-      {
-            return 'THEME-'.$part[1];
-      }
-      elseif ($part[0]=='user.php')
-      {
-         return 'USER';
-      }
-      elseif ($part[0]=='banners.php')
-      {
-         return 'BANNERS';
-      }
-      elseif ($part[0]=='error.php')
-      {
-         return 'ERROR';
-      }
-      else
-      {
-         return 'GLOBAL';
-      }
-   }
-
-   function languages_choice_file($file1,$file2)
-   {
-      if ($file1=='GLOBAL' or $file2=='GLOBAL')
-         return 'GLOBAL';
-      elseif ($file1==$file2)
-         return $file1;
-      else
-         return 'GLOBAL';
-   }
-
-   function languages_extract_constant($file,$line)
-   {
-      $pntable =& pnDBGetTables();
-	
-	  @set_time_limit(300);
-      static $file_list = array();
-      $count = preg_match_all('/\b(_[0-9A-Z]+)+\b/',$line,$matches);
-      $file = languages_file($file);
-//      echo "$file<br />";
-      for ($i=0;$i<$count;$i++)
-      {
-         $constant = $matches[0][$i];
-         mysql_query("insert into ".$pntable['languages_constant']." (pn_constant,pn_file) values('" . pnVarPrepForStore($constant) . "','" . pnVarPrepForStore($file) . "')");
-         if (mysql_errno()==1062)
-         {
-            list($old_file) = db_select_one_row("SELECT pn_file FROM ".$pntable['languages_constant']." where pn_constant='" . pnVarPrepForStore($constant) . "'");
-            $file2 = languages_choice_file($file,$old_file);
-//            echo "$file , $old_file => $file2 ($constant)<br />";
-                if ($file2!=$old_file)
-               mysql_query("update ".$pntable['languages_constant']." set pn_file='" . pnVarPrepForStore($file2) . "' where pn_constant='" . pnVarPrepForStore($constant) . "'");
-         }
-         elseif (mysql_errno()!=0)
-           echo '('.mysql_errno().') '.mysql_error().'<br />';
-         else
-            $file2 = $file;
-         if (!isset($file_list[$file2]))
-         {
-            $file_list[$file2] = '';
-            $part = explode('-',$file2);
-            if ($part[0]=='GLOBAL')
-               $target = 'language/$language/global.php';
-            elseif ($part[0]=='MODULE') {
-               if (substr($part[1],0,3)=='NS_')
-                   $part[1][2] = '-';
-               $target = 'modules/'.$part[1].'/lang/$language/global.php';
-            }
-            elseif ($part[0]=='NEWMODULE') {
-               if (substr($part[2],0,2)=='pn')
-                   $part[2] = substr($part[2],2);
-               $target = 'modules/'.$part[1].'/pnlang/$language/'.$part[2].'.php';
-            }
-            elseif (($part[0]=='THEME'))
-               $target = 'themes/'.$part[1].'/lang/$language/global.php';
-            elseif (($part[0]=='COREBLOCK'))
-               $target = 'includes/language/blocks/$language/'.$part[1].'.php';
-            elseif (($part[0]=='NONCOREBLOCK'))
-               $target = 'modules/'.$part[1].'/pnlang/$language/'.$part[2].'.php';
-            elseif (($part[0]=='ADMIN'))
-               $target = 'language/$language/admin.php';
-            elseif (($part[0]=='USER'))
-               $target = 'language/$language/user.php';
-            elseif (($part[0]=='BANNERS'))
-               $target = 'language/$language/banners.php';
-            elseif (($part[0]=='ERROR'))
-               $target = 'language/$language/error.php';
-            elseif (($part[0]=='INSTALL'))
-               $target = 'install/lang/$language/global.php';
-            else
-               die('target unknown : '.$file2.'/'.$file);
-            mysql_query("insert into ".$pntable['languages_file']." (pn_target,pn_source) values('" . pnVarPrepForStore($target) . "','" . pnVarPrepForStore($file2) . "')");
-            if ((mysql_errno()!=0) and (mysql_errno()!=1062))
-               echo '('.mysql_errno().') '.mysql_error().'<br />';
-         }
-      }
-
-      mysql_query("delete from ".$pntable['languages_constant']." where pn_constant like '_ADODB%' or pn_constant like '_PNMODULE_STATE%' or pn_constant like '_PN_VERSION%' or pn_constant like '_UDCONST%' or pn_constant  like '_TYPOCODE%' or pn_constant = '_TW' or pn_constant ='_TB' or pn_constant='_TP' or pn_constant ='_FP' or pn_constant = '_FB' or pn_constant = '_FW' or pn_constant = '_PEAR' or pn_constant = '_SYLLABELS' or pn_constant = '_MAKEPASS_BOX' or pn_constant = '_MAKEPASS_LEN' or pn_constant = '_PN_CONFIG_MODULE' or pn_constant = '_PNH_KEEPOUTPUT' or pn_constant = '_PNH_PARSEINPUT' or pn_constant = '_PNH_RETURNOUTPUT' or pn_constant = '_PNH_VERBATIMINPUT' or pn_constant = '_PNNO' or pn_constant = '_PNPERMS_ALL' or pn_constant = '_PNPERMS_UNREGISTERED' or pn_constant = '_PNYES' or pn_constant = '_PNYES' or pn_constant = '_T' or pn_constant = '_BLANK' or pn_constant = '_DEFAULT' or pn_constant = '_POSTNUKE' or pn_constant = '_WIKI' or pn_constant = '_BBCODE'");
-
-   }
-
-   function languages_dir_walk($dir)
-   {
-      if (!$handle=@opendir($dir)) return;
-      while ($file=readdir($handle))
-      {
-         if ($file=='.');
-         elseif ($file=='..');
-         elseif (ereg('\.php$',$file))
-            languages_extract_constant($dir.'/'.$file,implode('',file($dir.'/'.$file)));
-         elseif ($file=='lang');
-         elseif ($file=='pnlang');
-         elseif ($file=='language');
-         elseif (!ereg('\.',$file))
-            languages_dir_walk($dir.'/'.$file);
-      }
-      closedir($handle);
-   }
-
-function languages_admin_getConfig($var) {
-
-    // prepare vars
-	$sel_lang[pnConfigGetVar('language')] = ' selected="selected"';
-    $sel_multilingual['0'] = '';
-    $sel_multilingual['1'] = '';
-    $sel_multilingual[pnConfigGetVar('multilingual')] = ' checked="checked"';
-    $sel_useflags['0'] = '';
-    $sel_useflags['1'] = '';
-    $sel_useflags[pnConfigGetVar('useflags')] = ' checked="checked"';
-	$sel_langdetect['0'] = '';
-	$sel_langdetect['1'] = '';
-	$sel_langdetect[pnConfigGetVar('language_detect')] = ' checked="checked"';
-
-//    GraphicAdmin();
-    if (!isset($var['language'])) $var['language'] = pnUserGetLang();
-    languages_menu($var['module'],$var['language']);
-	include ('header.php');
-    menu_draw();
-    OpenTable();
-    print '<h1>'._LANGCONF.'</h1>'
-          .'<form action="admin.php" method="post"><div>'
-          .'<table border="0"><tr><td>'
-          ._SELLANGUAGE.':</td><td>'
-          .'<select name="xlanguage">';
-    $lang = languagelist();
-    $handle = opendir('language');
-    while ($f = readdir($handle)) {
-        if (is_dir("language/$f") && (!empty($lang[$f]))) {
-            $langlist[$f] = $lang[$f];
-        }
-    }
-    asort($langlist);
-	//  a bit ugly, but it works in E_ALL conditions (Andy Varganov)
-	foreach ($langlist as $k=>$v) {
-		echo '<option value="'.$k.'"';
-			if (isset($sel_lang[$k])) echo ' selected="selected"';
-		echo '>'. $v . "</option>\n";
-	}
-	echo '</select>'
-	.'</td></tr><tr><td>'
-	._ACTMULTILINGUAL.'</td><td>'
-	."<input type=\"radio\" name=\"xmultilingual\" value=\"1\" ".$sel_multilingual['1']." />"._YES.' &nbsp;'
-	."<input type=\"radio\" name=\"xmultilingual\" value=\"0\" ".$sel_multilingual['0']." />"._NO
-	.'</td></tr><tr><td>'
-	._ACTUSEFLAGS.'</td><td>'
-	."<input type=\"radio\" name=\"xuseflags\" value=\"1\" ".$sel_useflags['1']." />"._YES." &nbsp;"
-	."<input type=\"radio\" name=\"xuseflags\" value=\"0\" ".$sel_useflags['0']." />"._NO
-	.'</td></tr><tr><td>'
-	._ACTAUTODETECT.'</td><td>'
-	."<input type=\"radio\" name=\"xlanguage_detect\" value=\"1\" ".$sel_langdetect['1']." />"._YES." &nbsp;"
-	."<input type=\"radio\" name=\"xlanguage_detect\" value=\"0\" ".$sel_langdetect['0']." />"._NO
-	.'</td></tr><tr><td>'
-	."<input type=\"hidden\" name=\"module\" value=\"".$GLOBALS['module']."\" />"
-	."<input type=\"hidden\" name=\"op\" value=\"setConfig\" />"
-	.'<input type="hidden" name="authid" value="' . pnSecGenAuthKey() . '" />'
-	."<input type=\"submit\" value=\""._SUBMIT."\" />"
-	.'</td></tr></table>'
-	."</div></form>";
-    CloseTable();
-    include ('footer.php');
-}
-
-function languages_admin_setConfig($var) {
-
-    // Escape some characters in these variables.
-    // hehe, I like doing this, much cleaner :-)
-    $fixvars = array (
-        );
-
-    // todo: make FixConfigQuotes global / replace with other function
-    foreach ($fixvars as $v) {
-   //   $var[$v] = FixConfigQuotes($var[$v]);
-    }
-
-    // Set any numerical variables that havn't been set, to 0. i.e. paranoia check :-)
-    $fixvars = array (
-    );
-    foreach ($fixvars as $v) {
-        if (empty($var[$v])) {
-            $var[$v] = 0;
-        }
-    }
-
-    // all variables starting with x are the config vars.
-    while (list ($key, $val) = each ($var)) {
-        if (substr($key, 0, 1) == 'x') {
-            pnConfigSetVar(substr($key, 1), $val);
-        }
-    }
-    pnRedirect('admin.php?module=Languages&op=getConfig');
-}
-
-   function languages_admin_main($var)
-   {
-      $pntable =& pnDBGetTables();
-      $dbconn =& pnDBGetConn(true);
-      if (!isset($var['language'])) $var['language'] = pnUserGetLang();
-      languages_menu($var['module'],$var['language']);
-      $language = $var['language'];
-      include 'header.php';
-      menu_draw();
-      $result =& $dbconn->Execute("SELECT count(1) FROM ".$pntable['languages_constant']);
-      list($num) = $result->fields;
-      opentable();
-      echo _LANG_NUM_CONSTANT.' : '.$num."\n";
-      echo '<br />'."\n";
-      closetable();
-      echo '<br />'."\n";
-      opentable();
-      $result =& $dbconn->Execute("SELECT pn_language,
-                                         COUNT(B.pn_translation),
-                                         SUM(pn_level)
-                                  FROM $pntable[languages_constant] A
-                                  LEFT JOIN $pntable[languages_translation] B ON A.pn_constant=B.pn_constant
-                                  WHERE pn_language IS NOT NULL
-                                  GROUP BY pn_language");
-      if ($num==0)
-         $link = '[ <a href="admin.php?module='.$var['module'].'&amp;op=constant&amp;language='.$language.'">'._LANG_LOAD_CONSTANT.'</a> ]';
-      else
-         $link = '[ <a href="admin.php?module='.$var['module'].'&amp;op=constant&amp;language='.$language.'">'._LANG_RELOAD_CONSTANT.'</a> ]';
-      echo  _LANG_NUM_TRANSLATION."\n"
-           .'<br />'."\n"
-           .'<table>'."\n"
-           .'<tr><td>'._LANGUAGE.'</td><td>'._LANG_LANGUAGES_NUMBER.'</td><td>'._LANG_MISSING_NUMBER.'</td><td>'._LANG_DEFAULT_TRANSLATION.'</td><td>'._NEXT_OP_TODO.'</td></tr>'."\n"
-           .'<tr><td>'._LANG_OBJECTIVE.'</td><td>'.$num.'</td><td>0</td><td>0</td><td>'.$link.'</td></tr>'."\n";
-      while (!$result->EOF)
-      {
-         list($language,$total,$total3) = $result->fields;
-         $total2 = $num - $total;
-         $total3 = $total - $total3;
-         if ($num==0)
-            $link = '';
-         elseif ($total2==0)
-            $link = '[ <a href="admin.php?module='.$var['module'].'&amp;op=generate&amp;language='.$language.'">'._LANG_GENERATE.'</a> ]';
-         else
-            $link = '[ <a href="admin.php?module='.$var['module'].'&amp;op=missing&amp;language='.$language.'">'._LANG_ADD_MISSING.'</a> ]';
-         echo '<tr><td>'.language_name($language).'</td><td>'.$total.'</td><td>'.$total2.'</td><td>'.$total3.'</td><td>'.$link.'</td</tr>'."\n";
-         $result->MoveNext();
-      }
-      echo '</table>'."\n";
-      closetable();
-      echo '<br />'."\n";
-      opentable();
-      $result =& $dbconn->Execute("SELECT A.pn_source,
-                                         A.pn_target,
-                                         COUNT(B.pn_constant),
-                                         COUNT(C.pn_translation),
-                                         SUM(pn_level)
-                                  FROM $pntable[languages_file] A,
-                                       $pntable[languages_constant] B
-                                  LEFT JOIN $pntable[languages_translation] C ON B.pn_constant=C.pn_constant
-                                        AND pn_language='" . pnVarPrepForStore($var['language']) . "'
-                                  WHERE A.pn_source=B.pn_file
-                                  GROUP by B.pn_file");
-      //echo '<table>'."\n";
-      echo  _LANG_FILE_TARGET."\n"
-           .'<br />'."\n"
-           .'<table>'."\n"
-           .'<tr><td>'._TARGET.'</td><td>'._LANG_FILE.'</td><td>'._LANG_LANGUAGES_NUMBER.'</td><td>'._LANG_MISSING_NUMBER.'</td><td>'._LANG_DEFAULT_TRANSLATION.'</td></tr>'."\n";
-      while (!$result->EOF)
-      {
-         list($file,$target,$total,$total2,$total3) = $result->fields;
-         $total2 = $total - $total2;
-         $total3 = $total - $total3;
-         echo '<tr><td>'.$file.'</td><td>'.$target.'</td><td>'.$total.'</td><td>'.$total2.'</td><td>'.$total3.'</td></tr>'."\n";
-         $result->MoveNext();
-      }
-      echo '</table>'."\n";
-      closetable();
-      echo '<br />'."\n";
-      include 'footer.php';
-   }
-
-   function languages_admin_select($var)
-   {
-      if (!isset($var['language'])) $var['language'] = 'eng';
-      languages_menu($var['module'],$var['language']);
-      include 'header.php';
-      menu_draw();
-      opentable();
-      echo  '<form action="admin.php" method="get"><div>'."\n"
-           ._LANGUAGE.' : <select name="language">'."\n";
-      $handle = opendir('language');
-      while ($file=readdir($handle))
-      {
-         if (!ereg('\.|html|CVS',$file))
-         {
-            $lang = substr($file,0,strlen($file));
-            echo '<option value="'.$lang.'"';
-            if ($lang==$var['language']) echo ' selected="selected"';
-            echo '>'.language_name($lang).'</option>'."\n";
-         }
-      }
-      closedir($handle);
-      echo '</select>'."\n"
-            .'<input type="hidden" name="module" value="'.$var['module'].'" />'."\n"
-            .'<input type="hidden" name="op" value="main" />'."\n"
-            .'<input type="hidden" name="authid" value="' . pnSecGenAuthKey() . '" />'."\n"
-            .'<input type="submit" value="'._LANG_SELECT.'" />'."\n"
-            .'</div></form>'."\n";
-      closetable();
-      include 'footer.php';
-   }
-
-   function languages_admin_constant($var)
-   {
-      $pntable =& pnDBGetTables();
-      db_delete("delete from ".$pntable['languages_constant']);
-      db_delete("delete from ".$pntable['languages_file']);
-      languages_dir_walk('.');
-      if (!isset($var['language'])) $var['language'] = 'eng';
-      languages_menu($var['module'],$var['language']);
-      include 'header.php';
-      menu_draw();
-      opentable();
-      echo ""._CONSTANTSLOADING." "._CLICKLINK." <strong>"._LANG_LOAD_TRANSLATION."</strong> \n";
-      closetable();
-      include 'footer.php';
-   }
-   function languages_extract_translation($file,$language,$line)
-   {
-      $pntable =& pnDBGetTables();
-      $dbconn =& pnDBGetConn(true);
-      $i = strpos($line,'define(');
-      if ($i===false) return;
-      $line = substr($line,$i+7);
-      $i = strpos($line,')');
-      $line = substr($line,0,$i);
-      $i = strpos($line,',');
-      $constant = trim(substr($line,0,$i));
-      $text = trim(substr($line,$i+1));
-      $constant = substr($constant,1,strlen($constant)-2);
-      $text = substr($text,1,strlen($text)-2);
-      if (($constant==$text) or (substr($text,0,2)=='&&'))
-       {
-          $text = $constant;
-          $sql = "insert into
-                 ".$pntable['languages_translation']."
-                  (pn_language,pn_constant,pn_translation,pn_level)
-                   values('" . pnVarPrepForStore($language) . "','" . pnVarPrepForStore($constant) . "','" . pnVarPrepForStore($text) . "',0)";
-       }
-       else
-       {
-          $sql = "insert into
-                 ".$pntable['languages_translation']."
-                  (pn_language,pn_constant,pn_translation,pn_level)
-                  values('" . pnVarPrepForStore($language) . "','" . pnVarPrepForStore($constant) . "','" . pnVarPrepForStore($text) . "',1)";
-          $dbconn->Execute($sql);
-          if (mysql_errno()!=0 and mysql_errno()!=1062)
-            {
-              echo '('.mysql_errno().')'.mysql_error().'<br />'.$sql.'<br />///'.$text."///<br />\n";
-            }
-       }
-   }
-
-   function languages_get_file($file,$language)
-   {
-      echo $file.'<br />'."\n";
-      $content = file($file);
-      foreach ($content as $num=>$line)
-         languages_extract_translation($file,$language,$line);
-   }
-
-   function languages_get_dir($dir,$language)
-   {
-      if (!$handle=@opendir($dir)) return;
-      while ($file=readdir($handle))
-      {
-         if ($file=='.');
-         elseif ($file=='..');
-         elseif (ereg('\.php$',$file))
-            languages_get_file($dir.'/'.$file,$language);
-      }
-      closedir($handle);
-   }
-
-   function languages_languages_walk($dir,$language)
-   {
-      if (!$handle=@opendir($dir)) return;
-      while ($file=readdir($handle))
-      {
-         if ($file=='.');
-         elseif ($file=='..');
-         elseif ($file==$language.'.php')
-            languages_get_file($dir.'/'.$file,$language);
-         elseif ($file==$language)
-            languages_get_dir($dir.'/'.$file,$language);
-         elseif (!ereg('\.',$file))
-            languages_languages_walk($dir.'/'.$file,$language);
-      }
-      closedir($handle);
-   }
-
-   function languages_admin_translation($var)
-   {
-      $pntable =& pnDBGetTables();
-      $dbconn =& pnDBGetConn(true);
-      if (!isset($var['language'])) $var['language'] = 'eng';
-      $sql ="delete from ".$pntable['languages_translation']." where pn_language='".pnVarPrepForStore($var['language'])."'";
-            $result =& $dbconn->Execute($sql);
-                  if ($result===false) die(mysql_error().'<br />'.$sql);
-      if (file_exists($file='language/'.$var['language'].'/personnal.php'))
-         languages_get_file($file,$var['language']);
-      languages_menu($var['module'],$var['language']);
-      include 'header.php';
-      menu_draw();
-      opentable();
-         echo  ""._TRANSLATIONSLOADING." <strong>".$var['language'].'</strong> '._CLICKLINK." <strong>"._LANG_ADD_MISSING.'</strong><br />'."\n";
-      echo '<strong>'._ADMINTRANSLATION." :</strong><br />"."\n";
-         if (file_exists($file='language/'.$var['language'].'/personnal.php'))
-         languages_get_file($file,$var['language']);
-      if (file_exists($file='language/'.$var['language'].'/missing.php'))
-         languages_get_file($file,$var['language']);
-      languages_languages_walk('includes/language',$var['language']);
-      languages_languages_walk('install/lang',$var['language']);
-      languages_languages_walk('modules',$var['language']);
-      languages_languages_walk('themes',$var['language']);
-      if (file_exists($file='language/'.$var['language'].'/global.php'))
-         languages_get_file($file,$var['language']);
-      if (file_exists($file='language/'.$var['language'].'/admin.php'))
-         languages_get_file($file,$var['language']);
-      if (file_exists($file='language/'.$var['language'].'/user.php'))
-         languages_get_file($file,$var['language']);
-      if (file_exists($file='language/'.$var['language'].'/banners.php'))
-         languages_get_file($file,$var['language']);
-      if (file_exists($file='language/'.$var['language'].'/error.php'))
-         languages_get_file($file,$var['language']);
-      if (file_exists($file='language/'.$var['language'].'/total.php'))
-         languages_get_file($file,$var['language']);
-      if (file_exists($file='language/'.$var['language'].'/default.php'))
-         languages_get_file($file,$var['language']);
-
-      closetable();
-      include 'footer.php';
-   }
-
-   function languages_admin_missing($var)
-   {
-      $pntable =& pnDBGetTables();
-      $dbconn =& pnDBGetConn(true);
-      if (!isset($var['language'])) $var['language'] = 'eng';
-     $constcolumn = $pntable['languages_constant_column'];
-     $transcolumn = $pntable['languages_translation_column'];
-    //     $sql = "select A.$constcolumn[constant] from ".$pntable['languages_constant']." A left join ".$pntable['languages_translation']." B on A.$constcolumn[constant] =B.$transcolumn[constant] and B.$transcolumn[language]='".$var['language']."' where B.$transcolumn[constant] IS NULL";
-   //  $sql = "select A.pn_constant from ".$pntable['languages_constant']." A left join ".$pntable['languages_translation']." B on A.pn_constant =B.pn_constant and B.pn_language='".$var['language']."' where B.pn_constant IS NULL";
-    $sql = "select A.pn_constant, A.pn_file from ".$pntable['languages_constant']." A left join ".$pntable['languages_translation']." B on A.pn_constant =B.pn_constant and B.pn_language='".$var['language']."' where B.pn_constant IS NULL ORDER BY A.pn_file, A.pn_constant";
-
-      $result =& $dbconn->Execute($sql);
-      if (mysql_errno()!=0)
-         die(mysql_error().'<br />'.$sql);
-      languages_menu($var['module'],$var['language']);
-      include 'header.php';
-      menu_draw();
-      opentable();
-      echo  '<br />'._ADDMISSING." "._CLICKLINK." <strong>"._LANG_GENERATE.'</strong><br />'."\n";
-        $currentfileid = "";
-      while (!$result->EOF)
-      {
-            list($constant, $fileid) = $result->fields;
-
-             if ($fileid != $currentfileid) {
-             $sql2 = "select pn_target from ".$pntable['languages_file']." where pn_source = '".$fileid."'";
-             $result2 =& $dbconn->Execute($sql2);
-             list($filename) = $result2->fields;
-             if ($currentfileid != "") {
-                echo '<br />';
-             }
-                  $language = $var['language'];
-             eval("\$filename = \"$filename\";");
-             echo '<strong>'. $filename . ":</strong><br />";
-             $currentfileid = $fileid;
-         }
-
-         $translation = '';
-           if ($var['language']!='eng')
-         list($translation) = mysql_fetch_row(mysql_query("select pn_translation from ".$pntable['languages_translation']." where pn_constant = '$constant'"));
-         if ($translation=='') $translation = $constant;
-         $dbconn->Execute("insert into ".$pntable['languages_translation']." (pn_language,pn_constant,pn_translation,pn_level) values('".pnVarPrepForStore($var['language'])."','" . pnVarPrepForStore($constant) . "','".pnVarPrepForStore($translation)."',0)");
-         echo $var['language'].' : '.$constant.' => '.$translation."<br />\n";
-         $result->MoveNext();
-      }
-      closetable();
-      include 'footer.php';
-   }
-//==================================================================================================================================
-// Language hardcode traitment
-//==================================================================================================================================
-   function languages_extract_constant_to_hardcode($file,$line)
-   {
-
-      $pntable =& pnDBGetTables();
-      $count = preg_match_all('/\b(_[0-9A-Z]+)+\b/',$line,$matches);
-      for ($i=0;$i<$count;$i++)
-      {
-         $result = mysql_query('select pn_translation from '.$pntable['languages_translation']." where pn_constant='".pnVarPrepForStore($matches[0][$i])."'");
-         if (mysql_errno()!=0)
-           echo '('.mysql_errno().') '.mysql_error().'<br />';
-         if(!list($translation)=mysql_fetch_row($result)) $translation = $matches[0][$i];
-
-         $line = preg_replace('/\b'.$matches[0][$i].'\b/','"'.$translation.'"',$line);
-         echo "\$line = ereg_replace('/\b'".$matches[0][$i]."'\b/','\"'".$translation."'\"',\$line);<br />";
-      }
-      $handle = fopen($file,'w');
-      if (!$handle) die('Unable  to open '.$file.'<br />'.ereg_replace('<','&lt;',$line));
-      fwrite($handle,$line);
-   }
-
-   function languages_dir_walk_to_hardcode($dir)
-   {
-      if (!$handle=@opendir($dir)) return;
-      while ($file=readdir($handle))
-      {
-         if ($file=='.');
-         elseif ($file=='..');
-         elseif (ereg('\.php$',$file))
-            languages_extract_constant_to_hardcode($dir.'/'.$file,implode('',file($dir.'/'.$file)));
-         elseif ($file=='lang');
-         elseif ($file=='language');
-         elseif (!ereg('\.',$file))
-            languages_dir_walk_to_hardcode($dir.'/'.$file);
-      }
-      closedir($handle);
-   }
-
-   function languages_admin_hardcode($var)
-   {
-      $pntable =& pnDBGetTables();
-      $dbconn =& pnDBGetConn(true);
-      if (!isset($var['language'])) $var['language'] = 'eng';
-      $language = $var['language'];
-      languages_menu($var['module'],$var['language']);
-      include 'header.php';
-      menu_draw();
-      opentable();
-      languages_dir_walk_to_hardcode('.');
-      echo  _LANGUAGE_ALL_CONSTANT_HARDCODE.'<br />'."\n";
-      closetable();
-      include 'footer.php';
-   }
-
-   function languages_admin_generate($var)
-   {
-      $pntable =& pnDBGetTables();
-      $dbconn =& pnDBGetConn(true);
-      if (!isset($var['language'])) $var['language'] = 'eng';
-      $language = $var['language'];
-      languages_menu($var['module'],$var['language']);
-      include 'header.php';
-      menu_draw();
-      opentable();
-     echo  '<br />'._GENERATELANG2." <strong>".$var['language'].'</strong> '._GENERATELANG3."".$var['language'].".</strong><br />"._GENERATELANG4.'<br />'._ADMINTRANSLATION." :<br />"."\n";
-      $content = "<?php\n"
-                ."// Generated: \$d\$ by \$id\$\n"
-                ."// ----------------------------------------------------------------------\n"
-                ."// PostNuke Content Management System\n"
-                ."// Copyright (C) 2001 by the PostNuke Development Team.\n"
-                ."// http://www.postnuke.com/\n"
-                ."// ----------------------------------------------------------------------\n"
-                ."// Based on:\n"
-                ."// PHP-NUKE Web Portal System - http://phpnuke.org/\n"
-                ."// Thatware - http://thatware.org/\n"
-                ."// ----------------------------------------------------------------------\n"
-                ."// LICENSE\n"
-                ."//\n"
-                ."// This program is free software; you can redistribute it and/or\n"
-                ."// modify it under the terms of the GNU General Public License (GPL)\n"
-                ."// as published by the Free Software Foundation; either version 2\n"
-                ."// of the License, or (at your option) any later version.\n"
-                ."//\n"
-                ."// This program is distributed in the hope that it will be useful,\n"
-                ."// but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-                ."// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
-                ."// GNU General Public License for more details.\n"
-                ."//\n"
-                ."// To read the license please visit http://www.gnu.org/copyleft/gpl.html\n"
-                ."// ----------------------------------------------------------------------\n"
-                ."// Original Author of file: Everyone\n"
-                ."// Purpose of file: Translation files\n"
-                ."// Translation team: Read credits in /docs/CREDITS.txt\n"
-                ."// ----------------------------------------------------------------------\n";
-      $current_file = '';
-      $result =& $dbconn->Execute("SELECT pn_target,
-                                         B.pn_constant,
-                                         pn_translation,
-                                         pn_level
-                                  FROM $pntable[languages_file] A,
-                                       $pntable[languages_constant] B,
-                                       $pntable[languages_translation] C
-                                  WHERE A.pn_source = B.pn_file
-                                  AND B.pn_constant = C.pn_constant
-                                  AND pn_language='" . pnVarPrepForStore($language) . "'
-                                  ORDER BY pn_target,
-                                           pn_level,
-                                          B.pn_constant");
-      if (mysql_errno()!=0)
-         die(mysql_error());
-      $handle_total = fopen('language/'.$language.'/total.php','w');
-      fwrite($handle_total,$content);
-      $handle_missing = fopen('language/'.$language.'/missing.php','w');
-      fwrite($handle_missing,$content);
-      while (!$result->EOF)
-      {
-         list($file,$constant,$translation,$level) = $result->fields;
-         if ($current_file!=$file)
-         {
-         // echo("$current_file!=$file<br />");
-            if ($current_file!='')
-            {
-               fwrite($handle,"?>");
-               fclose($handle);
-            }
-            eval("\$filename = \"language_\$language/$file\";");
-            $part = explode('/',$filename);
-            if ($part[1]=='modules')
-               if (!file_exists('modules/'.$part[2]))
-                  $part[2] = substr($part[2],3);
-            $filename = '';
-            for ($i=0; $i < count($part)-1; $i++)
-            {
-               if(!file_exists($filename.=$part[$i].'/'))
-               {
-                  mkdir($filename,0777);
-                  echo ""._GENERATELANG." : ".$filename.'<br />';
-               }
-            }
-            $filename .= $part[count($part)-1];
-            echo ""._GENERATELANG1." : ".$filename.'<br />';
-            $handle = fopen($filename,'w');
-            if (!$handle) die(""._DIEOPEN." ".$filename.'<br />');
-            $current_file = $file;
-            fwrite($handle,$content);
-         }
-         //$translation = ereg_replace('"','\\"',$translation);
-         //$translation = ereg_replace("'","\'",$translation);
-
-         $translation = ereg_replace("'","\'",ereg_replace("''","'",$translation));
-         if ($language=='fra')
-         //   $html = array(''=>'&eacute;',''=>'&egrave;',''=>'&agrave;',''=>'&ecirc;',''=>'&circ;',''=>'$ocirc;');
-           $html = array('&eacute;'=>'','&egrave;'=>'','&agrave;'=>'','&ecirc;'=>';','&circ;'=>'','$ocirc;'=>'');
-        // this for croatian HTML char
-        elseif ($language=='cro')
-           $html = array('&#262;'=>'','&#263;'=>'','&#268;'=>'','&#269;'=>'','&#272;'=>'','&#273;'=>'','&#352;'=>'','&#353;'=>'','&#381;'=>'','&#382;'=>'',);
-        //end
-        else
-            $html = array();
-         foreach($html as $k=>$v) $translation = ereg_replace($k,$v,$translation);
-         if ($level==0)
-         {
-            fwrite($handle,"define('$constant','&&$constant (from $filename)');\n");
-            fwrite($handle_missing,"define('$constant','$constant'); //$translation ==> ". $filename . "\n");
-         }
-         else
-         {
-            fwrite($handle,"define('$constant','$translation');\n");
-            fwrite($handle_total,"define('$constant','$translation');\n");
-         }
-         $result->MoveNext();
-      }
-      fwrite($handle,"?>");
-      fclose($handle);
-      fwrite($handle_total,"?>");
-      fclose($handle_total);
-      fwrite($handle_missing,"?>");
-      fclose($handle_missing);
-      closetable();
-      include 'footer.php';
-   }
-?>
\ No newline at end of file
diff -ruN 0.761/modules/Languages/database.php 0.762/modules/Languages/database.php
--- 0.761/modules/Languages/database.php	2005-01-25 03:31:44.000000000 -0600
+++ 0.762/modules/Languages/database.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,86 +0,0 @@
-<?php
-   function db_num_rows($result)
-   {
-      return $result->PO_RecordCount();
-   }
-
-   function db_fetch_row($result)
-   {
-      $dbconn =& pnDBGetConn(true);
-      $row = $result->fields;
-      if($dbconn->ErrorNo()<>0)
-         die($dbconn->ErrorNo(). " : ".$dbconn->ErrorMsg().'<br />db_fetch_row()');
-      return $row;
-   }
-
-   function db_fetch_array($result)
-   {
-      $row = $result->GetRowAssoc(false);
-      $result->MoveNext();
-      if($dbconn->ErrorNo()<>0)
-         die($dbconn->ErrorNo(). " : ".$dbconn->ErrorMsg().'<br />db_fetch_array()');
-      return $row;
-   }
-
-   function db_select($sql)
-   {
-      $dbconn =& pnDBGetConn(true);
-      $result =& $dbconn->Execute($sql);
-      if($dbconn->ErrorNo()<>0)
-         die($dbconn->ErrorNo(). " : ".$dbconn->ErrorMsg()."<br />$sql");
-      return $result;
-   }
-
-   function db_select_one_row($sql)
-   {
-      $result = db_select($sql);
-      $return = db_fetch_row($result);
-      return $return;
-   }
-
-   function db_select_one_array($sql)
-   {
-      $result = db_select($sql);
-      $return = db_fetch_array($result);
-      return $return;
-   }
-
-   function db_select_all_row($sql)
-   {
-      $result = db_select($sql);
-      while ($return[]=db_fetch_row($result));
-      return $return;
-   }
-
-   function db_insert($sql)
-   {
-      $dbconn =& pnDBGetConn(true);
-      $dbconn->Execute($sql);
-      if($dbconn->ErrorNo()<>0)
-         die($dbconn->ErrorNo(). " : ".$dbconn->ErrorMsg()."<br />$sql");
-   }
-
-   function db_insert_auto($sql)
-   {
-      die ("auto increment not allowed");
-      return false;
-   }
-
-   function db_update($sql)
-   {
-      $dbconn =& pnDBGetConn(true);
-      $result =& $dbconn->Execute($sql);
-      if($dbconn->ErrorNo()<>0)
-         die($dbconn->ErrorNo(). " : ".$dbconn->ErrorMsg()."<br />$sql");
-      return $dbconn->Affected_Rows();
-   }
-
-   function db_delete($sql)
-   {
-      $dbconn =& pnDBGetConn(true);
-      $result =& $dbconn->Execute($sql);
-      if($dbconn->ErrorNo()<>0)
-         die($dbconn->ErrorNo(). " : ".$dbconn->ErrorMsg()."<br />$sql");
-      return $dbconn->Affected_Rows();
-   }
-?>
\ No newline at end of file
Files 0.761/modules/Languages/images/admin.gif and 0.762/modules/Languages/images/admin.gif differ
diff -ruN 0.761/modules/Languages/lang/eng/global.php 0.762/modules/Languages/lang/eng/global.php
--- 0.761/modules/Languages/lang/eng/global.php	2005-01-10 04:03:48.000000000 -0600
+++ 0.762/modules/Languages/lang/eng/global.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,64 +0,0 @@
-<?php
-// Generated: $d$ by $id$
-// ----------------------------------------------------------------------
-// PostNuke Content Management System
-// Copyright (C) 2001 by The PostNuke Development Team.
-// http://www.postnuke.com/
-// ----------------------------------------------------------------------
-// Based on:
-// PHP-NUKE Web Portal System - http://phpnuke.org/
-// Thatware - http://thatware.org/
-// ----------------------------------------------------------------------
-// LICENSE
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License (GPL)
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// To read the license please visit http://www.gnu.org/copyleft/gpl.html
-// ----------------------------------------------------------------------
-// Original Author of file: Everyone
-// Purpose of file: Translation files
-// Translation team: Read credits in /docs/CREDITS.txt
-// ----------------------------------------------------------------------
-define('_ACTMULTILINGUAL','Activate multilingual features');
-define('_ACTUSEFLAGS','Activate user flags');
-define('_ACTAUTODETECT', 'Auto detect language from browser settings');
-define('_ADDMISSING','All missing translations are stored in a file called \'missing.php\', which can be found in the directory called \'language\',');
-define('_ADMINTRANSLATION','Files list');
-define('_CLICKLINK','Please click on a link');
-define('_CONSTANTSLOADING','All constants have been loaded,');
-define('_DIEOPEN','Cannot open');
-define('_GENERATELANG','create');
-define('_GENERATELANG1','create file');
-define('_GENERATELANG2','All the files needed for your language system');
-define('_GENERATELANG3','have been created in the directory <strong>language_');
-define('_GENERATELANG4','Simply copy all files from this directory into the site\'s <strong>root</strong> directory, maintaining the tree structure of sub-directories.');
-define('_LANGCONF','Languages configuration');
-define('_LANGUAGE_ALL_CONSTANT_HARDCODE','All constants have been hard-coded');
-define('_LANG_ADD_MISSING','Add missing');
-define('_LANG_CURENT','Current language');
-define('_LANG_DEFAULT_TRANSLATION','Default');
-define('_LANG_FILE','Language file');
-define('_LANG_FILE_TARGET','Target file');
-define('_LANG_GENERATE','Generate');
-define('_LANG_HARDCODE','Hard-code');
-define('_LANG_LANGUAGES_NUMBER','Number of translation defines');
-define('_LANG_LOAD_CONSTANT','Constant loading');
-define('_LANG_LOAD_TRANSLATION','Load translation');
-define('_LANG_MISSING_NUMBER','Missing number');
-define('_LANG_NUM_CONSTANT','Constant number');
-define('_LANG_NUM_TRANSLATION','Translation number');
-define('_LANG_OBJECTIVE','Standard');
-define('_LANG_RELOAD_CONSTANT','Reload constant');
-define('_LANG_SELECT','Choose language');
-define('_NEXT_OP_TODO','Next step');
-define('_TARGET','To produce');
-define('_TRANSLATIONSLOADING','All translations have been loaded for');
-?>
\ No newline at end of file
diff -ruN 0.761/modules/Languages/menu.php 0.762/modules/Languages/menu.php
--- 0.761/modules/Languages/menu.php	2005-02-04 00:30:27.000000000 -0600
+++ 0.762/modules/Languages/menu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,230 +0,0 @@
-<?php
-// File: $Id: menu.php,v 1.3 2005/02/04 06:30:27 jorg Exp $
-// ----------------------------------------------------------------------
-// PostNuke Content Management System
-// Copyright (C) 2001 by the PostNuke Development Team.
-// http://www.postnuke.com/
-// ----------------------------------------------------------------------
-// Based on:
-// PHP-NUKE Web Portal System - http://phpnuke.org/
-// Thatware - http://thatware.org/
-// ----------------------------------------------------------------------
-// LICENSE
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License (GPL)
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// To read the license please visit http://www.gnu.org/copyleft/gpl.html
-// ----------------------------------------------------------------------
-// Original Author of file: Francisco Burzi
-// Purpose of file:
-// ----------------------------------------------------------------------
-
-class menu_object
-{
-      var $title_file;
-      var $title_text;
-      var $help_file;
-      var $help_text;
-      var $detail_menu  = true;
-      var $graphic_menu = true;
-      var $nb_column    = 6;
-      var $options      = array();
-
-      function menu_object($url,$text)
-      {
-         $this->title_file = $url;
-         $this->title_text = $text;
-      }
-
-      function set_help()
-      {
-      	 global $hlpfile;
-		 
-      	 $currentlang = pnUserGetLang();//fix bug: Admin Manual does not display by class007
-
-         if (file_exists($file="modules/".$GLOBALS['module']."/lang/".pnVarPrepForOS($currentlang)."/manual.html")) {
-            $hlpfile = $file;
-
-         }
-         $this->help_file = $file;
-         $this->help_text = _ONLINEMANUAL;
-      }
-
-      function set_detail($top)
-      {
-         $this->detail_menu = $top;
-      }
-
-      function set_graphic($top)
-      {
-         $this->graphic_menu = $top;
-      }
-
-      function add_option($url,$text,$image='')
-      {
-		global $ModName;
-      	$ModName = 'Languages';
-        modules_get_language('menu');  // cant give $ModName to function
-
-        $current = count($this->options);
-        $this->options[$current]['url'] = $url;
-        if (defined($text) && (phpversion() > "4.0.4")) {
-            $text = constant($text);
-        }
-        $this->options[$current]['text'] = $text;
-        $this->options[$current]['image'] = $image;
-      }
-
-      function draw_option_cell($url,$text,$image='')
-      {
-      	 $tdwidth = round(100/$this->nb_column);
-         echo  '<td align="center" style="width:'.$tdwidth.'%">';
-         if ($url!='') echo '<a href="'.$url.'">';
-         if ($image=='')
-            echo $text;
-         else
-            echo '<img src="'.$image.'" alt="'.pnVarPrepForDisplay($text).'" />';
-         if ($url!='') echo '</a>';
-         echo  '<br /><br /></td>'."\n";
-      }
-
-      function draw_options_graphic()
-      {
-         $nb_total = count($this->options);
-         $i = 0;
-         while ($i<$nb_total)
-         {
-            $j = 0;
-            $t = array();
-            echo '<tr>'."\n";
-            while (($j<$this->nb_column)and($i<$nb_total))
-            {
-               $this->draw_option_cell($this->options[$i]['url'],$this->options[$i]['text'],$this->options[$i]['image']);
-               $t[] = $this->options[$i];
-               $i++;
-               $j++;
-            }
-            echo  '</tr>'."\n"
-                 .'<tr>'."\n";
-            for ($k=0;$k<count($t);$k++)
-            {
-               $this->draw_option_cell($t[$k]['url'],$t[$k]['text']);
-            }
-            echo  '</tr>'."\n";
-         }
-      }
-
-      function draw_options()
-      {
-         $nb_total = count($this->options);
-         $i = 0;
-         while ($i<$nb_total)
-         {
-            echo '<tr>'."\n";
-            $j = 0;
-            while (($j<$this->nb_column)and($i<$nb_total))
-            {
-               $this->draw_option_cell($this->options[$i]['url'],$this->options[$i]['text']);
-               $i++;
-               $j++;
-            }
-            echo  '</tr>'."\n";
-         }
-      }
-
-      function draw_menu()
-      {
-         global $hlpfile;
-      	 $currentlang = pnVarCleanFromInput('currentlang');
-
-         OpenTable();
-         echo  '<div style="text-align:center">'."\n";
-         if (count($this->options) == 0) $this->title_file = '';
-         if ($this->title_file!='') echo '<a href="'.$this->title_file.'" class="pn-title">';
-         echo '<span class="pn-title"><strong>'.pnVarPrepForDisplay($this->title_text).'</strong></span>';
-         if ($this->title_file!='') echo '</a></div>';
-         echo  "\n"
-              .'<br />'."\n";
-     //    if (($this->detail_menu) or ($GLOBALS['module']=='oldway'))
-      //   {
-           // if (isset($this->help_file))
-           // {
-           	   $currentlang = pnUserGetLang(); // fixed bug [ #357 ] empty pop up window
-               if (file_exists($file="modules/".$GLOBALS['module']."/lang/".pnVarPrepForOS($currentlang)."/manual.html")) {
-                  $hlpfile = $file;                  
-      	          echo  '<div style="text-align:center">[ <a href="javascript:openwindow(\'' . $hlpfile . '\')" class="pn-normal">'._ONLINEMANUAL.'</a> ]'."</div>\n";
-               }
-          //  }
-     //    }
-         if ($this->detail_menu)
-         {
-            if (count($this->options) == 0)
-            {
-               echo _ADMIN_NO_OPTION."\n";
-            }
-            else
-            {
-              echo '<table border="0" width="100%" cellspacing="1">'."\n";
-               if ($this->graphic_menu)
-                  $this->draw_options_graphic();
-               else
-                  $this->draw_options();
-               echo  '</table>'."\n";
-            }
-         }
-         CloseTable();
-      }
-
-}
-//end of class menu_object
-
-/// Main code ///
-
-   function menu_action($action, $parm1='', $parm2='', $parm3='')
-   {
-      static $menu    = array(),
-             $current = -1;
-
-      if ($action=='title')
-      {
-         if ($current>=0) menu_detail(false);
-         $current++;
-         $menu[$current] = new menu_object($parm1,$parm2);
-      }
-      elseif ($action=='help')
-         $menu[$current]->set_help();
-      elseif ($action=='graphic')
-         $menu[$current]->set_graphic($parm1);
-      elseif ($action=='detail')
-         $menu[$current]->set_detail($parm1);
-      elseif ($action=='option')
-         $menu[$current]->add_option($parm1,$parm2,$parm3);
-      elseif ($action=='draw')
-      {
-         // standard admin menu [landseer]
-         GraphicAdmin();
-         foreach ($menu as $i=>$m)
-            $m->draw_menu();
-         $menu = array();
-         $current = -1;
-      }
-      else
-         die('fatal / admin/tools/menu.php');
-   }
-
-   function menu_title($file,$text)              {menu_action('title', $file, $text);}
-   function menu_help()                          {menu_action('help');}
-   function menu_graphic($top)                   {menu_action('graphic', $top);}
-   function menu_add_option($url,$text,$image)   {menu_action('option', $url, $text, $image);}
-   function menu_detail($top)                    {menu_action('detail', $top);}
-   function menu_draw()                          {menu_action('draw');}
-
-?>
\ No newline at end of file
diff -ruN 0.761/modules/Languages/pninit.php 0.762/modules/Languages/pninit.php
--- 0.761/modules/Languages/pninit.php	2005-02-19 12:47:01.000000000 -0600
+++ 0.762/modules/Languages/pninit.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,164 +0,0 @@
-<?php
-// $Id: pninit.php,v 1.2 2005/02/19 18:47:01 markwest Exp $
-// ----------------------------------------------------------------------
-// PostNuke Content Management System
-// Copyright (C) 2002 by the PostNuke Development Team.
-// http://www.postnuke.com/
-// ----------------------------------------------------------------------
-// Based on:
-// PHP-NUKE Web Portal System - http://phpnuke.org/
-// Thatware - http://thatware.org/
-// ----------------------------------------------------------------------
-// LICENSE
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License (GPL)
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// To read the license please visit http://www.gnu.org/copyleft/gpl.html
-// ----------------------------------------------------------------------
-
-
-/**
- * initialise the languages module
- *
- * This function is only ever called once during the lifetime of a particular
- * module instance.
- * This function MUST exist in the pninit file for a module
- *
- * @author       Mark West
- * @version      $Revision: 1.2 $
- * @return       bool       true on success, false otherwise
- */
-function Languages_init()
-{
-    // Get database information
-    $dbconn =& pnDBGetConn(true);
-    $pntable =& pnDBGetTables();
-
-    // Create tables
-    $languages_constant_table = $pntable['languages_constant'];
-    $languages_constant_column = &$pntable['languages_constant_column'];
-    $sql = "CREATE TABLE $languages_constant_table (
-		  	$languages_constant_column[constant] varchar(32) NOT NULL default '',
-  			$languages_constant_column[file] varchar(64) NOT NULL default '',
-			PRIMARY KEY  (pn_constant))";
-    $dbconn->Execute($sql);
-    // Check database result
-    if ($dbconn->ErrorNo() != 0) {
-        // Report failed initialisation attempt
-        return false;
-    }
-
-    $languages_file_table = $pntable['languages_file'];
-    $languages_file_column = &$pntable['languages_file_column'];
-    $sql = "CREATE TABLE $languages_file_table (
-			$languages_file_column[target] varchar(64) NOT NULL default '',
-			$languages_file_column[source] varchar(64) NOT NULL default '',
-			PRIMARY KEY  (pn_target,pn_source),
-			UNIQUE KEY source (pn_source))";
-    $dbconn->Execute($sql);
-    // Check database result
-    if ($dbconn->ErrorNo() != 0) {
-        // Report failed initialisation attempt
-        return false;
-    }
-
-    $languages_translation_table = $pntable['languages_translation'];
-    $languages_translation_column = &$pntable['languages_translation_column'];
-    $sql = "CREATE TABLE $languages_translation_table (
-  			$languages_translation_column[language] varchar(32) NOT NULL default '',
-			$languages_translation_column[constant] varchar(32) NOT NULL default '',
-			$languages_translation_column[translation] longblob NOT NULL default '',
-			$languages_translation_column[level] tinyint(4) NOT NULL default '0',
-			PRIMARY KEY  (pn_constant,pn_language))";
-    $dbconn->Execute($sql);
-    // Check database result
-    if ($dbconn->ErrorNo() != 0) {
-        // Report failed initialisation attempt
-        return false;
-    }
-    // Initialisation successful
-    return true;
-}
-
-
-/**
- * upgrade the Languages module from an old version
- *
- * This function can be called multiple times
- * This function MUST exist in the pninit file for a module
- *
- * @author       Mark West
- * @version      $Revision: 1.2 $
- * @return       bool       true on success, false otherwise
- */
-function Languages_upgrade($oldversion)
-{
-    // Upgrade dependent on old version number
-    switch($oldversion) {
-        case 1.2:
-            // Version 1.2 didn't have a the autodetect falg
-			pnConfigSetVar('language_detect', 0);
-            return Languages_upgrade(1.3);
-            break;
-    }
-
-    // Update successful
-    return true;
-}
-
-
-/**
- * delete the Languages module
- *
- * This function is only ever called once during the lifetime of a particular
- * module instance
- * This function MUST exist in the pninit file for a module
- *
- * @author       Mark West
- * @version      $Revision: 1.2 $
- * @return       bool       true on success, false otherwise
- */
-function Languages_delete()
-{
-    // Get database information
-    $dbconn =& pnDBGetConn(true);
-    $pntable =& pnDBGetTables();
-
-    // Delete tables
-    $sql = "DROP TABLE $pntable[languages_constant];";
-    $dbconn->Execute($sql);
-    // Check database result
-    if ($dbconn->ErrorNo() != 0) {
-        // Report failed deletion attempt
-        return false;
-    }
-
-    $sql = "DROP TABLE $pntable[languages_file];";
-    $dbconn->Execute($sql);
-    // Check database result
-    if ($dbconn->ErrorNo() != 0) {
-        // Report failed deletion attempt
-        return false;
-    }
-
-    $sql = "DROP TABLE $pntable[languages_translation];";
-    $dbconn->Execute($sql);
-    // Check database result
-    if ($dbconn->ErrorNo() != 0) {
-        // Report failed deletion attempt
-        return false;
-    }
-
-    // Deletion successful
-    return true;
-}
-
-?>
\ No newline at end of file
diff -ruN 0.761/modules/Languages/Version.php 0.762/modules/Languages/Version.php
--- 0.761/modules/Languages/Version.php	2005-02-04 00:30:27.000000000 -0600
+++ 0.762/modules/Languages/Version.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,15 +0,0 @@
-<?php
-// $Id: Version.php,v 1.3 2005/02/04 06:30:27 jorg Exp $
-$modversion['name'] = 'Languages Admin';
-$modversion['version'] = '1.3';
-$modversion['description'] = 'List languages by their ISO Key and name.';
-$modversion['credits'] = '';
-$modversion['help'] = '';
-$modversion['changelog'] = '';
-$modversion['license'] = '';
-$modversion['official'] = 1;
-$modversion['author'] = 'Patrick Kellum';
-$modversion['contact'] = 'http://www.ctarl-ctarl.com';
-$modversion['admin'] = 1;
-$modversion['securityschema'] = array('Languages::' => '::');
-?>
\ No newline at end of file
diff -ruN 0.761/modules/legal/pnadmin.php 0.762/modules/legal/pnadmin.php
--- 0.761/modules/legal/pnadmin.php	2005-01-10 09:01:37.000000000 -0600
+++ 0.762/modules/legal/pnadmin.php	2006-01-12 07:05:07.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.3 2005/01/10 15:01:37 markwest Exp $
+// $Id: pnadmin.php,v 1.3.2.1 2006/01/12 13:05:07 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -32,7 +32,7 @@
  *
  * @package      PostNuke_System_Modules
  * @subpackage   Legal
- * @version      $Id: pnadmin.php,v 1.3 2005/01/10 15:01:37 markwest Exp $
+ * @version      $Id: pnadmin.php,v 1.3.2.1 2006/01/12 13:05:07 markwest Exp $
  * @author       Mark West
  * @author       The PostNuke Development Team
  * @link         http://www.postnuke.com  The PostNuke Home Page
@@ -120,6 +120,12 @@
  */
 function legal_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'legal::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
diff -ruN 0.761/modules/legal/pntemplates/eng/legal_user_accessibilitystatement.htm 0.762/modules/legal/pntemplates/eng/legal_user_accessibilitystatement.htm
--- 0.761/modules/legal/pntemplates/eng/legal_user_accessibilitystatement.htm	2005-08-09 05:32:34.000000000 -0500
+++ 0.762/modules/legal/pntemplates/eng/legal_user_accessibilitystatement.htm	2005-10-10 09:20:58.000000000 -0500
@@ -19,7 +19,7 @@
 <li>All pages on this site are <acronym title="Web Content Accessibility Guidelines">WCAG</acronym> <acronym title="triple A">AAA</acronym>-approved, and comply with <a href="http://www.w3.org/TR/WAI-WEBCONTENT/full-checklist.html">all priority 1, 2, and 3 guidelines</a> of the <a href="http://www.w3.org/TR/WCAG10/"><acronym title="World Wide Web Consortium">W3C</acronym> Web Content Accessibility Guidelines</a>.  Again, this is a question of judgment call: many of the guidelines are intentionally vague, and cannot be tested automatically.  All the guidelines have been reviewed, and it is believed that all the site's pages are in compliance.</li>
 
 <li>All pages on this site are <a href="http://bobby.watchfire.com/">approved under the terms of Section 508</a>, and comply with all of the <acronym title="United States">U.S.</acronym> Federal Government <a href="http://www.section508.gov/">Section 508 Guidelines</a>.  Again, this is a question of judgment.  All the guidelines have been reviewed, and it is believed that all the site's pages are in compliance.</li>
-<li>All pages on this site <a href="http://validator.w3.org/">validate as <acronym title="extensible hypertext markup language">XHTML</acronym> 1.0 Strict</a>.  This is not a question of judgment; a program can determine with 100% accuracy whether a page is valid XHTML.  For example, you can click here to <a href="http://validator.w3.org/check?uri=http%3A%2F%2Fdiveintoaccessibility.org%2F&amp;charset=%28detect+automatically%29&amp;doctype=Inline">check this  page for XHTML validity</a>.</li>
+<li>All pages on this site <a href="http://validator.w3.org/">validate as <acronym title="extensible hypertext markup language">XHTML</acronym> 1.0 Strict</a>.  This is not a question of judgment; a program can determine with 100% accuracy whether a page is valid XHTML.  For example, you can click here to <a href="http://validator.w3.org/check?uri=referer">check this  page for XHTML validity</a>.</li>
 
 <li>All pages on this site use structured semantic markup language.  H2 tags are used for main titles, H3 tags for subtitles.  For example, on this page, JAWS users can skip to the next section within the accessibility statement by pressing <kbd>ALT+INSERT+3</kbd>.</li>
 </ol>
@@ -50,4 +50,4 @@
 <li>This site uses only relative font sizes, compatible with the user-specified &quot;text size&quot; option in visual browsers.</li>
 <li>If your browser or browsing device does not support stylesheets at all, the content of each page is still readable.</li>
 </ol>
-<br />
\ No newline at end of file
+<br />
diff -ruN 0.761/modules/Mailer/pnadmin.php 0.762/modules/Mailer/pnadmin.php
--- 0.761/modules/Mailer/pnadmin.php	2005-01-10 09:02:58.000000000 -0600
+++ 0.762/modules/Mailer/pnadmin.php	2006-01-12 07:08:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.23 2005/01/10 15:02:58 markwest Exp $
+// $Id: pnadmin.php,v 1.23.2.1 2006/01/12 13:08:28 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -158,6 +158,12 @@
  */
 function Mailer_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Mailer::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
@@ -309,6 +315,12 @@
  */
 function Mailer_admin_sendmessage($args)
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Mailer::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
@@ -384,7 +396,6 @@
 
     // Return
     return true;
-
 }
 
 ?>
\ No newline at end of file
diff -ruN 0.761/modules/MailUsers/admin.php 0.762/modules/MailUsers/admin.php
--- 0.761/modules/MailUsers/admin.php	2005-07-11 07:18:42.000000000 -0500
+++ 0.762/modules/MailUsers/admin.php	2006-01-13 17:24:58.000000000 -0600
@@ -1,5 +1,5 @@
 <?PHP
-// File: $Id: admin.php,v 1.6 2005/07/11 12:18:42 landseer Exp $
+// File: $Id: admin.php,v 1.11 2006/01/13 23:24:58 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -70,10 +70,10 @@
          .'<form action="admin.php" method="post"><div>'
          .'<input type="hidden" name="module" value="MailUsers" />'
          .'<input type="hidden" name="op" value="send" />'
-		 .'<input type="hidden" name="authid" value="' . pnSecGenAuthKey() . '" />'
+         .'<input type="hidden" name="authid" value="' . pnSecGenAuthKey() . '" />'
          .'<table border="0">'
          .'<tr><td><strong>'._NM_USERNAME.'</strong></td>'
-         .'<td><select name="username">'."\n xxx";
+         .'<td><select name="username">'."\n";
     $column = &$pntable['users_column'];
     $sql = "SELECT $column[uid], $column[uname]
             FROM $pntable[users]
@@ -134,8 +134,8 @@
 		 								 'subject',
 		 								 'message');
 
-    $message = stripslashes($message);
-    $subject = stripslashes($subject);
+    //$message = stripslashes($message);
+    //$subject = stripslashes($subject);
 
     if (($username== 0) and (!$all)) {
     	pnSessionSetVar('errormsg', _NM_ERROR1);
@@ -146,7 +146,7 @@
     } elseif ($from == '') {
     	pnSessionSetVar('errormsg', _NM_ERROR3);
 		pnRedirect('admin.php?module=MailUsers&op=main');
-    } elseif (subject == '') {
+    } elseif ($subject == '') {
     	pnSessionSetVar('errormsg', _NM_ERROR4);
 		pnRedirect('admin.php?module=MailUsers&op=main');
     } elseif ($message == '') {
@@ -198,11 +198,11 @@
 			}
 			//If we've processed more than 100 users send email and reset counters - Skooter
 			if ($usercount > 100){
-				$result = pnModAPIFunc('Mailer', 'user', 'sendmessage',
+				$status = pnModAPIFunc('Mailer', 'user', 'sendmessage',
 				          array('toaddress' => $from, 'toname' => $fromname, 'fromaddress' => $from, 'fromname' => $fromname,
 				               'bcc' => $email, 'subject' => $subject, 'body' => $message));
-				if (!$result) {
-					pnSessionSetVar('errormsg', $result);
+				if (!$status) {
+					pnSessionSetVar('errormsg', $status);
 				}
 				$email = array();
 				$usercount = 0;
@@ -212,20 +212,20 @@
 		// An email to all goes out To: the user sending the email,
 		// and Bcc: all of the actual recipients
 		if ($usercount >0){
-			$result = pnModAPIFunc('Mailer', 'user', 'sendmessage',
+			$status = pnModAPIFunc('Mailer', 'user', 'sendmessage',
 			          array('toaddress' => $from, 'toname' => $fromname, 'fromaddress' => $from, 'fromname' => $fromname,
 			                'bcc' => $email, 'subject' => $subject, 'body' => $message));
-			if (!$result) {
-				pnSessionSetVar('errormsg', $result);
+			if (!$status) {
+				pnSessionSetVar('errormsg', $status);
 			}
 		}
 	} else {
 		list($useremail, $username) = $result->fields;
-		$result = pnModAPIFunc('Mailer', 'user', 'sendmessage',
+		$status = pnModAPIFunc('Mailer', 'user', 'sendmessage',
 		          array('toaddress' => $useremail, 'toname' => $username, 'fromaddress' => $from, 'fromname' => $fromname,
 		                'subject' => $subject, 'body' => $message));
-		if (!$result) {
-			pnSessionSetVar('errormsg', $result);
+		if (!$status) {
+			pnSessionSetVar('errormsg', $status);
 		}
 	}
 
diff -ruN 0.761/modules/Members_List/pnadmin.php 0.762/modules/Members_List/pnadmin.php
--- 0.761/modules/Members_List/pnadmin.php	2005-03-07 05:05:15.000000000 -0600
+++ 0.762/modules/Members_List/pnadmin.php	2006-01-12 07:30:58.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: pnadmin.php,v 1.21 2005/03/07 11:05:15 markwest Exp $
+// File: $Id: pnadmin.php,v 1.21.2.1 2006/01/12 13:30:58 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -103,6 +103,12 @@
  */
 function Members_List_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Members_List::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
diff -ruN 0.761/modules/Members_List/pntemplates/memberslist_user_view.htm 0.762/modules/Members_List/pntemplates/memberslist_user_view.htm
--- 0.761/modules/Members_List/pntemplates/memberslist_user_view.htm	2005-03-16 01:19:49.000000000 -0600
+++ 0.762/modules/Members_List/pntemplates/memberslist_user_view.htm	2005-12-16 07:41:54.000000000 -0600
@@ -1,4 +1,4 @@
-<!--[*  $Id: memberslist_user_view.htm,v 1.7 2005/03/16 07:19:49 jmvedrine Exp $  *]-->
+<!--[*  $Id: memberslist_user_view.htm,v 1.7.2.1 2005/12/16 13:41:54 markwest Exp $  *]-->
 <!--[include file="memberslist_user_menu.htm"]-->
 <h2><!--[pnml name=_MEMBERSLISTVIEW]--></h2>
 <div class="memberslist-navmenu">
@@ -40,7 +40,7 @@
 	    <!--[if $users[users].onlinestatus eq 1 ]-->
 		  <div style="color:red;"><strong><!--[pnimg src="online.gif" alt=_MEMBERSLISTSTATUSONLINE altml=true]--><!--[pnml name="_MEMBERSLISTSTATUSONLINE"]--></strong></div>		
         <!--[else]-->
-		  <div style="color:black;"><strong><!--[pnimg src="online.gif" alt=_MEMBERSLISTSTATUSOFFLINE" altml=true]--><!--[pnml name="_MEMBERSLISTSTATUSOFFLINE"]--></strong></div>		
+		  <div style="color:black;"><strong><!--[pnimg src="offline.gif" alt=_MEMBERSLISTSTATUSOFFLINE" altml=true]--><!--[pnml name="_MEMBERSLISTSTATUSOFFLINE"]--></strong></div>		
 		<!--[/if]-->
 	  </td>
       <td><img src="images/avatar/<!--[$users[users].pn_user_avatar]-->" alt="<!--[$users[users].pn_user_avatar]-->" /></td>
diff -ruN 0.761/modules/Members_List/pntemplates/memberslist_user_viewlast10.htm 0.762/modules/Members_List/pntemplates/memberslist_user_viewlast10.htm
--- 0.761/modules/Members_List/pntemplates/memberslist_user_viewlast10.htm	2005-03-16 01:19:49.000000000 -0600
+++ 0.762/modules/Members_List/pntemplates/memberslist_user_viewlast10.htm	2005-12-16 07:41:54.000000000 -0600
@@ -1,4 +1,4 @@
-<!--[*  $Id: memberslist_user_viewlast10.htm,v 1.2 2005/03/16 07:19:49 jmvedrine Exp $  *]-->
+<!--[*  $Id: memberslist_user_viewlast10.htm,v 1.2.2.1 2005/12/16 13:41:54 markwest Exp $  *]-->
 <!--[include file="memberslist_user_menu.htm"]-->
 <h2><!--[pnml name="_MEMBERSLISTLAST10REG"]--></h2>
 <table class="memberslist-results">
@@ -16,7 +16,7 @@
 	    <!--[if $users[users].onlinestatus eq 1 ]-->
 		  <div style="color:red;"><strong><!--[pnimg src="online.gif" alt=_MEMBERSLISTSTATUSONLINE altml=true]--><!--[pnml name="_MEMBERSLISTSTATUSONLINE"]--></strong></div>		
         <!--[else]-->
-		  <div style="color:black;"><strong><!--[pnimg src="online.gif" alt=_MEMBERSLISTSTATUSOFFLINE" altml=true]--><!--[pnml name="_MEMBERSLISTSTATUSOFFLINE"]--></strong></div>		
+		  <div style="color:black;"><strong><!--[pnimg src="offline.gif" alt=_MEMBERSLISTSTATUSOFFLINE" altml=true]--><!--[pnml name="_MEMBERSLISTSTATUSOFFLINE"]--></strong></div>		
 		<!--[/if]-->
 	  </td>
       <td><strong><a href="user.php?op=userinfo&amp;uname=<!--[$users[users].uname|pnvarprepfordisplay]-->"><!--[$users[users].uname]--></a></strong></td>
diff -ruN 0.761/modules/Modules/pnadminapi.php 0.762/modules/Modules/pnadminapi.php
--- 0.761/modules/Modules/pnadminapi.php	2005-09-06 15:58:06.000000000 -0500
+++ 0.762/modules/Modules/pnadminapi.php	2005-10-30 15:31:37.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: pnadminapi.php,v 1.73.2.1 2005/09/06 20:58:06 landseer Exp $
+// File: $Id: pnadminapi.php,v 1.73.2.2 2005/10/30 21:31:37 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -650,13 +650,16 @@
     while (list($mid, $name, $modtype, $displayname, $regid, $directory, $adminCapable, $userCapable, $version, $state) = $result->fields) {
         $result->MoveNext();
         $dbmodules[$name] = array('id' => $mid,
-							      'type' => $modtype,
-					              'directory' => $directory,
-					              'admincapable' => $adminCapable,
-					              'usercapable' => $userCapable,
-					              'version' => $version,
-					              'state' => $state,
-					              'regid' => $regid);
+								  'name' => $name,
+                                  'type' => $modtype,
+								  'displayname' => $displayname,
+								  'description' => $description,
+								  'regid' => $regid,
+                                  'directory' => $directory,
+                                  'admincapable' => $adminCapable,
+                                  'usercapable' => $userCapable,
+                                  'version' => $version,
+                                  'state' => $state);
     }
     $result->Close();
     // See if we have lost any modules since last generation
diff -ruN 0.761/modules/Modules/pnadmin.php 0.762/modules/Modules/pnadmin.php
--- 0.761/modules/Modules/pnadmin.php	2005-08-19 11:30:52.000000000 -0500
+++ 0.762/modules/Modules/pnadmin.php	2006-01-12 07:12:57.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: pnadmin.php,v 1.61 2005/08/19 16:30:52 markwest Exp $
+// File: $Id: pnadmin.php,v 1.61.2.1 2006/01/12 13:12:57 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -767,6 +767,12 @@
  */
 function modules_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Modules::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
diff -ruN 0.761/modules/News/article.php 0.762/modules/News/article.php
--- 0.761/modules/News/article.php	2005-07-23 05:06:23.000000000 -0500
+++ 0.762/modules/News/article.php	2006-01-27 13:07:05.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: article.php,v 1.39 2005/07/23 10:06:23 landseer Exp $
+// File: $Id: article.php,v 1.41 2006/01/27 19:07:05 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -88,7 +88,7 @@
 if (!pnSecAuthAction(0, 'Stories::Story', "$info[aid]:$info[cattitle]:$info[sid]", ACCESS_OVERVIEW) ||
     !pnSecAuthAction(0, 'Topics::Topic', "$info[topicname]::$info[tid]", ACCESS_READ)) {
    include 'header.php';
-   echo _NOTAUTHSTORY.' ' .$info['title'];
+   echo _NOTAUTHSTORY;
    include 'footer.php';
    exit;
 }
@@ -96,16 +96,18 @@
 // store bodytext in an additional field
 $info['fullbodytext'] = $info['bodytext'];
 
-// Explode the article into an array of seperate pages
-$allpages = explode( "<!--pagebreak-->", $info['bodytext'] );
-
-// Set the item bodytext to be the required page
-// nb arrays start from zero pages from one
-$info['bodytext'] = $allpages[$pageid-1];
-
-// now remove the hometext if not on the first page
-if ($pageid != 1) {
-	$info['hometext'] = '';
+if (pnUserGetTheme() != 'Printer') {
+    // Explode the article into an array of seperate pages
+    $allpages = explode( "<!--pagebreak-->", $info['bodytext'] );
+
+    // Set the item bodytext to be the required page
+    // nb arrays start from zero pages from one
+    $info['bodytext'] = $allpages[$pageid-1];
+
+    // now remove the hometext if not on the first page
+    if ($pageid != 1) {
+	    $info['hometext'] = '';
+    }
 }
 
 $links = genArticleLinks($info);
diff -ruN 0.761/modules/News/funcs.php 0.762/modules/News/funcs.php
--- 0.761/modules/News/funcs.php	2005-07-13 09:10:32.000000000 -0500
+++ 0.762/modules/News/funcs.php	2005-10-19 17:12:51.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: funcs.php,v 1.51 2005/07/13 14:10:32 larsneo Exp $
+// File: $Id: funcs.php,v 1.53 2005/10/19 22:12:51 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -72,7 +72,6 @@
                      $storiescolumn[time] AS \"unixtime\",
                      $storiescolumn[withcomm] AS \"withcomm\",
                      $storiescolumn[format_type] AS \"format_type\"
-
               FROM $pntable[stories]";
 
     // left join syntax is not consistent.  We check for oracle and assume
@@ -243,7 +242,6 @@
 
     // Allowed to comment?
     if (pnSecAuthAction(0, $component, $instance, ACCESS_COMMENT)) {
-//        $comment = "index.php?name=News&amp;file=article&amp;sid=$info[sid]&amp;$commentextra";
         $comment = "index.php?name=News&amp;file=article&amp;sid=$info[sid]#comments";
 		$postcomment = "index.php?name=Comments&amp;req=Reply&amp;sid=$info[sid]";
     } else {
@@ -253,7 +251,6 @@
 
     // Allowed to read full article?
     if (pnSecAuthAction(0, $component, $instance, ACCESS_READ)) {
-//        $fullarticle = "index.php?name=News&amp;file=article&amp;sid=$info[sid]&amp;$commentextra";
         $fullarticle = "index.php?name=News&amp;file=article&amp;sid=$info[sid]";
     } else {
         $fullarticle = '';
@@ -298,7 +295,7 @@
     if (pnModAvailable("Recommend_Us")) {
         $send = "<a href=\"$links[send]\"><img src=\"images/global/friend.gif\" alt=\""._FRIEND."\" /></a>";
     } else {
-        $send = "";
+        $send = '';
     }
 
     $hometext = $info['hometext'];
@@ -306,11 +303,11 @@
 
     // Only bother with readmore if there is more to read
     $bytesmore = strlen($info['bodytext']);
-    $readmore = "";
-    $bytesmorelink = "";
+    $readmore = '';
+    $bytesmorelink = '';
     if ($bytesmore > 0) {
         if (pnSecAuthAction(0, $component, $instance, ACCESS_READ)) {
-            $readmore = "<a href=\"$links[fullarticle]\" title=\"$info[title]\">"._READMORE." '$info[title]' </a>";
+            $readmore = "<a href=\"$links[fullarticle]\" title=\"".strip_tags($info['title'])."\">"._READMORE." '$info[title]' </a>";
         }
         $bytesmorelink = "$bytesmore "._BYTESMORE;
     }
@@ -331,12 +328,13 @@
 
     // Work out how to say 'comment(s)(?)' correctly
     $comment = '';
+	$postcomment = '';
     if (pnModAvailable('Comments')) {
         if ($info['withcomm'] == 0) {
             if ($info['comments'] == 0) {
                 $comment = _COMMENTSQ;
             } else if ($info['comments'] == 1) {
-                $comment = "1 " . _COMMENT;
+                $comment = '1 ' . _COMMENT;
             } else {
                 $comment = "$info[comments] "._COMMENTS;
             }
@@ -350,13 +348,29 @@
             $comment = '';
 			$postcomment = '';
         }
-    }
+    } else if (pnModAvailable('EZComments') && pnModIsHooked('EZComments', 'News')) {
+		$commentcount = pnModAPIFunc('EZComments', 'user', 'countitems', array('mod' => 'News', 'objectid' => $info['sid'], 'status' => 0));
+		if ($commentcount == 0) {
+			$comment = _COMMENTSQ;
+		} else if ($commentcount == 1) {
+			$comment = '1 ' . _COMMENT;
+		} else {
+			$comment = "$commentcount "._COMMENTS;
+		}
+		if (pnSecAuthAction(0, 'EZComments::', "News::$info[sid]", ACCESS_COMMENT)) {
+            $comment = "<a href=\"$links[comment]\">$comment</a>";
+			$postcomment = "<a href=\"$links[postcomment]\">"._COMMENTSQ.'</a>';
+        } else {
+            $comment = '';
+			$postcomment = '';
+        }
+	}
 
     // Notes, if there are any
     if (!empty($info['notes'])) {
         $notes = _NOTE." <em>$info[notes]</em>";
     } else {
-        $notes = "";
+        $notes = '';
     }
 
     // Link to topic image if there is a topic
@@ -369,7 +383,7 @@
     }
 
     // Work out how to say 'read(s)(?)' correctly
-    $reads = "";
+    $reads = '';
     if ($info['counter'] == 1) {
         $reads = '1 ' . _READ;
     } else {
@@ -393,7 +407,7 @@
                        'version' => 1);
 
     // More complex extras - use values in the array
-    $preformat['more'] = "";
+    $preformat['more'] = '';
     if ($bytesmore > 0) {
         $preformat['more'] .= "$preformat[readmore] ($preformat[bytesmore]) ";
     }
diff -ruN 0.761/modules/News/index.php 0.762/modules/News/index.php
--- 0.761/modules/News/index.php	2005-08-09 19:09:25.000000000 -0500
+++ 0.762/modules/News/index.php	2006-01-20 04:12:38.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: index.php,v 1.49 2005/08/10 00:09:25 chestnut Exp $
+// File: $Id: index.php,v 1.50 2006/01/20 10:12:38 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -233,16 +233,16 @@
         // implement a pager if required
         $output =& new pnHTML();
         if (isset($catid) && !empty($catid) && is_numeric($catid)) {
-          $catstring = '&amp;catid='. $catid .'&amp;';
+          $catstring = '&amp;catid='. $catid;
         } else {
           $catstring = '';
         }
         if (isset($topic) && !empty($topic) && is_numeric($topic)) {
-          $topicstring = '&amp;topic='. $topic .'&amp;';
+          $topicstring = '&amp;topic='. $topic;
         } else {
           $topicstring = '';
         }
-        $pagerstring = 'index.php?name=News&amp;'.$catstring.''.$topicstring.'startnum=%%';
+        $pagerstring = 'index.php?name=News'.$catstring.''.$topicstring.'&amp;startnum=%%';
         $output->Pager($startnum, $storycount, $pagerstring ,$storynum);
         echo $output->GetOutput();
         echo '</div>';
diff -ruN 0.761/modules/NewUser/user.php 0.762/modules/NewUser/user.php
--- 0.761/modules/NewUser/user.php	2005-08-02 06:42:21.000000000 -0500
+++ 0.762/modules/NewUser/user.php	2006-01-07 06:12:14.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: user.php,v 1.23 2005/08/02 11:42:21 larsneo Exp $
+// File: $Id: user.php,v 1.25 2006/01/07 12:12:14 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -103,7 +103,7 @@
 
   OpenTable();
   echo '<form name="Register" action="user.php" method="post"><div>'."\n"
-    .'<table cellpadding="5" cellspacing="0\" border="0">'."\n"
+    .'<table cellpadding="5" cellspacing="0" border="0">'."\n"
     .'<tr>'."\n"
     .'<td style="width:25%" align="right"><strong><label for="uname_new_user">' . _NICKNAME . '</label></strong></td>'."\n"
     .'<td style="width:75%"><input type="text" name="uname" id="uname_new_user" size="'.pnVarPrepForDisplay($size).'" maxlength="25" tabindex="0" /></td>'."\n"
@@ -203,11 +203,19 @@
     $pntable =& pnDBGetTables();
 
     $stop = '';
+    
+    // check for valid email
     $res = pnVarValidate($email, 'email');
     if ($res == false) {
         $stop = _ERRORINVEMAIL;
     }
 
+    // check for valid uname
+    $res2 = pnVarValidate($uname, 'uname');
+    if ($res2 == false) {
+        $stop = _NICK2LONG;
+    }
+
     // check for some e-mail domains.
     list($foo, $maildomain) = split('@', $email);
     $maildomain = strtolower($maildomain);
@@ -220,6 +228,7 @@
     if (in_array($maildomain, $checkdomains)) {
        $stop = _EMAILINVALIDDOMAIN;
     }
+    
     // Check for legal module
     if (pnModAvailable('legal')) {
         // If legal var agreetoterms checkbox not checked, value is 0 and results in error
@@ -227,15 +236,13 @@
             $stop = _ERRORMUSTAGREE;
         }
     }
-    // By this test (without on printable characters) it should be possible to have
-    // eg. Chinese characters on the username. (hinrich, 2002-07-03, reported by class 007
+
+    // check for valid username
     if (!$uname || stristr($uname,'&') || preg_match("/[[:space:]]/", $uname) || strip_tags($uname) != $uname) {
         $stop = _ERRORINVNICK;
     }
-    if (strlen($uname) > 25) {
-        $stop = _NICK2LONG;
-    }
-    // Illegal Usernames [class007]
+
+    // check for forbidden names
     $reg_illegalusername = trim(pnConfigGetVar('reg_Illegalusername'));
     if (!empty($reg_illegalusername)) {
         $usernames = explode(" ", $reg_illegalusername);
@@ -248,29 +255,28 @@
                 $pregcondition .= $usernames[$i] . "))/iAD";
             }
         }
-        // die ($pregcondition);
         if (preg_match($pregcondition, $uname)) {
             $stop = _NAMERESERVED;
         }
     }
-    if (strrpos($uname, ' ') > 0) {
-        $stop = _NICKNOSPACES;
-    }
+
+    // check if user already exists
     $column = &$pntable['users_column'];
     $existinguser =& $dbconn->Execute("SELECT $column[uname] FROM $pntable[users] WHERE $column[uname]='" . pnVarPrepForStore($uname) . "'");
     if (!$existinguser->EOF) {
         $stop = _NICKTAKEN;
     }
     $existinguser->Close();
-    $existinguser =& $dbconn->Execute("SELECT $column[email] FROM $pntable[users] WHERE $column[email]='" . pnVarPrepForStore($email) . "'");
-    // new by class007
+
+    // check if email is unique (if wanted)
     if (pnConfigGetVar('reg_uniemail')) {
-        if (!$existinguser->EOF) {
-            $existinguser =& $dbconn->Execute("SELECT $column[email] FROM $pntable[users] WHERE $column[email]='" . pnVarPrepForStore($email) . "'");
+        $existingemail =& $dbconn->Execute("SELECT $column[email] FROM $pntable[users] WHERE $column[email]='" . pnVarPrepForStore($email) . "'");
+        if (!$existingemail->EOF) {
             $stop = _EMAILREGISTERED;
-            $existinguser->Close();
         }
+        $existingemail->Close();
     }
+
     return($stop);
 }
 
diff -ruN 0.761/modules/Permissions/pnadmin.php 0.762/modules/Permissions/pnadmin.php
--- 0.761/modules/Permissions/pnadmin.php	2005-01-08 09:54:31.000000000 -0600
+++ 0.762/modules/Permissions/pnadmin.php	2005-12-29 11:02:43.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: pnadmin.php,v 1.35 2005/01/08 15:54:31 markwest Exp $
+// File: $Id: pnadmin.php,v 1.35.2.1 2005/12/29 17:02:43 drak Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -41,7 +41,7 @@
  * designer feels should be the default function (often this is the
  * view() function)
  * @author Jim McDonald
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.35.2.1 $
  * @return mixed HTML string or true
  */
 function permissions_admin_main()
@@ -51,14 +51,14 @@
     }
 
     pnRedirect(pnModURL('Permissions','admin','view',array(
-    												'permtype' => 'group')));                        
+    												'permtype' => 'group')));
     return true;
 }
 
 /**
  * view permissions
  * @author Jim McDonald
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.35.2.1 $
  * @param string 'permtype' permissions type
  * @return string HTML string
  */
@@ -136,7 +136,7 @@
                      $permcolumn[instance],
                      $permcolumn[level],
                      $permcolumn[bond]
-              FROM $permtable 
+              FROM $permtable
         	  $permwhere
               ORDER BY $permcolumn[sequence]";
     if (isset($dbg)) $dbg->msg($query);
@@ -168,10 +168,10 @@
 
 	$pnRender->assign('mlpermtype', $mlpermtype);
 
-    $realms = permissions_getRealmsInfo();
+    // $realms = permissions_getRealmsInfo(); // not used yet (drak)
     $accesslevels = accesslevelnames();
 
-    $permissions = array();	
+    $permissions = array();
     if ($numrows>0) {
 
         $authid = pnSecGenAuthKey('Permissions');
@@ -253,7 +253,7 @@
 /*
  * increment a permission
  * @author Jim McDonald
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.35.2.1 $
  * @param string 'permtype' permissions type
  * @param int 'pid' permissions id
  * @return bool true
@@ -288,7 +288,7 @@
 		// Doesn't matter if we're looking at user-permissions...
 		$permgrp = _PNPERMS_ALL;
 	}
-	
+
     // Load in API
     pnModAPILoad('Permissions', 'admin');
 
@@ -316,7 +316,7 @@
 /*
  * decrement a permission
  * @author Jim McDonald
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.35.2.1 $
  * @param string 'permtype' permissions type
  * @param int 'pid' permissions id
  * @return bool true
@@ -428,7 +428,7 @@
 
     // Assign the permission levels
 	$pnRender->assign('permissionlevels', accesslevelnames());
-	
+
     // Work out which tables to operate against, and
     // various other bits and pieces
     $dbconn =& pnDBGetConn(true);
@@ -475,7 +475,7 @@
                      $permcolumn[instance],
                      $permcolumn[level],
                      $permcolumn[bond]
-              FROM $permtable 
+              FROM $permtable
         	  $permwhere
               ORDER BY $permcolumn[sequence]";
     if (isset($dbg)) $dbg->msg($query);
@@ -503,7 +503,7 @@
     $pnRender->assign('title', $viewperms);
     $pnRender->assign('mlpermtype', $mlpermtype);
 
-    $realms = permissions_getRealmsInfo();
+    //$realms = permissions_getRealmsInfo(); //not used yet - drak
     $accesslevels = accesslevelnames();
     $i=0;
     $numrows = $result->PO_RecordCount();
@@ -529,7 +529,7 @@
 		// Realms hard-coded - jgm
 	    $pnRender->assign('realm', 0);
 		$pnRender->assign('submit', _NEWPERM);
-	
+
 	} else if ($action == 'add') {
 		// Form-start
 	    $pnRender->assign('formurl', pnModURL('Permissions', 'admin', 'create'));
@@ -645,7 +645,7 @@
 /*
  * @author Jim McDonald <jim@mcdee.net>
  * @link http://www.mcdee.net
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.35.2.1 $
  * @param string 'permtype' permissions type
  * @param int 'pid' permissions id
  * @param int 'id' group or user id
@@ -742,7 +742,7 @@
 /**
  * create a new permission
  * @author Jim McDonald
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.35.2.1 $
  * @param string 'permtype' permissions type
  * @param int 'id' group or user id
  * @param int 'realm' realm to which the permission belongs
@@ -831,7 +831,7 @@
 /**
  * delete a permission
  * @author Jim McDonald
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.35.2.1 $
  * @param string 'permtype' permissions type
  * @param int 'pid' permissions id
  * @return bool true
@@ -861,7 +861,7 @@
                                               'pid',
 											  'confirmation');
 
-    // Check for confirmation. 
+    // Check for confirmation.
     if (empty($confirmation)) {
         // No confirmation yet - display a suitable form to obtain confirmation
         // of this action from the user
@@ -869,13 +869,13 @@
         // Create output object - this object will store all of our output so that
         // we can return it easily when required
         $pnRender =& new pnRender('Permissions');
-    
+
         // As Admin output changes often, we do not want caching.
         $pnRender->caching = false;
 
         // Add a hidden field for the item ID to the output
         $pnRender->assign('pid', $pid);
-		
+
 		// assign the permission type and group
 		$pnRender->assign('permgrp', $permgrp);
 		$pnRender->assign('permtype', $permtype);
@@ -912,7 +912,7 @@
  * getUsersInfo - get users information
  * Takes no parameters
  * @author Jim McDonald
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.35.2.1 $
  * @return array users array
  * @todo remove calls to this function in favour of calls to the users module
  */
@@ -945,7 +945,7 @@
  * getGroupsInfo - get groups information
  * Takes no parameters
  * @author Jim McDonald
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.35.2.1 $
  * @return array groups array
  * @todo remove calls to this function in favour of calls to the groups module
  */
@@ -977,7 +977,7 @@
  * getRealmsInfo - get realms information
  * Takes no parameters
  * @author Jim McDonald
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.35.2.1 $
  * @todo Move to admin API
  * @return array realms array
  */
@@ -1014,7 +1014,7 @@
  *                             from blocks and modules
  * Takes no parameters
  * @author Jim McDonald
- * @version $Revision: 1.35 $
+ * @version $Revision: 1.35.2.1 $
  * @return string HTML string
  */
 function permissions_admin_viewinstanceinfo()
@@ -1023,7 +1023,7 @@
     if (!pnSecAuthAction(0, 'Permissions::', '::', ACCESS_ADMIN)) {
         return pnVarPrepHTMLDisplay(_MODULENOAUTH);
     }
-  
+
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
     $pnRender =& new pnRender('Permissions');
diff -ruN 0.761/modules/pn_bbcode/pnadmin.php 0.762/modules/pn_bbcode/pnadmin.php
--- 0.761/modules/pn_bbcode/pnadmin.php	2005-09-16 09:32:19.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnadmin.php	2005-10-07 07:06:28.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.10 2005/09/16 14:32:19 landseer Exp $
+// $Id: pnadmin.php,v 1.11 2005/10/07 12:06:28 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -40,28 +40,6 @@
 }
 
 /**
- * update
- *
- */
-function pn_bbcode_admin_update()
-{
-    if (!pnSecAuthAction(0, 'pn_bbcode::', "::", ACCESS_ADMIN)) {
-    	return pnVarPrepForDisplay(_PNBBCODE_NOAUTH);
-    }
-
-    list($submit, $displayhook) = pnVarCleanFromInput('submit', 'displayhook');
-    if($submit) {
-        if($displayhook == 'yes') {
-            pnModSetVar('pn_bbcode', 'displayhook', 'yes');
-        } else {
-            pnModSetVar('pn_bbcode', 'displayhook', 'no');
-        }
-    }
-
-    return pnRedirect(pnModURL('pn_bbcode', 'admin', 'main'));
-}
-
-/**
  * codeconfig
  *
  */
@@ -95,7 +73,6 @@
         $pnr->assign('linenumberoffchecked', $linenumberoffchecked);
         $pnr->assign('syntaxhiliteonchecked', $syntaxhiliteonchecked);
         $pnr->assign('syntaxhiliteoffchecked', $syntaxhiliteoffchecked);
-        pnModAPILoad('pn_bbcode', 'user');
         $pnr->assign('code_preview', nl2br(pnModAPIFunc('pn_bbcode', 'user', 'transform',
                                                         array('objectid' => 1,
                                                               'extrainfo' => "[code]<?php\n\necho 'test';\n\n?>[/code]"))));
@@ -140,7 +117,6 @@
         $pnr =&new pnRender('pn_bbcode');
         $pnr->caching = false;
         $pnr->assign('quote', pnModGetVar('pn_bbcode', 'quote'));
-        pnModAPILoad('pn_bbcode', 'user');
         $pnr->assign('quote_preview', nl2br(pnModAPIFunc('pn_bbcode', 'user', 'transform',
                                                          array('objectid' => 1,
                                                                'extrainfo' => "[quote=username]test\ntest test\n\n[/quote]"))));
diff -ruN 0.761/modules/pn_bbcode/pndocs/changelog.txt 0.762/modules/pn_bbcode/pndocs/changelog.txt
--- 0.761/modules/pn_bbcode/pndocs/changelog.txt	2005-09-26 08:41:20.000000000 -0500
+++ 0.762/modules/pn_bbcode/pndocs/changelog.txt	2005-11-22 14:40:46.000000000 -0600
@@ -1,7 +1,11 @@
-Version 1.18:
-    - showing bbcodes user interface now as display hook:
-      <!--[ pnmodcallhooks hookobject=item hookaction=display hookid=$topic.topic_id implode=false textfieldid=message ]-->
-      <!--[ $hooks.pn_bbcode ]-->
+Version 1.20: Nov 22, 2005
+    - fixed bug in list tag
+    - added alt parameter to img tag (credits to Franky Chestnut)
+    - img tag now allows local paths
+
+Version 1.19: Oct 07, 2005
+    - minimum requirement now PN .760+
+    - removed displayhook due to compatibility problems
       **********************************************
       **                IMPORTANT!!!              **
       **   You need to go the hooks settings      **
@@ -10,6 +14,12 @@
       **   page in order to activte the           **
       **   display hooks too!!!                   **
       **********************************************
+    - fixed bug with IMG-tag embedded in URL-tag
+    - fixed scrambling of bbcode tags in lists (credits to Norm Winkel for
+      finding this one)
+
+Version 1.18:
+    - showing bbcodes user interface now as display hook
     - GeSHi updated to 1.0.7.3, fixed security bug
 
 Version 1.17: May 20, 2005
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/actionscript-french.php 0.762/modules/pn_bbcode/pnincludes/geshi/actionscript-french.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/actionscript-french.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/actionscript-french.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------------
  * Author: Steffen Krause (Steffen.krause@muse.de)
  * Copyright: (c) 2004 Steffen Krause, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.1 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.2 $
  * Date Started: 2004/06/20
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Actionscript language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/actionscript.php 0.762/modules/pn_bbcode/pnincludes/geshi/actionscript.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/actionscript.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/actionscript.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------------
  * Author: Steffen Krause (Steffen.krause@muse.de)
  * Copyright: (c) 2004 Steffen Krause, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/20
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Actionscript language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/ada.php 0.762/modules/pn_bbcode/pnincludes/geshi/ada.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/ada.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/ada.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -------
  * Author: Tux (tux@inmail.cz)
  * Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/07/29
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Ada language file for GeSHi.
  * Words are from SciTe configuration file
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/apache.php 0.762/modules/pn_bbcode/pnincludes/geshi/apache.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/apache.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/apache.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Tux (tux@inmail.cz)
  * Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/29/07
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Apache language file for GeSHi.
  * Words are from SciTe configuration file
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/applescript.php 0.762/modules/pn_bbcode/pnincludes/geshi/applescript.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/applescript.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/applescript.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: Stephan Klimek (http://www.initware.org)
  * Copyright: Stephan Klimek (http://www.initware.org)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.1 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.2 $
  * Date Started: 2005/07/20
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * AppleScript language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/asm.php 0.762/modules/pn_bbcode/pnincludes/geshi/asm.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/asm.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/asm.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -------
  * Author: Tux (tux@inmail.cz)
  * Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/07/27
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * x86 Assembler language file for GeSHi.
  * Words are from SciTe configuration file (based on NASM syntax)
@@ -91,7 +91,7 @@
 		3 => array(
 			'ah','al','ax','bh','bl','bp','bx','ch','cl','cr0','cr2','cr3','cs','cx','dh','di','dl',
 			'dr0','dr1','dr2','dr3','dr6','dr7','ds','dx','eax','ebp','ebx','ecx','edi','edx',
-			 'es','esi','esp','fs','gs','si','sp','ss','st','tr3','tr4','tr5','tr6','tr7'
+			 'es','esi','esp','fs','gs','si','sp','ss','st','tr3','tr4','tr5','tr6','tr7', 'ah', 'bh', 'ch', 'dh'
 			),
 		/*Directive*/
 		4 => array(
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/asp.php 0.762/modules/pn_bbcode/pnincludes/geshi/asp.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/asp.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/asp.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: Amit Gupta (http://blog.igeek.info/)
  * Copyright: (c) 2004 Amit Gupta (http://blog.igeek.info/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/08/13
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * ASP language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/bash.php 0.762/modules/pn_bbcode/pnincludes/geshi/bash.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/bash.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/bash.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: Andreas Gohr (andi@splitbrain.org)
  * Copyright: (c) 2004 Andreas Gohr, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/08/20
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * BASH language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/blitzbasic.php 0.762/modules/pn_bbcode/pnincludes/geshi/blitzbasic.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/blitzbasic.php	1969-12-31 18:00:00.000000000 -0600
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/blitzbasic.php	2005-12-14 16:35:54.000000000 -0600
@@ -0,0 +1,187 @@
+<?php
+/*************************************************************************************
+ * blitzbasic.php
+ * --------------
+ * Author: Pdraig O`Connel (info@moonsword.info)
+ * Copyright: (c) 2005 Pdraig O`Connel (http://moonsword.info)
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.1 $
+ * Date Started: 16.10.2005
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
+ *
+ * BlitzBasic language file for GeSHi.
+ *
+ * It is a simple Basic dialect. Released for Games and Network Connections.
+ * In this Language File are all functions included (2D BB and 3D BB)
+ *
+ *
+ * CHANGES
+ * -------
+ * 2005/10/22 (1.0.0)
+ *  -  First Release
+ *
+ * TODO (updated 2005/10/22)
+ * -------------------------
+ * * Sort out the Basic commands for splitting up.
+ * * To set up the right colors.
+ *      (the colors are ok, but not the correct ones)
+ * * Split to BlitzBasic 2D and BlitzBasic 3D.
+ *
+ *************************************************************************************
+ *
+ *     This file is part of GeSHi.
+ *
+ *   GeSHi is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   GeSHi is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with GeSHi; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ ************************************************************************************/
+
+ $language_data = array (
+  'LANG_NAME' => 'BLITZ BASIC',
+  'COMMENT_SINGLE' => array(1 => ';'),
+  'COMMENT_MULTI' => array(),
+  'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+  'QUOTEMARKS' => array('"'),
+  'ESCAPE_CHAR' => '',
+  'KEYWORDS' => array(
+    1 => array(
+    	'If','EndIf','ElseIf','Else If','Else','While','Wend','Return','Next','Include','End Type','End Select','End If','End Function','End','Select',
+    	'Type','Forever','For','Or','And','AppTitle','Case','Goto','Gosub','Step','Stop','Int','Last','False','Then','To','True','Until','Float',
+    	'String','Before','Not'
+    ),
+    2 => array(
+
+      // All Functions - 2D BB and 3D BB
+ 	  	'Xor','WriteString','WriteShort','WritePixelFast','WritePixel','WriteLine','WriteInt','WriteFloat','WriteFile','WriteBytes',
+		'WriteByte','Write','WaitTimer','WaitMouse','WaitKey','WaitJoy','VWait','Viewport',
+		'Upper','UpdateGamma','UnlockBuffer','UDPTimeouts','UDPStreamPort','UDPStreamIP','UDPMsgPort','UDPMsgIP',
+		'Trim','TotalVidMem','TileImage','TileBlock','TFormImage','TFormFilter','Text',
+		'TCPTimeouts','TCPStreamPort','TCPStreamIP','Tan','SystemProperty','StringWidth','StringHeight','Str','StopNetGame',
+		'StopChannel','StartNetGame','Sqr','SoundVolume','SoundPitch','SoundPan','Sin','Shr',
+		'ShowPointer','Shl','Sgn','SetGfxDriver','SetGamma','SetFont','SetEnv','SetBuffer','SendUDPMsg','SendNetMsg',
+		'SeekFile','SeedRnd','ScanLine','ScaleImage','SaveImage','SaveBuffer','Sar','RuntimeError','RSet',
+		'RotateImage','RndSeed','Rnd','Right','ResumeChannel','Restore','ResizeImage','ResizeBank','Replace',
+		'Repeat','RecvUDPMsg','RecvNetMsg','RectsOverlap','Rect','ReadString','ReadShort','ReadPixelFast','ReadPixel','ReadLine',
+		'ReadInt','ReadFloat','ReadFile','ReadDir','ReadBytes','ReadByte','ReadAvail','Read','Rand','Print',
+		'PokeShort','PokeInt','PokeFloat','PokeByte','Plot','PlaySound','PlayMusic','PlayCDTrack','Pi','PeekShort',
+		'PeekInt','PeekFloat','PeekByte','PauseChannel','Oval','Origin','OpenTCPStream','OpenMovie','OpenFile',
+		'Null','NextFile','New','NetPlayerName','NetPlayerLocal','NetMsgType','NetMsgTo','NetMsgFrom',
+		'NetMsgData','MovieWidth','MoviePlaying','MovieHeight','MoveMouse','MouseZSpeed','MouseZ','MouseYSpeed','MouseY','MouseXSpeed',
+		'MouseX','MouseHit','MouseDown','Mod','Millisecs','MidHandle','Mid','MaskImage','LSet','Lower',
+		'LoopSound','Log10','Log','LockBuffer','Locate','Local','LoadSound','LoadImage','LoadFont','LoadBuffer',
+		'LoadAnimImage','Line','Len','Left','KeyHit','KeyDown','JoyZDir','JoyZ','JoyYDir',
+		'JoyYaw','JoyY','JoyXDir','JoyX','JoyVDir','JoyV','JoyUDir','JoyU','JoyType','JoyRoll',
+		'JoyPitch','JoyHit','JoyHat','JoyDown','JoinNetGame','Instr','Insert','Input',
+		'ImageYHandle','ImageXHandle','ImageWidth','ImagesOverlap','ImagesCollide','ImageRectOverlap','ImageRectCollide','ImageHeight','ImageBuffer','If',
+		'HostNetGame','HostIP','HidePointer','Hex','HandleImage','GraphicsWidth','GraphicsHeight','GraphicsDepth','GraphicsBuffer','Graphics',
+		'GrabImage','Global','GFXModeWidth','GFXModeHeight','GfxModeExists','GFXModeDepth','GfxDriverName','GetMouse',
+		'GetKey','GetJoy','GetEnv','GetColor','GammaRed','GammaGreen','GammaBlue','Function','FrontBuffer','FreeTimer',
+		'FreeSound','FreeImage','FreeFont','FreeBank','FontWidth','FontHeight','FlushMouse','FlushKeys',
+		'FlushJoy','Floor','Flip','First','FileType','FileSize','FilePos','Field',
+		'Exp','Exit','ExecFile','Eof','EndGraphics','Each','DrawMovie','DrawImageRect','DrawImage','DrawBlockRect','DrawBlock',
+		'DottedIP','Dim','DeleteNetPlayer','DeleteFile','DeleteDir','Delete','Delay','Default','DebugLog','Data',
+		'CurrentTime','CurrentDir','CurrentDate','CreateUDPStream','CreateTimer','CreateTCPServer','CreateNetPlayer','CreateImage','CreateDir','CreateBank',
+		'CountHostIPs','CountGFXModes','CountGfxDrivers','Cos','CopyStream','CopyRect','CopyPixelFast','CopyPixel','CopyImage','CopyFile',
+		'CopyBank','Const','CommandLine','ColorRed','ColorGreen','ColorBlue','Color','ClsColor','Cls','CloseUDPStream',
+		'CloseTCPStream','CloseTCPServer','CloseMovie','CloseFile','CloseDir','Chr','ChannelVolume','ChannelPlaying','ChannelPitch','ChannelPan',
+		'ChangeDir','Ceil','CallDLL','Bin','BankSize','BackBuffer','AvailVidMem','AutoMidHandle',
+		'ATan2','ATan','ASin','Asc','After','ACos','AcceptTCPStream','Abs',
+		// 3D Commands
+		'Wireframe','Windowed3D','WBuffer','VertexZ','VertexY',
+		'VertexX','VertexW','VertexV','VertexU','VertexTexCoords','VertexRed','VertexNZ','VertexNY','VertexNX','VertexNormal',
+		'VertexGreen','VertexCoords','VertexColor','VertexBlue','VertexAlpha','VectorYaw','VectorPitch','UpdateWorld','UpdateNormals','TurnEntity',
+		'TrisRendered','TriangleVertex','TranslateEntity','TFormVector','TFormPoint','TFormNormal','TFormedZ','TFormedY','TFormedX','TextureWidth',
+		'TextureName','TextureHeight','TextureFilter','TextureCoords','TextureBuffer','TextureBlend','TerrainZ','TerrainY','TerrainX','TerrainSize',
+		'TerrainShading','TerrainHeight','TerrainDetail','SpriteViewMode','ShowEntity','SetCubeFace','SetAnimTime','SetAnimKey','ScaleTexture','ScaleSprite',
+		'ScaleMesh','ScaleEntity','RotateTexture','RotateSprite','RotateMesh','RotateEntity','ResetEntity','RenderWorld','ProjectedZ','ProjectedY',
+		'ProjectedX','PositionTexture','PositionMesh','PositionEntity','PointEntity','PickedZ','PickedY','PickedX','PickedTriangle','PickedTime',
+		'PickedSurface','PickedNZ','PickedNY','PickedNX','PickedEntity','PaintSurface','PaintMesh','PaintEntity','NameEntity','MoveEntity',
+		'ModifyTerrain','MeshWidth','MeshHeight','MeshesIntersect','MeshDepth','MD2AnimTime','MD2AnimLength','MD2Animating','LoadTexture','LoadTerrain',
+		'LoadSprite','LoadMesh','LoadMD2','LoaderMatrix','LoadBSP','LoadBrush','LoadAnimTexture','LoadAnimSeq','LoadAnimMesh','Load3DSound',
+		'LinePick','LightRange','LightMesh','LightConeAngles','LightColor','HWMultiTex','HideEntity','HandleSprite','Graphics3D','GfxMode3DExists',
+		'GfxMode3D','GfxDriverCaps3D','GfxDriver3D','GetSurfaceBrush','GetSurface','GetParent','GetMatElement','GetEntityType','GetEntityBrush','GetChild',
+		'GetBrushTexture','FreeTexture','FreeEntity','FreeBrush','FlipMesh','FitMesh','FindSurface','FindChild','ExtractAnimSeq','EntityZ',
+		'EntityYaw','EntityY','EntityX','EntityVisible','EntityType','EntityTexture','EntityShininess','EntityRoll','EntityRadius','EntityPitch',
+		'EntityPickMode','EntityPick','EntityParent','EntityOrder','EntityName','EntityInView','EntityFX','EntityDistance','EntityColor','EntityCollided',
+		'EntityBox','EntityBlend','EntityAutoFade','EntityAlpha','EmitSound','Dither','DeltaYaw','DeltaPitch','CreateTexture','CreateTerrain',
+		'CreateSurface','CreateSprite','CreateSphere','CreatePlane','CreatePivot','CreateMirror','CreateMesh','CreateListener','CreateLight','CreateCylinder',
+		'CreateCube','CreateCone','CreateCamera','CreateBrush','CountVertices','CountTriangles','CountSurfaces','CountGfxModes3D','CountCollisions','CountChildren',
+		'CopyMesh','CopyEntity','CollisionZ','CollisionY','CollisionX','CollisionTriangle','CollisionTime','CollisionSurface','Collisions','CollisionNZ',
+		'CollisionNY','CollisionNX','CollisionEntity','ClearWorld','ClearTextureFilters','ClearSurface','ClearCollisions','CaptureWorld','CameraZoom','CameraViewport',
+		'CameraRange','CameraProjMode','CameraProject','CameraPick','CameraFogRange','CameraFogMode','CameraFogColor','CameraClsMode','CameraClsColor','BSPLighting',
+		'BSPAmbientLight','BrushTexture','BrushShininess','BrushFX','BrushColor','BrushBlend','BrushAlpha','AntiAlias','AnimTime','AnimSeq',
+		'AnimLength','Animating','AnimateMD2','Animate','AmbientLight','AlignToVector','AddVertex','AddTriangle','AddMesh','AddAnimSeq',
+      )
+    ),
+  'SYMBOLS' => array(
+  	'(',')'
+  	),
+  'CASE_SENSITIVE' => array(
+    GESHI_COMMENTS => false,
+    1 => false,
+    2 => false,
+    ),
+  'STYLES' => array(
+    'KEYWORDS' => array(
+      1 => 'color: #000066; font-weight: bold;',
+       2 => 'color: #0000ff;'
+      ),
+    'COMMENTS' => array(
+      1 => 'color: #D9D100; font-style: italic;',
+      ),
+    'ESCAPE_CHAR' => array(
+      0 => 'color: #000099; font-weight: bold;'
+      ),
+    'BRACKETS' => array(
+      0 => 'color: #000066;'
+      ),
+    'STRINGS' => array(
+      0 => 'color: #009900;'
+      ),
+    'NUMBERS' => array(
+      0 => 'color: #CC0000;'
+      ),
+    'METHODS' => array(
+      1 => 'color: #006600;'
+      ),
+    'SYMBOLS' => array(
+      0 => 'color: #000066;'
+      ),
+    'REGEXPS' => array(
+      0 => 'font-weight: bold;'
+      ),
+    'SCRIPT' => array(
+      0 => '',
+      1 => '',
+      )
+    ),
+  'URLS' => array(
+		1 => ''
+  	),
+  'OOLANG' => false,
+  'OBJECT_SPLITTERS' => array(
+  	1 => '\\'
+	),
+  'REGEXPS' => array(
+
+  ),
+  'STRICT_MODE_APPLIES' => GESHI_NEVER,
+  'SCRIPT_DELIMITERS' => array(),
+  'HIGHLIGHT_STRICT_BLOCK' => array(
+    0 => false,
+    1 => false
+  )
+);
+
+?>
\ No newline at end of file
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/caddcl.php 0.762/modules/pn_bbcode/pnincludes/geshi/caddcl.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/caddcl.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/caddcl.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Roberto Rossi (rsoftware@altervista.org)
  * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/08/30
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * CAD DCL (Dialog Control Language) file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/cadlisp.php 0.762/modules/pn_bbcode/pnincludes/geshi/cadlisp.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/cadlisp.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/cadlisp.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -----------
  * Author: Roberto Rossi (rsoftware@altervista.org)
  * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/blog)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/08/30
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * AutoCAD/IntelliCAD Lisp language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/c_mac.php 0.762/modules/pn_bbcode/pnincludes/geshi/c_mac.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/c_mac.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/c_mac.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ---------
  * Author: M. Uli Kusterer (witness.of.teachtext@gmx.net)
  * Copyright: (c) 2004 M. Uli Kusterer, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/04
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * C for Macs language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/c.php 0.762/modules/pn_bbcode/pnincludes/geshi/c.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/c.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/c.php	2005-12-14 16:35:54.000000000 -0600
@@ -6,10 +6,10 @@
  * Contributors:
  *  - Jack Lloyd (lloyd@randombit.net)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/04
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * C language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/cpp.php 0.762/modules/pn_bbcode/pnincludes/geshi/cpp.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/cpp.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/cpp.php	2005-12-14 16:35:54.000000000 -0600
@@ -7,10 +7,10 @@
  *  - M. Uli Kusterer (witness.of.teachtext@gmx.net)
  *  - Jack Lloyd (lloyd@randombit.net)
  * Copyright: (c) 2004 Dennis Bayer, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/09/27
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * C++ language file for GeSHi.
  *
@@ -75,7 +75,7 @@
 			'EXIT_FAILURE', 'EXIT_SUCCESS', 'RAND_MAX', 'CLOCKS_PER_SEC',
 			'virtual', 'public', 'private', 'protected', 'template', 'using', 'namespace',
 			'try', 'catch', 'inline', 'dynamic_cast', 'const_cast', 'reinterpret_cast',
-			'static_cast', 'explicit', 'friend', 'wchar_t', 'typename', 'typeid'
+			'static_cast', 'explicit', 'friend', 'wchar_t', 'typename', 'typeid', 'class'
 			),
 		3 => array(
 			'cin', 'cerr', 'clog', 'cout', 'delete', 'new', 'this',
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/csharp.php 0.762/modules/pn_bbcode/pnincludes/geshi/csharp.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/csharp.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/csharp.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Alan Juden (alan@judenware.org)
  * Copyright: (c) 2004 Alan Juden, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/04
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * C# language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/css.php 0.762/modules/pn_bbcode/pnincludes/geshi/css.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/css.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/css.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -------
  * Author: Nigel McNie (oracle.shinoda@gmail.com)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/18
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * CSS language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/delphi.php 0.762/modules/pn_bbcode/pnincludes/geshi/delphi.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/delphi.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/delphi.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Jrja Norbert (jnorbi@vipmail.hu)
  * Copyright: (c) 2004 Jrja Norbert, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/07/26
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Delphi (Object Pascal) language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/diff.php 0.762/modules/pn_bbcode/pnincludes/geshi/diff.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/diff.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/diff.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: Conny Brunnkvist (conny@fuchsia.se)
  * Copyright: (c) 2004 Fuchsia Open Source Solutions (http://www.fuchsia.se/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.2 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.3 $
  * Date Started: 2004/12/29
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Diff-output language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/div.php 0.762/modules/pn_bbcode/pnincludes/geshi/div.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/div.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/div.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ---------------------------------
  * Author: Gabriel Lorenzo (ermakina@gmail.com)
  * Copyright: (c) 2005 Gabriel Lorenzo (http://ermakina.gazpachito.net)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.2 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.3 $
  * Date Started: 2005/06/19
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * DIV language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/dos.php 0.762/modules/pn_bbcode/pnincludes/geshi/dos.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/dos.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/dos.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -------
  * Author: Alessandro Staltari (staltari@geocities.com)
  * Copyright: (c) 2005 Alessandro Staltari (http://www.geocities.com/SiliconValley/Vista/8155/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.1 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.2 $
  * Date Started: 2005/07/05
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * DOS language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/d.php 0.762/modules/pn_bbcode/pnincludes/geshi/d.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/d.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/d.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -----
  * Author: Thomas Kuehne (thomas@kuehne.cn)
  * Copyright: (c) 2005 Thomas Kuehne (http://thomas.kuehne.cn/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.2 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.3 $
  * Date Started: 2005/04/22
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * D language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/eiffel.php 0.762/modules/pn_bbcode/pnincludes/geshi/eiffel.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/eiffel.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/eiffel.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Zoran Simic (zsimic@axarosenberg.com)
  * Copyright: (c) 2005 Zoran Simic
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.2 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.3 $
  * Date Started: 2005/06/30
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Eiffel language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/freebasic.php 0.762/modules/pn_bbcode/pnincludes/geshi/freebasic.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/freebasic.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/freebasic.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,7 +4,7 @@
  * -------------
  * Author: Roberto Rossi 
  * Copyright: (c) 2005 Roberto Rossi (http://rsoftware.altervista.org)
- * Release Version: 1.0.7.3
+ * Release Version: 1.0.7.5
  * Date Started: 2005/08/19
  *
  * FreeBasic (http://www.freebasic.net/) language file for GeSHi.
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/gml.php 0.762/modules/pn_bbcode/pnincludes/geshi/gml.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/gml.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/gml.php	2005-12-14 16:35:54.000000000 -0600
@@ -2,12 +2,12 @@
 /*************************************************************************************
  * gml.php
  * --------
- * Author: Jos Jorge Enrquez Rodrguez (aka Geo) (josejorge@gmail.com)
- * Copyright: (c) 2004 Jos Jorge Enrquez Rodrguez (http://www.zonamakers.com)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.2 $
+ * Author: Jos Jorge Enrquez (jenriquez@users.sourceforge.net)
+ * Copyright: (c) 2005 Jos Jorge Enrquez Rodrguez (http://www.zonamakers.com)
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.3 $
  * Date Started: 2005/06/21
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * GML language file for GeSHi.
  *
@@ -15,24 +15,33 @@
  * a game creation program, more info about Game Maker can be found at
  * http://www.gamemaker.nl/
  * All GML keywords were extracted from the Game Maker HTML Help file using a PHP
- * script (I love PHP for saving me that bunch of work :P!). I think all GML
- * functions have been indexed here, but I'm not sure about it, so please let me
- * know of any issue you may find.
+ * script (one section at a time). I love PHP for saving me that bunch of work :P!.
+ * I think all GML functions have been indexed here, but I'm not sure about it, so
+ * please let me know of any issue you may find.
  *
  * CHANGES
  * -------
- * 2005/06/26 (1.0.0)
- *  -  First Release
+ * 2005/11/11
+ *  -  Changed 'CASE_KEYWORDS' fom 'GESHI_CAPS_LOWER' to 'GESHI_CAPS_NO_CHANGE',
+ *     so that MCI_command appears correctly (the only GML function using capitals).
+ *  -  Changed 'CASE_SENSITIVE' options, 'GESHI_COMMENTS' from true to false and all
+ *     of the others from false to true.
+ *  -  Deleted repeated entries.
+ *  -  div and mod are language keywords, moved (from symbols) to the appropiate section (1).
+ *  -  Moved self, other, all, noone and global identifiers to language keywords section 1.
+ *  -  Edited this file lines to a maximum width of 100 characters (as stated in
+ *     the GeSHi docs). Well, not strictly to 100 but around it.
+ *  -  Corrected some minor issues (the vk_f1...vk_f12 keys and similar).
+ *  -  Deleted the KEYWORDS=>5 and KEYWORDS=>6 sections (actually, they were empty).
+ *     I was planning of using those for the GML functions available only in the
+ *     registered version of the program, but not anymore.
  *
- * TODO (updated 2005/06/26)
+ * 2005/06/26 (1.0.3)
+ *  -  First Release.
+ *
+ * TODO (updated 2005/11/11)
  * -------------------------
- *  -  Include GML constants and variables I may have missed.
- *  -  Check for repeated entries (there are some at the end of KEYWORDS=>2 and may
- *     be more).
- *  -  Compare to Game Maker's built-in editor syntax highlighting to find out
- *     whether div and mod are operators or GML language keywords.
- *  -  Edit this file lines to a maximum width of 100 characters (as stated in
- *     the GeSHi docs).
+ *  -  Test it for a while and make the appropiate corrections.
  *
  *************************************************************************************
  *
@@ -58,7 +67,7 @@
 	'LANG_NAME' => 'GML',
 	'COMMENT_SINGLE' => array(1 => '//'),
 	'COMMENT_MULTI' => array('/*' => '*/'),
-	'CASE_KEYWORDS' => GESHI_CAPS_LOWER,
+	'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
 	'QUOTEMARKS' => array("'"),
 	'ESCAPE_CHAR' => '\\',
 	'KEYWORDS' => array(
@@ -66,169 +75,377 @@
 		1 => array(
 			'break', 'continue', 'do', 'until', 'if', 'else',
 			'exit', 'for', 'for', 'repeat', 'return', 'switch',
-			'case', 'default', 'var', 'while', 'with'
+			'case', 'default', 'var', 'while', 'with', 'div', 'mod', 
+			// GML Language overview
+			'self', 'other', 'all', 'noone', 'global',
 			),
 		// modifiers and built-in variables
 		2 => array(
-			'self', 'other', 'all', 'noone', 'global',
-			'x','y','xprevious','yprevious','xstart','ystart','hspeed','vspeed','direction','speed','friction','gravity','gravity_direction',
-			'path_index','path_position','path_positionprevious','path_speed','path_orientation','path_scale','path_endaction',
+			// Game play
+			'x','y','xprevious','yprevious','xstart','ystart','hspeed','vspeed','direction','speed',
+			'friction','gravity','gravity_direction',
+			'path_index','path_position','path_positionprevious','path_speed','path_orientation',
+			'path_scale','path_endaction',
 			'object_index','id','mask_index','solid','persistent','instance_count','instance_id',
-			'room_speed','fps','current_time','current_year','current_month','current_day','current_weekday','current_hour','current_minute','current_second','alarm','timeline_index','timeline_position','timeline_speed',
+			'room_speed','fps','current_time','current_year','current_month','current_day','current_weekday',
+			'current_hour','current_minute','current_second','alarm','timeline_index','timeline_position',
+			'timeline_speed',
 			'room','room_first','room_last','room_width','room_height','room_caption','room_persistent',
-			'score','lives','health','show_score','show_lives','show_health','caption_score','caption_lives','caption_health',
+			'score','lives','health','show_score','show_lives','show_health','caption_score','caption_lives',
+			'caption_health',
 			'event_type','event_number','event_object','event_action',
 			'error_occurred','error_last',
+			// User interaction
 			'keyboard_lastkey','keyboard_key','keyboard_lastchar','keyboard_string',
 			'mouse_x','mouse_y','mouse_button','mouse_lastbutton',
-			'visible','sprite_index','sprite_width','sprite_height','sprite_xoffset','sprite_yoffset','image_number','image_index','image_speed','depth','image_xscale','image_yscale','image_angle','image_alpha','image_blend','bbox_left','bbox_right','bbox_top','bbox_bottom',
-			'background_color','background_showcolor','background_visible','background_foreground','background_index','background_x','background_y','background_width','background_height','background_htiled','background_vtiled','background_xscale','background_yscale','background_hspeed','background_vspeed','background_blend','background_alpha',
+			// Game Graphics
+			'visible','sprite_index','sprite_width','sprite_height','sprite_xoffset','sprite_yoffset',
+			'image_number','image_index','image_speed','depth','image_xscale','image_yscale','image_angle',
+			'image_alpha','image_blend','bbox_left','bbox_right','bbox_top','bbox_bottom',
+			'background_color','background_showcolor','background_visible','background_foreground',
+			'background_index','background_x','background_y','background_width','background_height',
+			'background_htiled','background_vtiled','background_xscale','background_yscale',
+			'background_hspeed','background_vspeed','background_blend','background_alpha',
 			'background','left, top, width, height','x,y','depth','visible','xscale, yscale','blend','alpha',
-			'view_enabled','view_current','view_visible','view_yview','view_wview','view_hview','view_xport','view_yport','view_wport','view_hport','view_angle','view_hborder','view_vborder','view_hspeed','view_vspeed','view_object',
+			'view_enabled','view_current','view_visible','view_yview','view_wview','view_hview','view_xport',
+			'view_yport','view_wport','view_hport','view_angle','view_hborder','view_vborder','view_hspeed',
+			'view_vspeed','view_object',
 			'transition_kind',
+			// Files, registry and executing programs
 			'game_id','working_directory','temp_directory',
 			'secure_mode',
-			'xmin, xmax, ymin, ymax','shape','distribution','particle type','number',
-			'x,y','force','dist','kind','additive',
-			'xmin, xmax, ymin, ymax','shape',
-			'xmin, xmax, ymin, ymax','kind','friction',
-			'xmin, xmax, ymin, ymax','shape','parttype1','parttype2','kind',
+			// Creating particles
+			'xmin', 'xmax', 'ymin', 'ymax','shape','distribution','particle type','number',
+			'x', 'y', 'force','dist','kind','additive', 'friction', 'parttype1', 'parttype2'
 			),
 		// functions
 		3 => array(
-			'random','choose','abs','sign','round','floor','ceil','frac','sqrt','sqr','power','exp','ln','log2','log10','logn','sin','cos','tan','arcsin','arccos','arctan','arctan2','degtorad','radtodeg','min','max','mean','median','point_distance','point_direction','lengthdir_x','lengthdir_y','is_real','is_string',
-			'chr','ord','real','string','string_format','string_length','string_pos','string_copy','string_char_at','string_delete','string_insert','string_replace','string_replace_all','string_count','string_lower','string_upper','string_repeat','string_letters','string_digits','string_lettersdigits','clipboard_has_text','clipboard_get_text','clipboard_set_text',
-			'date_current_datetime','date_current_date','date_current_time','date_create_datetime','date_create_date','date_create_time','date_valid_datetime','date_valid_date','date_valid_time','date_inc_year','date_inc_month','date_inc_week','date_inc_day','date_inc_hour','date_inc_minute','date_inc_second','date_get_year','date_get_month','date_get_week','date_get_day','date_get_hour',
-			'date_get_minute','date_get_second','date_get_weekday','date_get_day_of_year','date_get_hour_of_year','date_get_minute_of_year','date_get_second_of_year','date_year_span','date_month_span','date_week_span','date_day_span','date_hour_span','date_minute_span','date_second_span','date_compare_datetime','date_compare_date','date_compare_time','date_date_of','date_time_of','date_datetime_string','date_date_string','date_time_string','date_days_in_month','date_days_in_year','date_leap_year','date_is_today',
-			'motion_set','motion_add','place_free','place_empty','place_meeting','place_snapped','move_random','move_snap','move_wrap','move_towards_point','move_bounce_solid','move_bounce_all','move_contact_solid','move_contact_all','move_outside_solid','move_outside_all','distance_to_point','distance_to_object','position_empty','position_meeting',
+			// Computing things
+			'random','choose','abs','sign','round','floor','ceil','frac','sqrt','sqr','power','exp','ln',
+			'log2','log10','logn','sin','cos','tan','arcsin','arccos','arctan','arctan2','degtorad',
+			'radtodeg','min','max','mean','median','point_distance','point_direction','lengthdir_x',
+			'lengthdir_y','is_real','is_string',
+			'chr','ord','real','string','string_format','string_length','string_pos','string_copy',
+			'string_char_at','string_delete','string_insert','string_replace','string_replace_all',
+			'string_count','string_lower','string_upper','string_repeat','string_letters','string_digits',
+			'string_lettersdigits','clipboard_has_text','clipboard_get_text','clipboard_set_text',
+			'date_current_datetime','date_current_date','date_current_time','date_create_datetime',
+			'date_create_date','date_create_time','date_valid_datetime','date_valid_date','date_valid_time',
+			'date_inc_year','date_inc_month','date_inc_week','date_inc_day','date_inc_hour',
+			'date_inc_minute','date_inc_second','date_get_year','date_get_month','date_get_week',
+			'date_get_day','date_get_hour', 'date_get_minute','date_get_second','date_get_weekday',
+			'date_get_day_of_year','date_get_hour_of_year','date_get_minute_of_year',
+			'date_get_second_of_year','date_year_span','date_month_span','date_week_span','date_day_span',
+			'date_hour_span','date_minute_span','date_second_span','date_compare_datetime',
+			'date_compare_date','date_compare_time','date_date_of','date_time_of','date_datetime_string',
+			'date_date_string','date_time_string','date_days_in_month','date_days_in_year','date_leap_year',
+			'date_is_today',
+			// Game play
+			'motion_set','motion_add','place_free','place_empty','place_meeting','place_snapped',
+			'move_random','move_snap','move_wrap','move_towards_point','move_bounce_solid','move_bounce_all',
+			'move_contact_solid','move_contact_all','move_outside_solid','move_outside_all',
+			'distance_to_point','distance_to_object','position_empty','position_meeting',
 			'path_start','path_end',
-			'mp_linear_step','mp_linear_step_object','mp_potential_step','mp_potential_step_object','mp_potential_settings','mp_linear_path','mp_linear_path_object',
-			'mp_potential_path','mp_potential_path_object','mp_grid_create','mp_grid_destroy','mp_grid_clear_all','mp_grid_clear_cell','mp_grid_clear_rectangle','mp_grid_add_cell','mp_grid_add_rectangle','mp_grid_add_instances','mp_grid_path','mp_grid_draw',
+			'mp_linear_step','mp_linear_step_object','mp_potential_step','mp_potential_step_object',
+			'mp_potential_settings','mp_linear_path','mp_linear_path_object', 'mp_potential_path',
+			'mp_potential_path_object','mp_grid_create','mp_grid_destroy','mp_grid_clear_all',
+			'mp_grid_clear_cell','mp_grid_clear_rectangle','mp_grid_add_cell','mp_grid_add_rectangle',
+			'mp_grid_add_instances','mp_grid_path','mp_grid_draw',
 			'collision_point','collision_rectangle','collision_circle','collision_ellipse','collision_line',
-			'instance_find','instance_exists','instance_number','instance_position','instance_nearest','instance_furthest','instance_place','instance_create','instance_copy','instance_destroy','instance_change','position_destroy','position_change',
-			'instance_deactivate_all','instance_deactivate_object','instance_deactivate_region','instance_activate_all','instance_activate_object','instance_activate_region',
+			'instance_find','instance_exists','instance_number','instance_position','instance_nearest',
+			'instance_furthest','instance_place','instance_create','instance_copy','instance_destroy',
+			'instance_change','position_destroy','position_change',
+			'instance_deactivate_all','instance_deactivate_object','instance_deactivate_region',
+			'instance_activate_all','instance_activate_object','instance_activate_region',
 			'sleep',
-			'room_goto','room_goto_previous','room_goto_next','room_restart','room_previous','room_next','game_end','game_restart','game_save','game_load',
-			'event_perform',
-			'event_perform_object','event_user','event_inherited',
-			'show_debug_message','variable_global_exists','variable_local_exists','variable_global_get','variable_global_array_get','variable_global_array2_get','variable_local_get','variable_local_array_get','variable_local_array2_get','variable_global_set','variable_global_array_set','variable_global_array2_set','variable_local_set','variable_local_array_set','variable_local_array2_set','set_program_priority',
-			'keyboard_set_map','keyboard_get_map','keyboard_unset_map','keyboard_check','keyboard_check_pressed','keyboard_check_released','keyboard_check_direct','keyboard_get_numlock','keyboard_set_numlock','keyboard_key_press','keyboard_key_release',
+			'room_goto','room_goto_previous','room_goto_next','room_restart','room_previous','room_next',
+			'game_end','game_restart','game_save','game_load',
+			'event_perform', 'event_perform_object','event_user','event_inherited',
+			'show_debug_message','variable_global_exists','variable_local_exists','variable_global_get',
+			'variable_global_array_get','variable_global_array2_get','variable_local_get',
+			'variable_local_array_get','variable_local_array2_get','variable_global_set',
+			'variable_global_array_set','variable_global_array2_set','variable_local_set',
+			'variable_local_array_set','variable_local_array2_set','set_program_priority',
+			// User interaction
+			'keyboard_set_map','keyboard_get_map','keyboard_unset_map','keyboard_check',
+			'keyboard_check_pressed','keyboard_check_released','keyboard_check_direct',
+			'keyboard_get_numlock','keyboard_set_numlock','keyboard_key_press','keyboard_key_release',
 			'keyboard_clear','io_clear','io_handle','keyboard_wait',
-			'mouse_check_button','mouse_check_button_pressed','mouse_check_button_released','mouse_clear','io_clear','io_handle','mouse_wait',
-			'joystick_exists','joystick_name','joystick_axes','joystick_buttons','joystick_has_pov','joystick_direction','joystick_check_button','joystick_xpos','joystick_ypos','joystick_zpos','joystick_rpos','joystick_upos','joystick_vpos','joystick_pov',
-			'draw_sprite','draw_sprite_stretched','draw_sprite_tiled','draw_sprite_part','draw_background','draw_background_stretched','draw_background_tiled','draw_background_part','draw_sprite_ext','draw_sprite_stretched_ext','draw_sprite_tiled_ext','draw_sprite_part_ext','draw_sprite_general','draw_background_ext','draw_background_stretched_ext','draw_background_tiled_ext','draw_background_part_ext','draw_background_general',
-			'draw_clear','draw_clear_alpha','draw_point','draw_line','draw_rectangle','draw_roundrect','draw_triangle','draw_circle','draw_ellipse','draw_arrow','draw_button','draw_path','draw_healthbar','draw_set_color','draw_set_alpha','draw_get_color','draw_get_alpha',
-			'make_color_rgb','make_color_hsv','color_get_red','color_get_green','color_get_blue','color_get_hue','color_get_saturation','color_get_value','merge_color','draw_getpixel','screen_save','screen_save_part',
-			'draw_set_font','draw_set_halign','draw_set_valign','draw_text','draw_text_ext','string_width','string_height','string_width_ext','string_height_ext','draw_text_transformed','draw_text_ext_transformed','draw_text_color','draw_text_ext_color','draw_text_transformed_color','draw_text_ext_transformed_color',
-			'draw_point_color','draw_line_color','draw_rectangle_color','draw_roundrect_color','draw_triangle_color','draw_circle_color','draw_ellipse_color','draw_primitive_begin','draw_vertex','draw_vertex_color','draw_primitive_end','sprite_get_texture','background_get_texture','texture_preload','texture_set_priority',
-			'texture_get_width','texture_get_height','draw_primitive_begin_texture','draw_vertex_texture','draw_vertex_texture_color','draw_primitive_end','texture_set_interpolation','texture_set_blending','texture_set_repeat','draw_set_blend_mode','draw_set_blend_mode_ext',
-			'surface_create','surface_free','surface_exists','surface_get_width','surface_get_height','surface_get_texture','surface_set_target','surface_reset_target','surface_getpixel','surface_save','surface_save_part','draw_surface','draw_surface_stretched','draw_surface_tiled','draw_surface_part','draw_surface_ext','draw_surface_stretched_ext','draw_surface_tiled_ext','draw_surface_part_ext','draw_surface_general','surface_copy','surface_copy_part',
-			'tile_add','tile_delete','tile_exists','tile_get_x','tile_get_y','tile_get_left','tile_get_top','tile_get_width','tile_get_height','tile_get_depth','tile_get_visible','tile_get_xscale','tile_get_yscale','tile_get_background','tile_get_blend','tile_get_alpha','tile_set_position','tile_set_region','tile_set_background','tile_set_visible','tile_set_depth','tile_set_scale','tile_set_blend','tile_set_alpha','tile_layer_hide','tile_layer_show','tile_layer_delete','tile_layer_shift','tile_layer_find','tile_layer_delete_at','tile_layer_depth',
-			'display_get_width','display_get_height','display_get_colordepth','display_get_frequency','display_set_size','display_set_colordepth','display_set_frequency','display_set_all','display_test_all','display_reset','display_mouse_get_x','display_mouse_get_y','display_mouse_set',
-			'window_set_visible','window_get_visible','window_set_fullscreen','window_get_fullscreen','window_set_showborder','window_get_showborder','window_set_showicons','window_get_showicons','window_set_stayontop','window_get_stayontop','window_set_sizeable','window_get_sizeable','window_set_caption','window_get_caption','window_set_cursor',
-			'window_get_cursor','window_set_color','window_get_color','window_set_region_scale','window_get_region_scale','window_set_position','window_set_size','window_set_rectangle','window_center','window_default','window_get_x','window_get_y','window_get_width','window_get_height','window_mouse_get_x','window_mouse_get_y','window_mouse_set',
-			'window_set_region_size','window_get_region_width','window_get_region_height','window_view_mouse_get_x','window_view_mouse_get_y','window_view_mouse_set','window_views_mouse_get_x','window_views_mouse_get_y','window_views_mouse_set',
+			'mouse_check_button','mouse_check_button_pressed','mouse_check_button_released','mouse_clear',
+			'io_clear','io_handle','mouse_wait',
+			'joystick_exists','joystick_name','joystick_axes','joystick_buttons','joystick_has_pov',
+			'joystick_direction','joystick_check_button','joystick_xpos','joystick_ypos','joystick_zpos',
+			'joystick_rpos','joystick_upos','joystick_vpos','joystick_pov',
+			// Game Graphics
+			'draw_sprite','draw_sprite_stretched','draw_sprite_tiled','draw_sprite_part','draw_background',
+			'draw_background_stretched','draw_background_tiled','draw_background_part','draw_sprite_ext',
+			'draw_sprite_stretched_ext','draw_sprite_tiled_ext','draw_sprite_part_ext','draw_sprite_general',
+			'draw_background_ext','draw_background_stretched_ext','draw_background_tiled_ext',
+			'draw_background_part_ext','draw_background_general',
+			'draw_clear','draw_clear_alpha','draw_point','draw_line','draw_rectangle','draw_roundrect',
+			'draw_triangle','draw_circle','draw_ellipse','draw_arrow','draw_button','draw_path',
+			'draw_healthbar','draw_set_color','draw_set_alpha','draw_get_color','draw_get_alpha',
+			'make_color_rgb','make_color_hsv','color_get_red','color_get_green','color_get_blue',
+			'color_get_hue','color_get_saturation','color_get_value','merge_color','draw_getpixel',
+			'screen_save','screen_save_part',
+			'draw_set_font','draw_set_halign','draw_set_valign','draw_text','draw_text_ext','string_width',
+			'string_height','string_width_ext','string_height_ext','draw_text_transformed',
+			'draw_text_ext_transformed','draw_text_color','draw_text_ext_color',
+			'draw_text_transformed_color','draw_text_ext_transformed_color',
+			'draw_point_color','draw_line_color','draw_rectangle_color','draw_roundrect_color',
+			'draw_triangle_color','draw_circle_color','draw_ellipse_color','draw_primitive_begin',
+			'draw_vertex','draw_vertex_color','draw_primitive_end','sprite_get_texture',
+			'background_get_texture','texture_preload','texture_set_priority',
+			'texture_get_width','texture_get_height','draw_primitive_begin_texture','draw_vertex_texture',
+			'draw_vertex_texture_color','draw_primitive_end','texture_set_interpolation',
+			'texture_set_blending','texture_set_repeat','draw_set_blend_mode','draw_set_blend_mode_ext',
+			'surface_create','surface_free','surface_exists','surface_get_width','surface_get_height',
+			'surface_get_texture','surface_set_target','surface_reset_target','surface_getpixel',
+			'surface_save','surface_save_part','draw_surface','draw_surface_stretched','draw_surface_tiled',
+			'draw_surface_part','draw_surface_ext','draw_surface_stretched_ext','draw_surface_tiled_ext',
+			'draw_surface_part_ext','draw_surface_general','surface_copy','surface_copy_part',
+			'tile_add','tile_delete','tile_exists','tile_get_x','tile_get_y','tile_get_left','tile_get_top',
+			'tile_get_width','tile_get_height','tile_get_depth','tile_get_visible','tile_get_xscale',
+			'tile_get_yscale','tile_get_background','tile_get_blend','tile_get_alpha','tile_set_position',
+			'tile_set_region','tile_set_background','tile_set_visible','tile_set_depth','tile_set_scale',
+			'tile_set_blend','tile_set_alpha','tile_layer_hide','tile_layer_show','tile_layer_delete',
+			'tile_layer_shift','tile_layer_find','tile_layer_delete_at','tile_layer_depth',
+			'display_get_width','display_get_height','display_get_colordepth','display_get_frequency',
+			'display_set_size','display_set_colordepth','display_set_frequency','display_set_all',
+			'display_test_all','display_reset','display_mouse_get_x','display_mouse_get_y','display_mouse_set',
+			'window_set_visible','window_get_visible','window_set_fullscreen','window_get_fullscreen',
+			'window_set_showborder','window_get_showborder','window_set_showicons','window_get_showicons',
+			'window_set_stayontop','window_get_stayontop','window_set_sizeable','window_get_sizeable',
+			'window_set_caption','window_get_caption','window_set_cursor', 'window_get_cursor',
+			'window_set_color','window_get_color','window_set_region_scale','window_get_region_scale',
+			'window_set_position','window_set_size','window_set_rectangle','window_center','window_default',
+			'window_get_x','window_get_y','window_get_width','window_get_height','window_mouse_get_x',
+			'window_mouse_get_y','window_mouse_set',
+			'window_set_region_size','window_get_region_width','window_get_region_height',
+			'window_view_mouse_get_x','window_view_mouse_get_y','window_view_mouse_set',
+			'window_views_mouse_get_x','window_views_mouse_get_y','window_views_mouse_set',
 			'screen_redraw','screen_refresh','set_automatic_draw','set_synchronization','screen_wait_vsync',
-			'sound_play','sound_loop','sound_stop','sound_stop_all','sound_isplaying','sound_volume','sound_global_volume','sound_fade','sound_pan','sound_background_tempo','sound_set_search_directory',
-			'sound_effect_set','sound_effect_chorus','sound_effect_echo',
-			'sound_effect_flanger','sound_effect_gargle','sound_effect_reverb','sound_effect_compressor','sound_effect_equalizer',
-			'sound_3d_set_sound_position','sound_3d_set_sound_velocity','sound_3d_set_sound_distance','sound_3d_set_sound_cone',
-			'cd_init','cd_present','cd_number','cd_playing','cd_paused','cd_track','cd_length','cd_track_length','cd_position','cd_track_position','cd_play','cd_stop','cd_pause','cd_resume','cd_set_position','cd_set_track_position','cd_open_door','cd_close_door','MCI_command',
+			// Sound and music)
+			'sound_play','sound_loop','sound_stop','sound_stop_all','sound_isplaying','sound_volume',
+			'sound_global_volume','sound_fade','sound_pan','sound_background_tempo','sound_set_search_directory',
+			'sound_effect_set','sound_effect_chorus','sound_effect_echo',	'sound_effect_flanger',
+			'sound_effect_gargle','sound_effect_reverb','sound_effect_compressor','sound_effect_equalizer',
+			'sound_3d_set_sound_position','sound_3d_set_sound_velocity','sound_3d_set_sound_distance',
+			'sound_3d_set_sound_cone',
+			'cd_init','cd_present','cd_number','cd_playing','cd_paused','cd_track','cd_length',
+			'cd_track_length','cd_position','cd_track_position','cd_play','cd_stop','cd_pause','cd_resume',
+			'cd_set_position','cd_set_track_position','cd_open_door','cd_close_door','MCI_command',
+			// Splash screens, highscores, and other pop-ups
 			'show_text','show_image','show_video','show_info','load_info',
-			'show_message','show_message_ext','show_question','get_integer','get_string','message_background','message_alpha','message_button','message_text_font','message_button_font','message_input_font','message_mouse_color','message_input_color','message_caption','message_position','message_size','show_menu','show_menu_pos','get_color','get_open_filename','get_save_filename','get_directory','get_directory_alt','show_error',
-			'highscore_show','highscore_set_background','highscore_set_border','highscore_set_font','highscore_set_colors','highscore_set_strings','highscore_show_ext','highscore_clear','highscore_add','highscore_add_current','highscore_value','highscore_name','draw_highscore',
-			'sprite_exists','sprite_get_name','sprite_get_number','sprite_get_width','sprite_get_height','sprite_get_transparent','sprite_get_smooth','sprite_get_preload','sprite_get_xoffset','sprite_get_yoffset','sprite_get_bbox_left','sprite_get_bbox_right','sprite_get_bbox_top','sprite_get_bbox_bottom','sprite_get_bbox_mode','sprite_get_precise',
-			'sound_exists','sound_get_name','sound_get_kind','sound_get_preload','sound_discard','sound_restore',
-			'background_exists','background_get_name','background_get_width','background_get_height','background_get_transparent','background_get_smooth','background_get_preload',
-			'font_exists','font_get_name','font_get_fontname','font_get_bold','font_get_italic','font_get_first','font_get_last',
-			'path_exists','path_get_name','path_get_length','path_get_kind','path_get_closed','path_get_precision','path_get_number','path_get_point_x','path_get_point_y','path_get_point_speed','path_get_x','path_get_y','path_get_speed',
+			'show_message','show_message_ext','show_question','get_integer','get_string',
+			'message_background','message_alpha','message_button','message_text_font','message_button_font',
+			'message_input_font','message_mouse_color','message_input_color','message_caption',
+			'message_position','message_size','show_menu','show_menu_pos','get_color','get_open_filename',
+			'get_save_filename','get_directory','get_directory_alt','show_error',
+			'highscore_show','highscore_set_background','highscore_set_border','highscore_set_font',
+			'highscore_set_colors','highscore_set_strings','highscore_show_ext','highscore_clear',
+			'highscore_add','highscore_add_current','highscore_value','highscore_name','draw_highscore',
+			// Resources
+			'sprite_exists','sprite_get_name','sprite_get_number','sprite_get_width','sprite_get_height',
+			'sprite_get_transparent','sprite_get_smooth','sprite_get_preload','sprite_get_xoffset',
+			'sprite_get_yoffset','sprite_get_bbox_left','sprite_get_bbox_right','sprite_get_bbox_top',
+			'sprite_get_bbox_bottom','sprite_get_bbox_mode','sprite_get_precise',
+			'sound_exists','sound_get_name','sound_get_kind','sound_get_preload','sound_discard',
+			'sound_restore',
+			'background_exists','background_get_name','background_get_width','background_get_height',
+			'background_get_transparent','background_get_smooth','background_get_preload',
+			'font_exists','font_get_name','font_get_fontname','font_get_bold','font_get_italic',
+			'font_get_first','font_get_last',
+			'path_exists','path_get_name','path_get_length','path_get_kind','path_get_closed',
+			'path_get_precision','path_get_number','path_get_point_x','path_get_point_y',
+			'path_get_point_speed','path_get_x','path_get_y','path_get_speed',
 			'script_exists','script_get_name','script_get_text',
 			'timeline_exists','timeline_get_name',
-			'object_exists','object_get_name','object_get_sprite','object_get_solid','object_get_visible','object_get_depth','object_get_persistent','object_get_mask','object_get_parent','object_is_ancestor',
+			'object_exists','object_get_name','object_get_sprite','object_get_solid','object_get_visible',
+			'object_get_depth','object_get_persistent','object_get_mask','object_get_parent',
+			'object_is_ancestor',
 			'room_exists','room_get_name',
-			'sprite_set_offset','sprite_set_bbox_mode','sprite_set_bbox','sprite_set_precise','sprite_duplicate','sprite_assign','sprite_merge','sprite_add','sprite_replace','sprite_create_from_screen','sprite_add_from_screen','sprite_create_from_surface','sprite_add_from_surface','sprite_delete','sprite_set_alpha_from_sprite',
+			// Changing resources
+			'sprite_set_offset','sprite_set_bbox_mode','sprite_set_bbox','sprite_set_precise',
+			'sprite_duplicate','sprite_assign','sprite_merge','sprite_add','sprite_replace',
+			'sprite_create_from_screen','sprite_add_from_screen','sprite_create_from_surface',
+			'sprite_add_from_surface','sprite_delete','sprite_set_alpha_from_sprite',
 			'sound_add','sound_replace','sound_delete',
-			'background_duplicate','background_assign','background_add','background_replace','background_create_color','background_create_gradient','background_create_from_screen','background_create_from_surface','background_delete','background_set_alpha_from_background',
+			'background_duplicate','background_assign','background_add','background_replace',
+			'background_create_color','background_create_gradient','background_create_from_screen',
+			'background_create_from_surface','background_delete','background_set_alpha_from_background',
 			'font_add','font_add_sprite','font_replace_sprite','font_delete',
-			'path_set_kind','path_set_closed','path_set_precision','path_add','path_delete','path_duplicate','path_assign','path_append','path_add_point','path_insert_point','path_change_point','path_delete_point','path_clear_points','path_reverse','path_mirror','path_flip','path_rotate','path_scale','path_shift',
+			'path_set_kind','path_set_closed','path_set_precision','path_add','path_delete','path_duplicate',
+			'path_assign','path_append','path_add_point','path_insert_point','path_change_point',
+			'path_delete_point','path_clear_points','path_reverse','path_mirror','path_flip','path_rotate',
+			'path_scale','path_shift',
 			'execute_string','execute_file','script_execute',
 			'timeline_add','timeline_delete','timeline_moment_add','timeline_moment_clear',
-			'object_set_sprite','object_set_solid','object_set_visible','object_set_depth','object_set_persistent','object_set_mask','object_set_parent','object_add','object_delete','object_event_add','object_event_clear',
-			'room_set_width','room_set_height','room_set_caption','room_set_persistent','room_set_code','room_set_background_color','room_set_background','room_set_view','room_set_view_enabled','room_add','room_duplicate','room_assign','room_instance_add','room_instance_clear','room_tile_add','room_tile_add_ext','room_tile_clear',
-			'file_text_open_read','file_text_open_write','file_text_open_append','file_text_close','file_text_write_string','file_text_write_real','file_text_writeln','file_text_read_string','file_text_read_real','file_text_readln','file_text_eof','file_exists','file_delete','file_rename','file_copy','directory_exists','directory_create','file_find_first','file_find_next','file_find_close','file_attributes',
-			'file_text_open_read','file_text_open_write','file_text_open_append','file_text_close','file_text_write_string','file_text_write_real','file_text_writeln','file_text_read_string','file_text_read_real','file_text_readln','file_text_eof','file_exists','file_delete','file_rename','file_copy','directory_exists','directory_create','file_find_first','file_find_next','file_find_close','file_attributes',
-			'filename_name','filename_path','filename_dir','filename_drive','filename_ext','filename_change_ext','file_bin_open','file_bin_rewrite','file_bin_close','file_bin_size','file_bin_position','file_bin_seek','file_bin_write_byte','file_bin_read_byte','parameter_count','parameter_string','environment_get_variable',
-			'registry_write_string','registry_write_real','registry_read_string','registry_read_real','registry_exists','registry_write_string_ext','registry_write_real_ext','registry_read_string_ext','registry_read_real_ext','registry_exists_ext','registry_set_root',
-			'ini_open','ini_close','ini_read_string','ini_read_real','ini_write_string','ini_write_real','ini_key_exists','ini_section_exists','ini_key_delete','ini_section_delete',
+			'object_set_sprite','object_set_solid','object_set_visible','object_set_depth',
+			'object_set_persistent','object_set_mask','object_set_parent','object_add','object_delete',
+			'object_event_add','object_event_clear',
+			'room_set_width','room_set_height','room_set_caption','room_set_persistent','room_set_code',
+			'room_set_background_color','room_set_background','room_set_view','room_set_view_enabled',
+			'room_add','room_duplicate','room_assign','room_instance_add','room_instance_clear',
+			'room_tile_add','room_tile_add_ext','room_tile_clear',
+			// Files, registry and executing programs
+			'file_text_open_read','file_text_open_write','file_text_open_append','file_text_close',
+			'file_text_write_string','file_text_write_real','file_text_writeln','file_text_read_string',
+			'file_text_read_real','file_text_readln','file_text_eof','file_exists','file_delete',
+			'file_rename','file_copy','directory_exists','directory_create','file_find_first',
+			'file_find_next','file_find_close','file_attributes', 'filename_name','filename_path',
+			'filename_dir','filename_drive','filename_ext','filename_change_ext','file_bin_open',
+			'file_bin_rewrite','file_bin_close','file_bin_size','file_bin_position','file_bin_seek',
+			'file_bin_write_byte','file_bin_read_byte','parameter_count','parameter_string',
+			'environment_get_variable',
+			'registry_write_string','registry_write_real','registry_read_string','registry_read_real',
+			'registry_exists','registry_write_string_ext','registry_write_real_ext',
+			'registry_read_string_ext','registry_read_real_ext','registry_exists_ext','registry_set_root',
+			'ini_open','ini_close','ini_read_string','ini_read_real','ini_write_string','ini_write_real',
+			'ini_key_exists','ini_section_exists','ini_key_delete','ini_section_delete',
 			'execute_program','execute_shell',
-			'ds_stack_create','ds_stack_destroy','ds_stack_clear','ds_stack_size','ds_stack_empty','ds_stack_push','ds_stack_pop','ds_stack_top',
-			'ds_queue_create','ds_queue_destroy','ds_queue_clear','ds_queue_size','ds_queue_empty','ds_queue_enqueue','ds_queue_dequeue','ds_queue_head','ds_queue_tail',
-			'ds_list_create','ds_list_destroy','ds_list_clear','ds_list_size','ds_list_empty','ds_list_add','ds_list_insert','ds_list_replace','ds_list_delete','ds_list_find_index','ds_list_find_value','ds_list_sort',
-			'ds_map_create','ds_map_destroy','ds_map_clear','ds_map_size','ds_map_empty','ds_map_add','ds_map_replace','ds_map_delete','ds_map_exists','ds_map_find_value','ds_map_find_previous','ds_map_find_next','ds_map_find_first','ds_map_find_last',
-			'ds_priority_create','ds_priority_destroy','ds_priority_clear','ds_priority_size','ds_priority_empty','ds_priority_add','ds_priority_change_priority','ds_priority_find_priority','ds_priority_delete_value','ds_priority_delete_min','ds_priority_find_min','ds_priority_delete_max','ds_priority_find_max',
-			'ds_grid_create','ds_grid_destroy','ds_grid_resize','ds_grid_width','ds_grid_height','ds_grid_clear','ds_grid_set','ds_grid_add','ds_grid_multiply','ds_grid_set_region','ds_grid_add_region','ds_grid_multiply_region','ds_grid_set_disk','ds_grid_add_disk','ds_grid_multiply_disk','ds_grid_get','ds_grid_get_sum','ds_grid_get_max','ds_grid_get_min','ds_grid_get_mean','ds_grid_get_disk_sum','ds_grid_get_disk_min','ds_grid_get_disk_max','ds_grid_get_disk_mean','ds_grid_value_exists','ds_grid_value_x','ds_grid_value_y','ds_grid_value_disk_exists','ds_grid_value_disk_x','ds_grid_value_disk_y',
+			// Data structures
+			'ds_stack_create','ds_stack_destroy','ds_stack_clear','ds_stack_size','ds_stack_empty',
+			'ds_stack_push','ds_stack_pop','ds_stack_top',
+			'ds_queue_create','ds_queue_destroy','ds_queue_clear','ds_queue_size','ds_queue_empty',
+			'ds_queue_enqueue','ds_queue_dequeue','ds_queue_head','ds_queue_tail',
+			'ds_list_create','ds_list_destroy','ds_list_clear','ds_list_size','ds_list_empty','ds_list_add',
+			'ds_list_insert','ds_list_replace','ds_list_delete','ds_list_find_index','ds_list_find_value',
+			'ds_list_sort',
+			'ds_map_create','ds_map_destroy','ds_map_clear','ds_map_size','ds_map_empty','ds_map_add',
+			'ds_map_replace','ds_map_delete','ds_map_exists','ds_map_find_value','ds_map_find_previous',
+			'ds_map_find_next','ds_map_find_first','ds_map_find_last',
+			'ds_priority_create','ds_priority_destroy','ds_priority_clear','ds_priority_size',
+			'ds_priority_empty','ds_priority_add','ds_priority_change_priority','ds_priority_find_priority',
+			'ds_priority_delete_value','ds_priority_delete_min','ds_priority_find_min',
+			'ds_priority_delete_max','ds_priority_find_max',
+			'ds_grid_create','ds_grid_destroy','ds_grid_resize','ds_grid_width','ds_grid_height',
+			'ds_grid_clear','ds_grid_set','ds_grid_add','ds_grid_multiply','ds_grid_set_region',
+			'ds_grid_add_region','ds_grid_multiply_region','ds_grid_set_disk','ds_grid_add_disk',
+			'ds_grid_multiply_disk','ds_grid_get','ds_grid_get_sum','ds_grid_get_max','ds_grid_get_min',
+			'ds_grid_get_mean','ds_grid_get_disk_sum','ds_grid_get_disk_min','ds_grid_get_disk_max',
+			'ds_grid_get_disk_mean','ds_grid_value_exists','ds_grid_value_x','ds_grid_value_y',
+			'ds_grid_value_disk_exists','ds_grid_value_disk_x','ds_grid_value_disk_y',
+			// Creating particles
 			'effect_create_below','effect_create_above','effect_clear',
-			'part_type_create','part_type_destroy','part_type_exists','part_type_clear','part_type_shape','part_type_sprite','part_type_size','part_type_scale',
-			'part_type_orientation','part_type_color1','part_type_color2','part_type_color3','part_type_color_mix','part_type_color_rgb','part_type_color_hsv',
-			'part_type_alpha1','part_type_alpha2','part_type_alpha3','part_type_blend','part_type_life','part_type_step','part_type_death','part_type_speed','part_type_direction','part_type_gravity',
-			'part_system_create','part_system_destroy','part_system_exists','part_system_clear','part_system_draw_order','part_system_depth','part_system_position','part_system_automatic_update','part_system_automatic_draw','part_system_update','part_system_drawit','part_particles_create','part_particles_create_color','part_particles_clear','part_particles_count',
-			'part_emitter_create','part_emitter_destroy','part_emitter_destroy_all','part_emitter_exists','part_emitter_clear','part_emitter_region','part_emitter_burst','part_emitter_stream',
-			'part_attractor_create','part_attractor_destroy','part_attractor_destroy_all','part_attractor_exists','part_attractor_clear','part_attractor_position','part_attractor_force',
-			'part_destroyer_create','part_destroyer_destroy','part_destroyer_destroy_all','part_destroyer_exists','part_destroyer_clear','part_destroyer_region',
-			'part_deflector_create','part_deflector_destroy','part_deflector_destroy_all','part_deflector_exists','part_deflector_clear','part_deflector_region','part_deflector_kind','part_deflector_friction',
-			'part_changer_create','part_changer_destroy','part_changer_destroy_all','part_changer_exists','part_changer_clear','part_changer_region','part_changer_types','part_changer_kind',
-			'mplay_init_ipx','mplay_init_tcpip','mplay_init_modem','mplay_init_serial','mplay_connect_status','mplay_end','mplay_ipaddress',
-			'mplay_session_create','mplay_session_find','mplay_session_name','mplay_session_join','mplay_session_mode','mplay_session_status','mplay_session_end',
+			'part_type_create','part_type_destroy','part_type_exists','part_type_clear','part_type_shape',
+			'part_type_sprite','part_type_size','part_type_scale',
+			'part_type_orientation','part_type_color1','part_type_color2','part_type_color3',
+			'part_type_color_mix','part_type_color_rgb','part_type_color_hsv',
+			'part_type_alpha1','part_type_alpha2','part_type_alpha3','part_type_blend','part_type_life',
+			'part_type_step','part_type_death','part_type_speed','part_type_direction','part_type_gravity',
+			'part_system_create','part_system_destroy','part_system_exists','part_system_clear',
+			'part_system_draw_order','part_system_depth','part_system_position',
+			'part_system_automatic_update','part_system_automatic_draw','part_system_update',
+			'part_system_drawit','part_particles_create','part_particles_create_color',
+			'part_particles_clear','part_particles_count',
+			'part_emitter_create','part_emitter_destroy','part_emitter_destroy_all','part_emitter_exists',
+			'part_emitter_clear','part_emitter_region','part_emitter_burst','part_emitter_stream',
+			'part_attractor_create','part_attractor_destroy','part_attractor_destroy_all',
+			'part_attractor_exists','part_attractor_clear','part_attractor_position','part_attractor_force',
+			'part_destroyer_create','part_destroyer_destroy','part_destroyer_destroy_all',
+			'part_destroyer_exists','part_destroyer_clear','part_destroyer_region',
+			'part_deflector_create','part_deflector_destroy','part_deflector_destroy_all',
+			'part_deflector_exists','part_deflector_clear','part_deflector_region','part_deflector_kind',
+			'part_deflector_friction',
+			'part_changer_create','part_changer_destroy','part_changer_destroy_all','part_changer_exists',
+			'part_changer_clear','part_changer_region','part_changer_types','part_changer_kind',
+			// Multiplayer games
+			'mplay_init_ipx','mplay_init_tcpip','mplay_init_modem','mplay_init_serial',
+			'mplay_connect_status','mplay_end','mplay_ipaddress',
+			'mplay_session_create','mplay_session_find','mplay_session_name','mplay_session_join',
+			'mplay_session_mode','mplay_session_status','mplay_session_end',
 			'mplay_player_find','mplay_player_name','mplay_player_id',
 			'mplay_data_write','mplay_data_read','mplay_data_mode',
-			'mplay_message_send','mplay_message_send_guaranteed','mplay_message_receive','mplay_message_id','mplay_message_value','mplay_message_player','mplay_message_name','mplay_message_count','mplay_message_clear',
-			'external_define',
-			'external_call','external_free','execute_string','execute_file','window_handle',
+			'mplay_message_send','mplay_message_send_guaranteed','mplay_message_receive','mplay_message_id',
+			'mplay_message_value','mplay_message_player','mplay_message_name','mplay_message_count',
+			'mplay_message_clear',
+			// Using DLL's
+			'external_define','external_call','external_free','execute_string','execute_file','window_handle',
+			// 3D Graphics
 			'd3d_start','d3d_end','d3d_set_hidden','d3d_set_perspective',
 			'd3d_set_depth',
-			'd3d_primitive_begin','d3d_vertex','d3d_vertex_color','d3d_primitive_end','d3d_primitive_begin_texture','d3d_vertex_texture','d3d_vertex_texture_color','d3d_set_culling',
-			'd3d_draw_block','d3d_draw_cylinder','d3d_draw_cone','d3d_draw_ellipsoid','d3d_draw_wall','d3d_draw_floor',
-			'd3d_set_projection','d3d_set_projection_ext','d3d_set_projection_ortho','d3d_set_projection_perspective',
-			'd3d_transform_set_identity','d3d_transform_set_translation','d3d_transform_set_scaling','d3d_transform_set_rotation_x','d3d_transform_set_rotation_y','d3d_transform_set_rotation_z','d3d_transform_set_rotation_axis','d3d_transform_add_translation','d3d_transform_add_scaling','d3d_transform_add_rotation_x','d3d_transform_add_rotation_y','d3d_transform_add_rotation_z','d3d_transform_add_rotation_axis','d3d_transform_stack_clear','d3d_transform_stack_empty','d3d_transform_stack_push','d3d_transform_stack_pop','d3d_transform_stack_top','d3d_transform_stack_discard',
+			'd3d_primitive_begin','d3d_vertex','d3d_vertex_color','d3d_primitive_end',
+			'd3d_primitive_begin_texture','d3d_vertex_texture','d3d_vertex_texture_color','d3d_set_culling',
+			'd3d_draw_block','d3d_draw_cylinder','d3d_draw_cone','d3d_draw_ellipsoid','d3d_draw_wall',
+			'd3d_draw_floor',
+			'd3d_set_projection','d3d_set_projection_ext','d3d_set_projection_ortho',
+			'd3d_set_projection_perspective',
+			'd3d_transform_set_identity','d3d_transform_set_translation','d3d_transform_set_scaling',
+			'd3d_transform_set_rotation_x','d3d_transform_set_rotation_y','d3d_transform_set_rotation_z',
+			'd3d_transform_set_rotation_axis','d3d_transform_add_translation','d3d_transform_add_scaling',
+			'd3d_transform_add_rotation_x','d3d_transform_add_rotation_y','d3d_transform_add_rotation_z',
+			'd3d_transform_add_rotation_axis','d3d_transform_stack_clear','d3d_transform_stack_empty',
+			'd3d_transform_stack_push','d3d_transform_stack_pop','d3d_transform_stack_top',
+			'd3d_transform_stack_discard',
 			'd3d_set_fog',
-			'd3d_set_lighting','d3d_set_shading','d3d_light_define_direction','d3d_light_define_point','d3d_light_enable','d3d_vertex_normal','d3d_vertex_normal_color','d3d_vertex_normal_texture','d3d_vertex_normal_texture_color',
-			'd3d_model_create','d3d_model_destroy','d3d_model_clear','d3d_model_save','d3d_model_load','d3d_model_draw','d3d_model_primitive_begin','d3d_model_vertex','d3d_model_vertex_color','d3d_model_vertex_texture','d3d_model_vertex_texture_color','d3d_model_vertex_normal','d3d_model_vertex_normal_color','d3d_model_vertex_normal_texture','d3d_model_vertex_normal_texture_color','d3d_model_primitive_end','d3d_model_block','d3d_model_cylinder','d3d_model_cone','d3d_model_ellipsoid','d3d_model_wall','d3d_model_floor'
+			'd3d_set_lighting','d3d_set_shading','d3d_light_define_direction','d3d_light_define_point',
+			'd3d_light_enable','d3d_vertex_normal','d3d_vertex_normal_color','d3d_vertex_normal_texture',
+			'd3d_vertex_normal_texture_color',
+			'd3d_model_create','d3d_model_destroy','d3d_model_clear','d3d_model_save','d3d_model_load',
+			'd3d_model_draw','d3d_model_primitive_begin','d3d_model_vertex','d3d_model_vertex_color',
+			'd3d_model_vertex_texture','d3d_model_vertex_texture_color','d3d_model_vertex_normal',
+			'd3d_model_vertex_normal_color','d3d_model_vertex_normal_texture',
+			'd3d_model_vertex_normal_texture_color','d3d_model_primitive_end','d3d_model_block',
+			'd3d_model_cylinder','d3d_model_cone','d3d_model_ellipsoid','d3d_model_wall','d3d_model_floor'
 			),
 		// constants
 		4 => array(
 			'true', 'false', 'pi',
-			'ev_destroy','ev_step','ev_alarm','ev_keyboard','ev_mouse','ev_collision','ev_other','ev_draw','ev_keypress','ev_keyrelease','ev_left_button','ev_right_button','ev_middle_button','ev_no_button','ev_left_press','ev_right_press','ev_middle_press','ev_left_release','ev_right_release','ev_middle_release','ev_mouse_enter','ev_mouse_leave','ev_mouse_wheel_up','ev_mouse_wheel_down','ev_global_left_button','ev_global_right_button','ev_global_middle_button','ev_global_left_press','ev_global_right_press','ev_global_middle_press','ev_global_left_release','ev_global_right_release','ev_global_middle_release','ev_joystick1_left','ev_joystick1_right','ev_joystick1_up','ev_joystick1_down','ev_joystick1_button1','ev_joystick1_button2','ev_joystick1_button3','ev_joystick1_button4','ev_joystick1_button5','ev_joystick1_button6','ev_joystick1_button7','ev_joystick1_button8','ev_joystick2_left','ev_joystick2_right','ev_joystick2_up','ev_joystick2_down','ev_joystick2_button1','ev_joystick2_button2','ev_joystick2_button3','ev_joystick2_button4','ev_joystick2_button5','ev_joystick2_button6','ev_joystick2_button7','ev_joystick2_button8',
-			'ev_outside','ev_boundary','ev_game_start','ev_game_end','ev_room_start','ev_room_end','ev_no_more_lives','ev_no_more_health','ev_animation_end','ev_end_of_path','ev_user0','ev_user1','ev_user2','ev_user3','ev_user4','ev_user5','ev_user6','ev_user7','ev_user8','ev_user9','ev_user10','ev_user11','ev_user12','ev_user13','ev_user14','ev_user15','ev_step_normal','ev_step_begin','ev_step_end',
-			'vk_nokey','vk_anykey','vk_left','vk_right','vk_up','vk_down','vk_enter','vk_escape','vk_space','vk_shift','vk_control','vk_alt','vk_backspace','vk_tab','vk_home','vk_end','vk_delete','vk_insert','vk_pageup','vk_pagedown','vk_pause','vk_printscreen','vk_f1 ... vk_f12','vk_numpad0 ... vk_numpad9','vk_multiply','vk_divide','vk_add','vk_subtract','vk_decimal','vk_lshift','vk_lcontrol','vk_lalt','vk_rshift','vk_rcontrol','vk_ralt',
-			'c_aqua','c_black','c_blue','c_dkgray','c_fuchsia','c_gray','c_green','c_lime','c_ltgray','c_maroon','c_navy','c_olive','c_purple','c_red','c_silver','c_teal','c_white','c_yellow',
+			'ev_destroy','ev_step','ev_alarm','ev_keyboard','ev_mouse','ev_collision','ev_other','ev_draw',
+			'ev_keypress','ev_keyrelease','ev_left_button','ev_right_button','ev_middle_button',
+			'ev_no_button','ev_left_press','ev_right_press','ev_middle_press','ev_left_release',
+			'ev_right_release','ev_middle_release','ev_mouse_enter','ev_mouse_leave','ev_mouse_wheel_up',
+			'ev_mouse_wheel_down','ev_global_left_button','ev_global_right_button','ev_global_middle_button',
+			'ev_global_left_press','ev_global_right_press','ev_global_middle_press','ev_global_left_release',
+			'ev_global_right_release','ev_global_middle_release','ev_joystick1_left','ev_joystick1_right',
+			'ev_joystick1_up','ev_joystick1_down','ev_joystick1_button1','ev_joystick1_button2',
+			'ev_joystick1_button3','ev_joystick1_button4','ev_joystick1_button5','ev_joystick1_button6',
+			'ev_joystick1_button7','ev_joystick1_button8','ev_joystick2_left','ev_joystick2_right',
+			'ev_joystick2_up','ev_joystick2_down','ev_joystick2_button1','ev_joystick2_button2',
+			'ev_joystick2_button3','ev_joystick2_button4','ev_joystick2_button5','ev_joystick2_button6',
+			'ev_joystick2_button7','ev_joystick2_button8',
+			'ev_outside','ev_boundary','ev_game_start','ev_game_end','ev_room_start','ev_room_end',
+			'ev_no_more_lives','ev_no_more_health','ev_animation_end','ev_end_of_path','ev_user0','ev_user1',
+			'ev_user2','ev_user3','ev_user4','ev_user5','ev_user6','ev_user7','ev_user8','ev_user9',
+			'ev_user10','ev_user11','ev_user12','ev_user13','ev_user14','ev_user15','ev_step_normal',
+			'ev_step_begin','ev_step_end',
+			'vk_nokey','vk_anykey','vk_left','vk_right','vk_up','vk_down','vk_enter','vk_escape','vk_space',
+			'vk_shift','vk_control','vk_alt','vk_backspace','vk_tab','vk_home','vk_end','vk_delete',
+			'vk_insert','vk_pageup','vk_pagedown','vk_pause','vk_printscreen',
+			'vk_f1','vk_f2','vk_f3','vk_f4','vk_f5','vk_f6','vk_f7','vk_f8','vk_f9','vk_f10','vk_f11','vk_f12',
+			'vk_numpad0','vk_numpad1','vk_numpad2','vk_numpad3','vk_numpad4','vk_numpad5','vk_numpad6',
+			'vk_numpad7','vk_numpad8','vk_numpad9', 'vk_multiply','vk_divide','vk_add','vk_subtract',
+			'vk_decimal','vk_lshift','vk_lcontrol','vk_lalt','vk_rshift','vk_rcontrol','vk_ralt',
+			'c_aqua','c_black','c_blue','c_dkgray','c_fuchsia','c_gray','c_green','c_lime','c_ltgray',
+			'c_maroon','c_navy','c_olive','c_purple','c_red','c_silver','c_teal','c_white','c_yellow',
 			'fa_left', 'fa_center','fa_right','fa_top','fa_middle','fa_bottom',
-			'pr_pointlist','pr_linelist','pr_linestrip','pr_trianglelist','pr_trianglestrip','pr_trianglefan',
-			'cr_none','cr_arrow','cr_cross','cr_beam','cr_size_nesw','cr_size_ns','cr_size_nwse','cr_size_we','cr_uparrow','cr_hourglass','cr_drag','cr_nodrop','cr_hsplit','cr_vsplit','cr_multidrag','cr_sqlwait','cr_no','cr_appstart','cr_help','cr_handpoint','cr_size_all',
+			'pr_pointlist','pr_linelist','pr_linestrip','pr_trianglelist','pr_trianglestrip',
+			'pr_trianglefan',
+			'cr_none','cr_arrow','cr_cross','cr_beam','cr_size_nesw','cr_size_ns','cr_size_nwse',
+			'cr_size_we','cr_uparrow','cr_hourglass','cr_drag','cr_nodrop','cr_hsplit','cr_vsplit',
+			'cr_multidrag','cr_sqlwait','cr_no','cr_appstart','cr_help','cr_handpoint','cr_size_all',
 			'se_chorus','se_echo','se_flanger','se_gargle','se_reverb','se_compressor','se_equalizer',
 			'fa_readonly','fa_hidden','fa_sysfile','fa_volumeid','fa_directory','fa_archive',
-			'pt_shape_pixel','pt_shape_disk','pt_shape_square','pt_shape_line','pt_shape_star','pt_shape_circle','pt_shape_ring','pt_shape_sphere','pt_shape_flare','pt_shape_spark','pt_shape_explosion','pt_shape_cloud','pt_shape_smoke','pt_shape_snow',
-      'ps_shape_rectangle','ps_shape_ellipse ','ps_shape_diamond','ps_shape_line',
+			'pt_shape_pixel','pt_shape_disk','pt_shape_square','pt_shape_line','pt_shape_star',
+			'pt_shape_circle','pt_shape_ring','pt_shape_sphere','pt_shape_flare','pt_shape_spark',
+			'pt_shape_explosion','pt_shape_cloud','pt_shape_smoke','pt_shape_snow',
+			'ps_shape_rectangle','ps_shape_ellipse ','ps_shape_diamond','ps_shape_line',
 			'ps_distr_linear','ps_distr_gaussian','ps_force_constant','ps_force_linear','ps_force_quadratic',
 			'ps_deflect_horizontal', 'ps_deflect_vertical',
 			'ps_change_motion','ps_change_shape','ps_change_all'
 			),
-		// functions (registered version)
-		5 => array(
-			),
-		// constants (registered version)
-		6 => array(
-			),
 		),
 	'SYMBOLS' => array(
 		'(', ')', '{', '}', '[', ']', '&&', '||', '^^', '<', '<=', '==', '!=', '>', '>=',
-		'|', '&', '^', '<<', '>>', '+', '-', '*', '/', 'div', 'mod', '!', '-', '~'
+		'|', '&', '^', '<<', '>>', '+', '-', '*', '/', '!', '-', '~'
 		),
 	'CASE_SENSITIVE' => array(
-		GESHI_COMMENTS => true,
-		1 => false,
-		2 => false,
-		3 => false,
-		4 => false,
+		GESHI_COMMENTS => false,
+		1 => true,
+		2 => true,
+		3 => true,
+		4 => true,
 		),
 	'STYLES' => array(
 		'KEYWORDS' => array(
@@ -268,8 +485,8 @@
 	'URLS' => array(
 		1 => '',
 		2 => '',
-		// I'm working on the GML online reference site, currently indexing the GML functions.
-		3 => 'http://www.zonamakers.com/gmlreference/{FNAME}.html', // (provisional, will change soon!)
+		// All GML functions have been indexed, but need some corrections.
+		3 => 'http://www.zonamakers.com/gmlreference/{FNAME}.html', // (provisional, could change soon!)
 		4 => ''
 		),
 	'OOLANG' => true,
@@ -285,4 +502,4 @@
 		)
 );
 
-?>
\ No newline at end of file
+?>
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/html4strict.php 0.762/modules/pn_bbcode/pnincludes/geshi/html4strict.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/html4strict.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/html4strict.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ---------------
  * Author: Nigel McNie (oracle.shinoda@gmail.com)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/07/10
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * HTML 4.01 strict language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/ini.php 0.762/modules/pn_bbcode/pnincludes/geshi/ini.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/ini.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/ini.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: deguix (cevo_deguix@yahoo.com.br)
  * Copyright: (c) 2005 deguix
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.1 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.2 $
  * Date Started: 2005/03/27
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * INI language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/inno.php 0.762/modules/pn_bbcode/pnincludes/geshi/inno.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/inno.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/inno.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Thomas Klingler (hotline@theratech.de) based on delphi.php from Jrja Norbert (jnorbi@vipmail.hu)
  * Copyright: (c) 2004 Jrja Norbert, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.1 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.2 $
  * Date Started: 2005/07/29
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Inno Script language inkl. Delphi (Object Pascal) language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/java.php 0.762/modules/pn_bbcode/pnincludes/geshi/java.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/java.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/java.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: Nigel McNie (oracle.shinoda@gmail.com)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/07/10
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Java language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/javascript.php 0.762/modules/pn_bbcode/pnincludes/geshi/javascript.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/javascript.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/javascript.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------------
  * Author: Ben Keen (ben.keen@gmail.com)
  * Copyright: (c) 2004 Ben Keen (ben.keen@gmail.com), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/20
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * JavaScript language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/lisp.php 0.762/modules/pn_bbcode/pnincludes/geshi/lisp.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/lisp.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/lisp.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: Roberto Rossi (rsoftware@altervista.org)
  * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/08/30
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Generic Lisp language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/lua.php 0.762/modules/pn_bbcode/pnincludes/geshi/lua.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/lua.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/lua.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -------
  * Author: Roberto Rossi (rsoftware@altervista.org)
  * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/07/10
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * LUA language file for GeSHi.
  *
@@ -68,6 +68,18 @@
 			'clock','date','difftime','execute','exit','getenv','setlocale','time',
 			'_G','getfenv','getmetatable','ipairs','loadlib','next','pairs','pcall',
 			'rawegal','rawget','rawset','require','setfenv','setmetatable','xpcall',
+            'string.byte','string.char','string.dump','string.find','string.len',
+            'string.lower','string.rep','string.sub','string.upper','string.format','string.gfind','string.gsub',
+            'table.concat','table.foreach','table.foreachi','table.getn','table.sort','table.insert','table.remove','table.setn',
+            'math.abs','math.acos','math.asin','math.atan','math.atan2','math.ceil','math.cos','math.deg','math.exp',
+            'math.floor','math.frexp','math.ldexp','math.log','math.log10','math.max','math.min','math.mod',
+            'math.pi','math.rad','math.random','math.randomseed','math.sin','math.sqrt','math.tan',
+            'coroutine.create','coroutine.resume','coroutine.status',
+            'coroutine.wrap','coroutine.yield',
+            'io.close','io.flush','io.input','io.lines','io.open','io.output','io.read','io.tmpfile','io.type','io.write',
+            'io.stdin','io.stdout','io.stderr',
+            'os.clock','os.date','os.difftime','os.execute','os.exit','os.getenv','os.remove','os.rename',
+            'os.setlocale','os.time','os.tmpname',
 			'string','table','math','coroutine','io','os','debug'
 			)
 		),
@@ -109,8 +121,8 @@
 		'SCRIPT' => array(
 			)
 		),
-	'OOLANG' => true,
-	'OBJECT_SPLITTERS' => array('.'
+	'OOLANG' => false,
+	'OBJECT_SPLITTERS' => array(
 		),
 	'REGEXPS' => array(
 		),
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/matlab.php 0.762/modules/pn_bbcode/pnincludes/geshi/matlab.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/matlab.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/matlab.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -----------
  * Author: Florian Knorn (floz@gmx.de)
  * Copyright: (c) 2004 Florian Knorn (http://www.florian-knorn.com)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.2 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.3 $
  * Date Started: 2005/02/09
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Matlab M-file language file for GeSHi. 
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/mpasm.php 0.762/modules/pn_bbcode/pnincludes/geshi/mpasm.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/mpasm.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/mpasm.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ---------
  * Author: Bakalex (bakalex@gmail.com)
  * Copyright: (c) 2004 Bakalex, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/12/6
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Microchip Assembler language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/mysql.php 0.762/modules/pn_bbcode/pnincludes/geshi/mysql.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/mysql.php	1969-12-31 18:00:00.000000000 -0600
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/mysql.php	2005-12-14 16:35:54.000000000 -0600
@@ -0,0 +1,175 @@
+ <?php 
+ /************************************************************************************* 
+ * mysql.php 
+ * --------- 
+ * Author: Carl Frstenberg (azatoth@gmail.com) 
+ * Copyright: (c) 2005 Carl Frstenberg, Nigel McNie (http://qbnz.com/highlighter) 
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.1 $ 
+ * Date Started: 2004/06/04 
+ * Last Modified: $Date: 2005/12/14 22:35:54 $ 
+ * 
+ * MySQL language file for GeSHi. 
+ * 
+ * 
+ ************************************************************************************* 
+ * 
+ * This file is part of GeSHi. 
+ * 
+ * GeSHi is free software; you can redistribute it and/or modify 
+ * it under the terms of the GNU General Public License as published by 
+ * the Free Software Foundation; either version 2 of the License, or 
+ * (at your option) any later version. 
+ * 
+ * GeSHi is distributed in the hope that it will be useful, 
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of 
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+ * GNU General Public License for more details. 
+ * 
+ * You should have received a copy of the GNU General Public License 
+ * along with GeSHi; if not, write to the Free Software 
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
+ * 
+ ************************************************************************************/ 
+  
+$language_data = array ( 
+  'LANG_NAME' => 'MySQL', 
+  'COMMENT_SINGLE' => array(1 =>'--', 2 => '#'), 
+  'COMMENT_MULTI' => array('/*' => '*/'), 
+  'CASE_KEYWORDS' => 1, 
+  'QUOTEMARKS' => array("'", '"', ''), 
+  'ESCAPE_CHAR' => '\\', 
+  'KEYWORDS' => array( 
+  1 => array( 
+  /* Mix */ 
+  'ALTER DATABASE', 'ALTER TABLE', 'CREATE DATABASE', 'CREATE INDEX', 'CREATE TABLE', 'DROP DATABASE', 
+  'DROP INDEX', 'DROP TABLE', 'RENAME TABLE', 'DELETE', 'DO', 'HANDLER', 'INSERT', 'LOAD DATA INFILE',  
+  'REPLACE', 'SELECT', 'TRUNCATE', 'UPDATE', 'DESCRIBE', 'USE', 'START TRANSACTION', 'COMMIT', 'ROLLBACK', 
+  'SAVEPOINT', 'ROLLBACK TO SAVEPOINT', 'LOCK TABLES', 'UNLOCK_TABLES', 'SET TRANACTIONS', 'SET', 'SHOW', 
+  'CREATE PROCEDURE', 'CREATE FUNCTION', 'ALTER PROCEDURE', 'ALTER FUNCTION', 'DROP PROCEDURE', 'DROP FUNCTION',  
+  'SHOW CREATE PROCEDURE', 'SHOW CREATE FUNCTION', 'SHOW PROCEDURE STATUS', 'SHOW FUNCTION STATUS',  
+  'CALL', 'BEGIN', 'END', 'DECLARE', 'CREATE ROUTINE', 'ALTER ROUTINE', 'CREATE', 'ALTER', 'DROP', 
+  'PRIMARY KEY', 'VALUES', 'INTO', 'FROM',  
+  'ANALYZE', 'BDB', 'BERKELEYDB', 'BTREE', 'BY', 'CASCADE', 'CHECK', 'COLUMN', 'COLUMNS', 'CONSTRAINT', 
+  'CROSS', 'DATABASES', 'DELAYED', 'DISTINCT', 'DISTINCTROW', 'ENCLOSED', 'ERRORS', 'ESCAPED', 'EXISTS', 
+  'EXPLAIN', 'FALSE', 'FIELDS', 'FORCE', 'FOREIGN', 'FULLTEXT', 'GEOMETRY', 'GRANT', 'GROUP', 'HASH', 
+  'HAVING', 'HELP', 'HIGH_PRIORITY', 'IGNORE', 'INNER', 'INNODB', 'INTERVAL', 'JOIN', 'KEYS', 'KILL', 
+  'LINES', 'LOW_PRIORITY', 'MASTER_SERVER_ID', 'MATCH', 'MIDDLEINT', 'MRG_MYISAM', 'NATURAL', 'OPTIMIZE', 
+  'OPTION', 'OPTIONALLY', 'ORDER', 'OUTER', 'OUTFILE', 'PRIVILEGES', 'PURGE', 'READ', 'REFERENCES', 
+  'REQUIRE', 'RESTRICT', 'RETURNS', 'REVOKE', 'RLIKE', 'RTREE', 'SOME', 'SONAME', 'SPATIAL', 'SQL_BIG_RESULT',  
+  'SQL_CALC_FOUND_ROWS', 'SQL_SMALL_RESULT', 'SSL', 'STARTING', 'STRAIGHT_JOIN', 'STRIPED', 'TERMINATED',  
+  'TRUE', 'TYPES', 'UNION', 'USAGE', 'USER_RESOURCES', 'USING', 'VARCHARACTER', 'WARNINGS', 'WHERE', 'WRITE', 
+  /* Control Flow Functions */ 
+  'CASE', 'WHEN', 'THEN', 'ELSE', 'END', 
+  /* String Functions */ 
+  'BIN', 'BIT_LENGTH', 'CHAR_LENGTH', 'CHARACTER_LENGTH', 'COMPRESS', 'CONCAT', 
+  'CONCAT_WS', 'CONV', 'ELT', 'EXPORT_SET', 'FIELD', 'FIND_IN_SET', 'FORMAT', 'HEX',  
+  'INSERT', 'INSTR', 'LCASE', 'LEFT', 'LENGTH', 'LOAD_FILE', 'LOCATE', 'LOWER', 'LPAD', 
+  'LTRIM', 'MAKE_SET', 'MID', 'OCT', 'OCTET_LENGTH', 'ORD', 'POSITION', 'QUOTE', 'REPEAT', 
+  'REPLACE', 'REVERSE', 'RIGHT', 'RPAD', 'RTRIM', 'SOUNDEX', 'SPACE', 'SUBSTRING',  
+  'SUBSTRING_INDEX', 'TRIM', 'UCASE', 'UPPER', 'UNCOMPRESS', 'UNCOMPRESSD_LENGTH', 'UNHEX',  
+  /* Numeric Functions */ 
+  'ABS', 'ACOS', 'ASIN', 'ATAN', 'ATAN2', 'CEILING', 'CEIL', 'COS', 'COT', 'CRC32', 'DEGREES', 
+  'EXP', 'FLOOR', 'LN', 'LOG', 'LOG2', 'LOG10', 'MOD', 'PI', 'POW', 'POWER', 'RADIANS', 'RAND', 
+  'ROUND', 'SIGN', 'SIN', 'SQRT', 'TAN', 'TRUNCATE', 
+  /* Date and Time Functions */ 
+  'ADDDATE', 'ADDTIME', 'CONVERT_TZ', 'CURDATE', 'CURRENT_DATE', 'CURTIME', 'CURRENT_TIME', 
+  'CURRENT_TIMESTAMP', 'DATEDIFF', 'DATE_ADD', 'DATE_SUB', 'DATE_FORMAT', 'DAY',  
+  'DAYNAME', 'DAYOFMONTH', 'DAYOFWEEK', 'DAYOFYEAR', 'EXTRACT', 'FROM_DAYS', 'FROM_UNIXTIME', 
+  'GET_FORMAT', 'LAST_DAY', 'LOCALTIME', 'LOCALTIMESTAMP', 'MAKEDATE', 'MAKETIME',  
+  'MICROSECOND', 'MONTHNAME', 'NOW', 'PERIOD_ADD', 'PERIOD_DIFF', 'QUARTER', 
+  'SECOND', 'SEC_TO_TIME', 'STR_TO_DATE', 'SUBDATE', 'SUBTIME', 'SYSDATE', 'TIME', 'TIMEDIFF', 
+  'TIMESTAMP', 'TIMESTAMPADD', 'TIMESTAMPDIFF', 'TIME_FORMAT', 'TIME_TO_SEC', 'TO_DAYS',  
+  'UNIX_TIMESTAMP', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP', 'WEEKDAY', 'WEEKOFYEAR', 
+  'YEARWEEK', 
+   
+   ), 
+   2 => array( 
+   'INTEGER', 'SMALLINT', 'DECIMAL', 'NUMERIC', 'FLOAT', 'REAL', 'DOUBLE PRECISION', 
+   'DOUBLE', 'INT', 'DEC', 'BIT' ,'TINYINT', 'SMALLINT', 'MEDIUMINT', 'BIGINT',  
+   'DATETIME', 'DATE', 'TIMESTAMP', 'TIME', 'YEAR',  
+   'CHAR', 'VARCHAR', 'BINARY', 'CHARACTER VARYING', 'VARBINARY', 'TINYBLOB', 'TINYTEXT', 
+   'BLOB', 'TEXT','MEDIUMBLOB', 'MEDIUMTEXT', 'LONGBLOB', 'LONGTEXT', 'ENUM', 'SET', 
+   'SERIAL DEFAULT VALUE', 'SERIAL', 'FIXED' 
+   ), 
+   3 => array( 
+   'ZEROFILL', 'NOT NULL', 'UNSIGNED', 'AUTO_INCREMENT', 'UNIQUE', 'NOT', 'NULL', 'CHARACTER SET', 'CHARSET', 
+   'ASCII', 'UNICODE', 'NATIONAL', 'BOTH', 'LEADING', 'TRAILING','DEFAULT' 
+   ), 
+   4 => array( 
+   'MICROSECOND', 'SECOND', 'MINUTE', 'HOUR', 'DAY', 'WEEK', 'MONTH', 'QUARTER', 'YEAR', 'SECOND_MICROSECOND',  
+   'MINUTE_MICROSECOND', 'MINUTE_SECOND', 'HOUR_MICROSECOND', 'HOUR_SECOND', 'HOUR_MINUTE', 'DAY_MICROSECOND', 
+   'DAY_SECOND', 'DAY_MINUTE', 'DAY_HOUR', 'YEAR_MONTH', 
+   ), 
+   ), 
+   'SYMBOLS' => array( 
+   ':=', 
+   '||', 'OR', 'XOR', 
+   '&&', 'AND', 
+   'NOT', 
+   'BETWEEN', 'CASE', 'WHEN', 'THEN', 'ELSE', 
+   '=', '<=>', '>=', '>', '<=', '<', '<>', '!=', 'IS', 'LIKE', 'REGEXP', 'IN', 
+   '|', 
+   '&', 
+   '<<', '>>', 
+   '-', '+', 
+   '*', '/', 'DIV', '%', 'MOD', 
+   '^', 
+   '-', '~', 
+   '!', 
+   'BINARY', 'COLLATE', 
+   '(', ')', 
+   ), 
+   'CASE_SENSITIVE' => array( 
+   GESHI_COMMENTS => false, 
+   1 => false, 
+   2 => false, 
+   3 => false, 
+   4 => false, 
+   ), 
+   'STYLES' => array( 
+   'KEYWORDS' => array( 
+   1 => 'color: #993333; font-weight: bold;', 
+   2 => 'color: #aa9933; font-weight: bold;', 
+   3 => 'color: #aa3399; font-weight: bold;', 
+   4 => 'color: #33aa99; font-weight: bold;', 
+   ), 
+   'COMMENTS' => array( 
+   1 => 'color: #808080; font-style: italic;', 
+   2 => 'color: #808080; font-style: italic;' 
+   ), 
+   'ESCAPE_CHAR' => array( 
+   0 => 'color: #000099; font-weight: bold;' 
+   ), 
+   'BRACKETS' => array( 
+   0 => 'color: #66cc66;' 
+   ), 
+   'STRINGS' => array( 
+   0 => 'color: #ff0000;' 
+   ), 
+   'NUMBERS' => array( 
+   0 => 'color: #cc66cc;' 
+   ), 
+   'METHODS' => array( 
+   ), 
+   'SYMBOLS' => array( 
+   0 => 'color: #66cc66;' 
+   ), 
+   'SCRIPT' => array( 
+   ), 
+   'REGEXPS' => array( 
+   ) 
+   ), 
+   'OOLANG' => false, 
+   'OBJECT_SPLITTERS' => array( 
+   ), 
+   'REGEXPS' => array( 
+   ), 
+   'STRICT_MODE_APPLIES' => GESHI_NEVER, 
+   'SCRIPT_DELIMITERS' => array( 
+   ), 
+   'HIGHLIGHT_STRICT_BLOCK' => array( 
+   ) 
+);
+
+?>
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/nsis.php 0.762/modules/pn_bbcode/pnincludes/geshi/nsis.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/nsis.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/nsis.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: deguix (cevo_deguix@yahoo.com.br), Tux (http://tux.a4.cz/)
  * Copyright: (c) 2005 deguix, 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2005/06/17
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Nullsoft Scriptable Install System language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/objc.php 0.762/modules/pn_bbcode/pnincludes/geshi/objc.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/objc.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/objc.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: M. Uli Kusterer (witness.of.teachtext@gmx.net)
  * Copyright: (c) 2004 M. Uli Kusterer, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/04
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Objective C language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/ocaml-brief.php 0.762/modules/pn_bbcode/pnincludes/geshi/ocaml-brief.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/ocaml-brief.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/ocaml-brief.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Flaie (fireflaie@gmail.com)
  * Copyright: (c) 2005 Flaie, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.1 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.2 $
  * Date Started: 2005/08/27
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * OCaml (Objective Caml) language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/ocaml.php 0.762/modules/pn_bbcode/pnincludes/geshi/ocaml.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/ocaml.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/ocaml.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Flaie (fireflaie@gmail.com)
  * Copyright: (c) 2005 Flaie, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.1 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.2 $
  * Date Started: 2005/08/27
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * OCaml (Objective Caml) language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/oobas.php 0.762/modules/pn_bbcode/pnincludes/geshi/oobas.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/oobas.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/oobas.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ---------
  * Author: Roberto Rossi (rsoftware@altervista.org)
  * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/08/30
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * OpenOffice.org Basic language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/oracle8.php 0.762/modules/pn_bbcode/pnincludes/geshi/oracle8.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/oracle8.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/oracle8.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -----------
  * Author: Guy Wicks (Guy.Wicks@rbs.co.uk)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/04
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Oracle 8 language file for GeSHi
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/pascal.php 0.762/modules/pn_bbcode/pnincludes/geshi/pascal.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/pascal.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/pascal.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Tux (tux@inamil.cz)
  * Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/07/26
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Pascal language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/perl.php 0.762/modules/pn_bbcode/pnincludes/geshi/perl.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/perl.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/perl.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: Andreas Gohr (andi@splitbrain.org), Ben Keen (ben.keen@gmail.com)
  * Copyright: (c) 2004 Andreas Gohr, Ben Keen (http://www.benjaminkeen.org/), Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/08/20
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Perl language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/php-brief.php 0.762/modules/pn_bbcode/pnincludes/geshi/php-brief.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/php-brief.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/php-brief.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -------------
  * Author: Nigel McNie (oracle.shinoda@gmail.com)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/02
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * PHP language file for GeSHi (brief version).
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/php.php 0.762/modules/pn_bbcode/pnincludes/geshi/php.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/php.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/php.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: Nigel McNie (oracle.shinoda@gmail.com)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/20
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * PHP language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/python.php 0.762/modules/pn_bbcode/pnincludes/geshi/python.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/python.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/python.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Roberto Rossi (rsoftware@altervista.org)
  * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/08/30
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Python language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/qbasic.php 0.762/modules/pn_bbcode/pnincludes/geshi/qbasic.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/qbasic.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/qbasic.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Nigel McNie (oracle.shinoda@gmail.com)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/20
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * QBasic/QuickBASIC language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/ruby.php 0.762/modules/pn_bbcode/pnincludes/geshi/ruby.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/ruby.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/ruby.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: Amit Gupta (http://blog.igeek.info/)
  * Copyright: (c) 2005 Amit Gupta (http://blog.igeek.info/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.1 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.2 $
  * Date Started: 2005/09/05
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Ruby language file for GeSHi
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/scheme.php 0.762/modules/pn_bbcode/pnincludes/geshi/scheme.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/scheme.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/scheme.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Jon Raphaelson (jonraphaelson@gmail.com)
  * Copyright: (c) 2005 Jon Raphaelson, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.1 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.2 $
  * Date Started: 2004/08/30
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Scheme language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/sdlbasic.php 0.762/modules/pn_bbcode/pnincludes/geshi/sdlbasic.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/sdlbasic.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/sdlbasic.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ------------
  * Author: Roberto Rossi 
  * Copyright: (c) 2005 Roberto Rossi (http://rsoftware.altervista.org)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.1 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.2 $
  * Date Started: 2005/08/19
- * Date Modified: $Date: 2005/09/23 09:56:08 $
+ * Date Modified: $Date: 2005/12/14 22:35:54 $
  *
  * sdlBasic (http://sdlbasic.sf.net) language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/smarty.php 0.762/modules/pn_bbcode/pnincludes/geshi/smarty.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/smarty.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/smarty.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ----------
  * Author: Alan Juden (alan@judenware.org)
  * Copyright: (c) 2004 Alan Juden, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/07/10
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Smarty template language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/sql.php 0.762/modules/pn_bbcode/pnincludes/geshi/sql.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/sql.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/sql.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -------
  * Author: Nigel McNie (oracle.shinoda@gmail.com)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/04
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * SQL language file for GeSHi.
  *
@@ -97,7 +97,8 @@
 			),
 		'COMMENTS' => array(
 			1 => 'color: #808080; font-style: italic;',
-			2 => 'color: #808080; font-style: italic;'
+			2 => 'color: #808080; font-style: italic;',
+            'MULTI' => 'color: #808080; font-style: italic;'
 			),
 		'ESCAPE_CHAR' => array(
 			0 => 'color: #000099; font-weight: bold;'
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/vbnet.php 0.762/modules/pn_bbcode/pnincludes/geshi/vbnet.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/vbnet.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/vbnet.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ---------
  * Author: Alan Juden (alan@judenware.org)
  * Copyright: (c) 2004 Alan Juden, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/06/04
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * VB.NET language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/vb.php 0.762/modules/pn_bbcode/pnincludes/geshi/vb.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/vb.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/vb.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * ------
  * Author: Roberto Rossi (rsoftware@altervista.org)
  * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/08/30
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * Visual Basic language file for GeSHi.
  *
@@ -121,7 +121,7 @@
 			0 => 'color: #cc66cc;'
 			),
 		'METHODS' => array(
-			0 => 'color: #66cc66;'
+			1 => 'color: #66cc66;'
 			),
 		'SYMBOLS' => array(
 			0 => 'color: #66cc66;'
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/vhdl.php 0.762/modules/pn_bbcode/pnincludes/geshi/vhdl.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/vhdl.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/vhdl.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * --------
  * Author: Alexander 'E-Razor' Krause (admin@erazor-zone.de)
  * Copyright: (c) 2005 Alexander Krause
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.2 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.3 $
  * Date Started: 2005/06/15
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  * 
  * VHDL (VHSICADL, very high speed integrated circuit HDL) language file for GeSHi.
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/visualfoxpro.php 0.762/modules/pn_bbcode/pnincludes/geshi/visualfoxpro.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/visualfoxpro.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/visualfoxpro.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,8 +4,8 @@
  * ----------------
  * Author: Roberto Armellin (r.armellin@tin.it)
  * Copyright: (c) 2004 Roberto Armellin, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/09/17
  * Last Modified: 2004/09/18
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi/xml.php 0.762/modules/pn_bbcode/pnincludes/geshi/xml.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi/xml.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi/xml.php	2005-12-14 16:35:54.000000000 -0600
@@ -4,10 +4,10 @@
  * -------
  * Author: Nigel McNie (oracle.shinoda@gmail.com)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.3
- * CVS Revision Version: $Revision: 1.3 $
+ * Release Version: 1.0.7.5
+ * CVS Revision Version: $Revision: 1.4 $
  * Date Started: 2004/09/01
- * Last Modified: $Date: 2005/09/23 09:56:08 $
+ * Last Modified: $Date: 2005/12/14 22:35:54 $
  *
  * XML language file for GeSHi. Based on the idea/file by Christian Weiske
  *
diff -ruN 0.761/modules/pn_bbcode/pnincludes/geshi.php 0.762/modules/pn_bbcode/pnincludes/geshi.php
--- 0.761/modules/pn_bbcode/pnincludes/geshi.php	2005-09-23 04:56:08.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnincludes/geshi.php	2005-12-14 16:35:53.000000000 -0600
@@ -28,7 +28,7 @@
  * @author    Nigel McNie <nigel@geshi.org>
  * @copyright Copyright &copy; 2004, 2005, Nigel McNie
  * @license   http://gnu.org/copyleft/gpl.html GNU GPL
- * @version   $Id: geshi.php,v 1.3 2005/09/23 09:56:08 landseer Exp $
+ * @version   $Id: geshi.php,v 1.4 2005/12/14 22:35:53 landseer Exp $
  *
  */
 
@@ -40,7 +40,7 @@
 //
 
 /** The version of this GeSHi file */
-define('GESHI_VERSION', '1.0.7.3');
+define('GESHI_VERSION', '1.0.7.5');
 
 /** For the future (though this may never be realised) */
 define('GESHI_OUTPUT_HTML', 0);
@@ -286,6 +286,7 @@
     /**
      * Whether important blocks should be recognised or not
      * @var boolean
+     * @deprecated
      * @todo REMOVE THIS FUNCTIONALITY!
      */
 	var $enable_important_blocks = false;
@@ -293,6 +294,7 @@
     /**
      * Styles for important parts of the code
      * @var string
+     * @deprecated
      * @todo As above - rethink the whole idea of important blocks as it is buggy and
      * will be hard to implement in 1.2
      */
@@ -1305,6 +1307,7 @@
 	 * Sets whether context-important blocks are highlighted
      * 
      * @todo REMOVE THIS SHIZ FROM GESHI!
+     * @deprecated
 	 */
 	function enable_important_blocks ( $flag )
 	{
@@ -1590,6 +1593,12 @@
 										$attributes = ' class="es0"';
 									}
 									$char = "<span$attributes>" . $char;
+                                    if (substr($code, $i + 1, 1) == "\n") {
+                                        // escaping a newline, what's the point in putting the span around
+                                        // the newline? It only causes hassles when inserting line numbers
+                                        $char .= '</span>';
+                                        $ESCAPE_CHAR_OPEN = false;
+                                    }
 								}
 							} else {
 								$ESCAPE_CHAR_OPEN = false;
@@ -1687,14 +1696,19 @@
 											$test_str = @htmlspecialchars($test_str, ENT_COMPAT, $this->encoding);
 										}
 										$close_pos = strpos($part, "\n", $i);
+                                        $oops = false;
 										if ($close_pos === false) {
 											$close_pos = strlen($part);
+                                            $oops = true;
 										}
 										$test_str .= @htmlspecialchars(substr($part, $i + $com_len, $close_pos - $i - $com_len), ENT_COMPAT, $this->encoding);
 										if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
 											$test_str .= "</span>";
 										}
-										$test_str .= "\n";
+                                        // Take into account that the comment might be the last in the source
+                                        if (!$oops) { 
+										  $test_str .= "\n";
+                                        }
 										$i = $close_pos;
 										// parse the rest
 										$result .= $this->parse_non_string_part($stuff_to_parse);
@@ -1735,10 +1749,10 @@
 					$result .= @htmlspecialchars($part, ENT_COMPAT, $this->encoding);
 				}
 				// Close the <span> that surrounds the block
-                // Removed since the only time this is used is for php and it doesn't need a </span>
-				/*if ($this->strict_mode && $this->lexic_permissions['SCRIPT']) {
+				if ($this->strict_mode && $this->language_data['STYLES']['SCRIPT'][$script_key] != '' &&
+                    $this->lexic_permissions['SCRIPT']) {
 					$result .= '</span>';
-				}*/
+				}
 			} else {
                 // Else not a block to highlight
 				$result .= @htmlspecialchars($part, ENT_COMPAT, $this->encoding);
@@ -1892,7 +1906,7 @@
 	 */
 	function add_url_to_keyword ($keyword, $group, $start_or_end)
 	{
-		if (isset($this->language_data['URLS'][$group]) &&
+        if (isset($this->language_data['URLS'][$group]) &&
             $this->language_data['URLS'][$group] != '' &&
             substr($keyword, 0, 5) != '&lt;/') {
 			// There is a base group for this keyword
@@ -1910,7 +1924,8 @@
                         ) . '">';
 				}
 				return '';
-			} else {
+            // HTML fix. Again, dirty hackage...
+			} elseif (!($this->language == 'html4strict' && '&gt;' == $keyword)) {
 				return '</a>';
 			}
 		}
@@ -2305,7 +2320,10 @@
 		$header = $this->format_header_content();
 
         if (GESHI_HEADER_NONE == $this->header_type) {
-            return "$header<ol$ol_attributes>";
+            if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+                return "$header<ol$ol_attributes>";
+            }
+            return $header;
         }
         
 		// Work out what to return and do it
@@ -2397,7 +2415,7 @@
 			if ($this->use_classes) {
 				$attr = ' class="foot"';
 			} else {
-				$attr = " style=\"{$this->footer_content_style}\">";
+				$attr = " style=\"{$this->footer_content_style}\"";
 			}
 			return "<div$attr>$footer</div>";
 		}
@@ -2615,11 +2633,11 @@
 	function geshi_highlight ($string, $language, $path, $return = false)
 	{
 		$geshi = new GeSHi($string, $language, $path);
-		$geshi->set_header_type(GESHI_HEADER_DIV);
+		$geshi->set_header_type(GESHI_HEADER_NONE);
 		if ($return) {
-			return str_replace('<div>', '<code>', str_replace('</div>', '</code>', $geshi->parse_code()));
+			return '<code>' . $geshi->parse_code() . '</code>';
 		}
-		echo str_replace('<div>', '<code>', str_replace('</div>', '</code>', $geshi->parse_code()));
+		echo '<code>' . $geshi->parse_code() . '</code>';
 		if ($geshi->error()) {
 			return false;
 		}
diff -ruN 0.761/modules/pn_bbcode/pninit.php 0.762/modules/pn_bbcode/pninit.php
--- 0.761/modules/pn_bbcode/pninit.php	2005-09-26 08:41:20.000000000 -0500
+++ 0.762/modules/pn_bbcode/pninit.php	2005-10-07 07:06:28.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: pninit.php,v 1.15 2005/09/26 13:41:20 landseer Exp $
+// $Id: pninit.php,v 1.16 2005/10/07 12:06:28 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -53,17 +53,6 @@
         return false;
     }
 
-    // display hook
-    if (!pnModRegisterHook('item',
-                           'display',
-                           'GUI',
-                           'pn_bbcode',
-                           'user',
-                           'codes')) {
-        pnSessionSetVar('errormsg', _PNBBCODE_COULDNOTREGISTER . ' (display hook)');
-        return false;
-    }
-
     pnModSetVar('pn_bbcode', 'quote', stripslashes(pnVarPrepForStore('<fieldset style="background-color: '.pnThemeGetVar('bgcolor2').'; text-align: left; border: 1px solid black;"><legend style="font-weight: bold;">%u</legend>%t</fieldset>')));
     pnModSetVar('pn_bbcode', 'code',  stripslashes(pnVarPrepForStore('<fieldset style="background-color: '.pnThemeGetVar('bgcolor2').'; text-align: left; border: 1px solid black;"><legend style="font-weight: bold;">%h</legend><pre>%c</pre></fieldset>')));
     pnModSetVar('pn_bbcode', 'size_tiny',   '0.75em');
@@ -78,8 +67,6 @@
     pnModSetVar('pn_bbcode', 'linenumbers', 'yes');
     pnModSetVar('pn_bbcode', 'syntaxhilite', 'yes');
 
-    pnModSetVar('pn_bbcode', 'displayhook', 'yes');
-
     // Initialisation successful
     return true;
 }
@@ -143,6 +130,18 @@
                 return false;
             }
             pnModSetVar('pn_bbcode', 'displayhook', 'yes');
+        case '1.18':
+            // replace displayhook
+            if (!pnModUnregisterHook('item',
+                                     'display',
+                                     'GUI',
+                                     'pn_bbcode',
+                                     'user',
+                                     'codes')) {
+                pnSessionSetVar('errormsg', _PNBBCODE_COULDNOTUNREGISTER . ' (display hook)');
+                return false;
+            }
+            pnModDelVar('pn_bbcode', 'displayhook');
         default:
              break;
     }
@@ -165,16 +164,6 @@
         return false;
     }
 
-    if (!pnModUnregisterHook('item',
-                             'display',
-                             'GUI',
-                             'pn_bbcode',
-                             'user',
-                             'codes')) {
-        pnSessionSetVar('errormsg', _PNBBCODE_COULDNOTUNREGISTER . ' (display hook)');
-        return false;
-    }
-
     pnModDelVar('pn_bbcode', 'quote');
     pnModDelVar('pn_bbcode', 'code');
     pnModDelVar('pn_bbcode', 'size_tiny');
@@ -189,7 +178,6 @@
     pnModDelVar('pn_bbcode', 'linenumbers');
     pnModDelVar('pn_bbcode', 'syntaxhilite');
 
-    pnModDelVar('pn_bbcode', 'displayhook');
     // Deletion successful
     return true;
 }
diff -ruN 0.761/modules/pn_bbcode/pnlang/eng/global.php 0.762/modules/pn_bbcode/pnlang/eng/global.php
--- 0.761/modules/pn_bbcode/pnlang/eng/global.php	2005-09-16 09:32:19.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnlang/eng/global.php	2005-10-07 07:06:29.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: global.php,v 1.3 2005/09/16 14:32:19 landseer Exp $
+// $Id: global.php,v 1.4 2005/10/07 12:06:29 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -27,8 +27,6 @@
 // changed to pn_bbcode: larsneo
 // ----------------------------------------------------------------------
 
-define('_PNBBCODE_ENABLEDISPLAYHOOK', 'Enable displayhook');
-
 define('_PNBBCODE_ADMINCODECONFIG', 'Configuration [code][/code]');
 define('_PNBBCODE_ADMINCOLORCONFIG', 'Configuration [color][/color]');
 define('_PNBBCODE_ADMINISTRATION', 'pn_bbcode Administration');
diff -ruN 0.761/modules/pn_bbcode/pntemplates/pn_bbcode_admin_main.html 0.762/modules/pn_bbcode/pntemplates/pn_bbcode_admin_main.html
--- 0.761/modules/pn_bbcode/pntemplates/pn_bbcode_admin_main.html	2005-09-16 09:32:19.000000000 -0500
+++ 0.762/modules/pn_bbcode/pntemplates/pn_bbcode_admin_main.html	2005-10-07 07:06:29.000000000 -0500
@@ -1,12 +1,4 @@
-<!--[*  $Id: pn_bbcode_admin_main.html,v 1.5 2005/09/16 14:32:19 landseer Exp $  *]-->
+<!--[*  $Id: pn_bbcode_admin_main.html,v 1.6 2005/10/07 12:06:29 landseer Exp $  *]-->
 
 <!--[ include file=pn_bbcode_admin_menu.html ]-->
 
-<form action="<!--[ pnmodurl modname=pn_bbcode type=admin func=update ]-->" method="post">
-<div style="margin: 15px;">
-    <label for="displayhook"><!--[ pnml name='_PNBBCODE_ENABLEDISPLAYHOOK' ]--></label>
-    <input type="checkbox" name="displayhook" id="displayhook" value="yes" <!--[ if $pncore.pn_bbcode.displayhook eq 'yes' ]-->checked="checked"<!--[ /if ]--> />
-    <br /><br /><br />
-    <input type="submit" name="submit" value="<!--[ pnml name='_SUBMIT' ]-->" />
-</div>
-</form>
\ No newline at end of file
diff -ruN 0.761/modules/pn_bbcode/pntemplates/pn_bbcode_admin_menu_760.html 0.762/modules/pn_bbcode/pntemplates/pn_bbcode_admin_menu_760.html
--- 0.761/modules/pn_bbcode/pntemplates/pn_bbcode_admin_menu_760.html	2005-01-26 09:03:32.000000000 -0600
+++ 0.762/modules/pn_bbcode/pntemplates/pn_bbcode_admin_menu_760.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,12 +0,0 @@
-<!--[*  $Id: pn_bbcode_admin_menu_760.html,v 1.1 2005/01/26 15:03:32 landseer Exp $  *]-->
-<!--[ admincategorymenu ]-->
-
-<h2 style="width:99%; background-color:<!--[pnthemegetvar name="bgcolor2"]-->; text-align:center; padding:4px;">
-<!--[pnml name="_PNBBCODE_ADMINISTRATION"]-->
-</h2>
-<div class="pn-menu">
-[&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=codeconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINCODECONFIG"]--></a>&nbsp;]&nbsp;
-[&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=quoteconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINQUOTECONFIG"]--></a>&nbsp;]<br />
-[&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=sizeconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINSIZECONFIG"]--></a>&nbsp;]&nbsp;
-[&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=colorconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINCOLORCONFIG"]--></a>&nbsp;]<br />
-</div>
\ No newline at end of file
diff -ruN 0.761/modules/pn_bbcode/pntemplates/pn_bbcode_admin_menu.html 0.762/modules/pn_bbcode/pntemplates/pn_bbcode_admin_menu.html
--- 0.761/modules/pn_bbcode/pntemplates/pn_bbcode_admin_menu.html	2005-01-02 15:08:33.000000000 -0600
+++ 0.762/modules/pn_bbcode/pntemplates/pn_bbcode_admin_menu.html	2005-10-07 07:06:29.000000000 -0500
@@ -1,16 +1,16 @@
-<!--[*  $Id: pn_bbcode_admin_menu.html,v 1.2 2005/01/02 21:08:33 landseer Exp $  *]-->
+<!--[*  $Id: pn_bbcode_admin_menu.html,v 1.3 2005/10/07 12:06:29 landseer Exp $  *]-->
+
+<!--[admincategorymenu]-->
 
-<!--[pngetstatusmsg]-->
 <h2 style="width:99%; background-color:<!--[pnthemegetvar name="bgcolor2"]-->; text-align:center; padding:4px;">
-<!--[pnml name="_PNBBCODE_ADMINISTRATION"]-->
+    <!--[pnml name="_PNBBCODE_ADMINISTRATION"]-->
 </h2>
 
-<div>
-<a href="admin.php"><!--[pnml name="_PNBBCODE_PNADMINISTRATION"]--></a>
+<div class="pn-menu" style="margin: 1em;">
+    [&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=codeconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINCODECONFIG"]--></a>&nbsp;]&nbsp;
+    [&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=quoteconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINQUOTECONFIG"]--></a>&nbsp;]<br />
 </div>
-<div class="pn-menu">
-[&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=codeconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINCODECONFIG"]--></a>&nbsp;]&nbsp;
-[&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=quoteconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINQUOTECONFIG"]--></a>&nbsp;]<br />
-[&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=sizeconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINSIZECONFIG"]--></a>&nbsp;]&nbsp;
-[&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=colorconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINCOLORCONFIG"]--></a>&nbsp;]<br />
+<div class="pn-menu" style="margin: 1em;">
+    [&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=sizeconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINSIZECONFIG"]--></a>&nbsp;]&nbsp;
+    [&nbsp;<a href="<!--[ pnmodurl modname=pn_bbcode type=admin func=colorconfig ]-->"><!--[pnml name="_PNBBCODE_ADMINCOLORCONFIG"]--></a>&nbsp;]<br />
 </div>
\ No newline at end of file
diff -ruN 0.761/modules/pn_bbcode/pntemplates/pn_bbcode_user_bbcodes.html 0.762/modules/pn_bbcode/pntemplates/pn_bbcode_user_bbcodes.html
--- 0.761/modules/pn_bbcode/pntemplates/pn_bbcode_user_bbcodes.html	2005-08-18 15:20:59.000000000 -0500
+++ 0.762/modules/pn_bbcode/pntemplates/pn_bbcode_user_bbcodes.html	2005-12-03 04:38:35.000000000 -0600
@@ -1,7 +1,6 @@
-<!--[*  $Id: pn_bbcode_user_bbcodes.html,v 1.5 2005/08/18 20:20:59 landseer Exp $  *]-->
+<!--[*  $Id: pn_bbcode_user_bbcodes.html,v 1.8 2005/12/03 10:38:35 larsneo Exp $  *]-->
 
 <!--[ add_additional_header header=$jsheadercommon ]-->
-
 <noscript>
     <p><strong><!--[ pnml name='_PNBBCODE_NOSCRIPTWARNING' ]--></strong></p>
 </noscript>
@@ -13,6 +12,7 @@
     <!--[bbcodebutton textfieldid=$textfieldid name="image" titleml=1 title="_PNBBCODE_IMAGE_HINT" key="p" image="bb_image.gif" ]-->
     <!--[bbcodebutton textfieldid=$textfieldid name="quote" titleml=1 title="_PNBBCODE_QUOTE_HINT" key="q" image="bb_quote.gif" ]-->
     <!--[bbcodebutton textfieldid=$textfieldid name="code" titleml=1 title="_PNBBCODE_CODE_HINT" key="c" image="bb_code.gif" ]-->
+
     <br />
     <!--[bbcodebutton textfieldid=$textfieldid name="listopen" titleml=1 title="_PNBBCODE_LISTOPEN_HINT" key="l" image="bb_openlist.gif" ]-->
     <!--[bbcodebutton textfieldid=$textfieldid name="listitem" titleml=1 title="_PNBBCODE_LISTITEM_HINT" key="o" image="bb_listitem.gif" ]-->
@@ -22,15 +22,17 @@
     <!--[bbcodebutton textfieldid=$textfieldid name="underline" titleml=1 title="_PNBBCODE_UNDERLINE_HINT" key="u" image="bb_underline.gif" ]-->
 <!--[ else ]-->
     <input title="<!--[ pnml name='_PNBBCODE_URL_HINT' ]-->" type="button" accesskey="w" name="url" value=" <!--[ pnml name='_PNBBCODE_URL' ]--> " style="text-decoration: underline; width: 50px;" onclick="AddBBCode('<!--[ $textfieldid ]-->', 'url')" />
+
     <input title="<!--[ pnml name='_PNBBCODE_MAIL_HINT' ]-->" type="button" accesskey="m" name="mail" value=" <!--[ pnml name='_PNBBCODE_MAIL' ]--> " style="text-decoration: underline; width: 50px;" onclick="AddBBCode('<!--[ $textfieldid ]-->', 'email')" />
     <input title="<!--[ pnml name='_PNBBCODE_IMAGE_HINT' ]-->" type="button" accesskey="p" name="image" value=" <!--[ pnml name='_PNBBCODE_IMAGE' ]--> " style="width: 50px;" onclick="AddBBCode('<!--[ $textfieldid ]-->', 'image')" />
     <input title="<!--[ pnml name='_PNBBCODE_QUOTE_HINT' ]-->" type="button" accesskey="q" name="quote" value=" <!--[ pnml name='_PNBBCODE_QUOTE' ]--> " style="width: 50px;" onclick="AddBBCode('<!--[ $textfieldid ]-->', 'quote')" />
     <!--[ if count($geshi_languages) neq 0 ]-->
         <!--[ pnml name='_PNBBCODE_CODE' ]-->:
-        <select title="<!--[ pnml name='_PNBBCODE_CODE_HINT' ]-->" name="code" onchange="AddBBCode('<!--[ $textfieldid ]-->', 'code', this.form.code.options[this.form.code.selectedIndex].value)">
+        <select title="<!--[ pnml name='_PNBBCODE_CODE_HINT' ]-->" name="code_<!--[ $counter ]-->" onchange="AddBBCode('<!--[ $textfieldid ]-->', 'code', this.form.code_<!--[ $counter ]-->.options[this.form.code_<!--[ $counter ]-->.selectedIndex].value)">
             <option style="color:black; background-color: #FFFFFF "  value="" selected="selected"><!--[ pnml name='_PNBBCODE_SELECTCODE' ]--></option>
             <option style="color:black; background-color: #FFFFFF "  value=""><!--[ pnml name='_PNBBCODE_NOSPECIALCODE' ]--></option>
             <!--[ foreach item=code from=$geshi_languages ]-->
+
             <option style="color:black; background-color: #FFFFFF "  value="<!--[ $code ]-->"><!--[$code ]--></option>
             <!--[ /foreach ]-->
         </select>
@@ -40,6 +42,7 @@
     <br />
     <input title="<!--[ pnml name='_PNBBCODE_LISTOPEN_HINT' ]-->" type="button" accesskey="l" name="listopen" value=" <!--[ pnml name='_PNBBCODE_LISTOPEN' ]--> " style="width: 40px;" onclick="AddBBCode('<!--[ $textfieldid ]-->', 'listopen')" />
     <input title="<!--[ pnml name='_PNBBCODE_LISTITEM_HINT' ]-->" type="button" accesskey="o" name="listitem" value=" <!--[ pnml name='_PNBBCODE_LISTITEM' ]--> " style="width: 40px;" onclick="AddBBCode('<!--[ $textfieldid ]-->', 'listitem')" />
+
     <input title="<!--[ pnml name='_PNBBCODE_LISTCLOSE_HINT' ]-->" type="button" accesskey="x" name="listclose" value=" <!--[ pnml name='_PNBBCODE_LISTCLOSE' ]--> " style="width: 40px;" onclick="AddBBCode('<!--[ $textfieldid ]-->', 'listclose')" />
     <input title="<!--[ pnml name='_PNBBCODE_BOLD_HINT' ]-->" type="button" accesskey="b" name="bold" value=" <!--[ pnml name='_PNBBCODE_BOLD' ]--> " style="font-weight:bold; width: 40px;" onclick="AddBBCode('<!--[ $textfieldid ]-->', 'bold')" />
     <input title="<!--[ pnml name='_PNBBCODE_ITALIC_HINT' ]-->" type="button" accesskey="i" name="italic" value=" <!--[ pnml name='_PNBBCODE_ITALIC' ]--> " style="font-style: italic; width: 40px;" onclick="AddBBCode('<!--[ $textfieldid ]-->', 'italic')" />
@@ -49,8 +52,9 @@
 <div>
 <!--[ if $color_enabled eq "yes" ]-->
     <!--[ pnml name='_PNBBCODE_FONTCOLOR' ]-->:
-    <select title="<!--[ pnml name='_PNBBCODE_COLOR_HINT' ]-->" name="fontcolor" onchange="AddBBCode('<!--[ $textfieldid ]-->', 'color', this.form.fontcolor.options[this.form.fontcolor.selectedIndex].value)">
+    <select title="<!--[ pnml name='_PNBBCODE_COLOR_HINT' ]-->" name="fontcolor_<!--[ $counter ]-->" onchange="AddBBCode('<!--[ $textfieldid ]-->', 'color', this.form.fontcolor_<!--[ $counter ]-->.options[this.form.fontcolor_<!--[ $counter ]-->.selectedIndex].value)">
         <option style="color:black; background-color: #FFFFFF "  value="black"><!--[ pnml name='_PNBBCODE_COLOR_DEFAULT' ]--></option>
+
         <option style="color:darkred; background-color: #DEE3E7" value="darkred"><!--[ pnml name='_PNBBCODE_COLOR_DARKRED' ]--></option>
         <option style="color:red; background-color: #DEE3E7"     value="red"><!--[ pnml name='_PNBBCODE_COLOR_RED' ]--></option>
         <option style="color:orange; background-color: #DEE3E7"  value="orange"><!--[ pnml name='_PNBBCODE_COLOR_ORANGE' ]--></option>
@@ -60,6 +64,7 @@
         <option style="color:green; background-color: #DEE3E7"    value="green"><!--[ pnml name='_PNBBCODE_COLOR_GREEN' ]--></option>
         <option style="color:olive; background-color: #DEE3E7"    value="olive"><!--[ pnml name='_PNBBCODE_COLOR_OLIVE' ]--></option>
         <option style="color:cyan; background-color: #DEE3E7"     value="cyan"><!--[ pnml name='_PNBBCODE_COLOR_CYAN' ]--></option>
+
         <option style="color:blue; background-color: #DEE3E7"     value="blue"><!--[ pnml name='_PNBBCODE_COLOR_BLUE' ]--></option>
         <option style="color:darkblue; background-color: #DEE3E7" value="darkblue"><!--[ pnml name='_PNBBCODE_COLOR_DARKBLUE' ]--></option>
 
@@ -69,16 +74,20 @@
         <option style="color:black; background-color: #DEE3E7"  value="black"><!--[ pnml name='_PNBBCODE_COLOR_BLACK' ]--></option>
     <!--[ if $allow_usercolor eq "yes" ]-->
         <option style="color:black; background-color: #DEE3E7" value="#<!--[ pnml name='_PNBBCODE_COLOR_TEXTCOLORCODE' ]-->"><!--[ pnml name='_PNBBCODE_COLOR_DEFINE' ]--></option>
+
     <!--[ /if ]-->
     </select>&nbsp;
 <!--[ /if ]-->
+</div>
+<div>
 <!--[ if $size_enabled eq "yes" ]-->
     <!--[ pnml name='_PNBBCODE_FONTSIZE' ]-->:
-    <select title="<!--[ pnml name='_PNBBCODE_SIZE_HINT' ]-->" name="fontsize" onchange="AddBBCode('<!--[ $textfieldid ]-->', 'size',this.form.fontsize.options[this.form.fontsize.selectedIndex].value)">
+    <select title="<!--[ pnml name='_PNBBCODE_SIZE_HINT' ]-->" name="fontsize_<!--[ $counter ]-->" onchange="AddBBCode('<!--[ $textfieldid ]-->', 'size',this.form.fontsize_<!--[ $counter ]-->.options[this.form.fontsize_<!--[ $counter ]-->.selectedIndex].value)">
         <option value="tiny"><!--[ pnml name='_PNBBCODE_SIZE_TINY' ]--></option>
         <option value="small"><!--[ pnml name='_PNBBCODE_SIZE_SMALL' ]--></option>
         <option value="normal" selected="selected"><!--[ pnml name='_PNBBCODE_SIZE_NORMAL' ]--></option>
         <option value="large"><!--[ pnml name='_PNBBCODE_SIZE_LARGE' ]--></option>
+
         <option value="huge"><!--[ pnml name='_PNBBCODE_SIZE_HUGE' ]--></option>
     <!--[ if $allow_usersize eq "yes" ]-->
         <option value="<!--[ pnml name='_PNBBCODE_SIZE_TEXTSIZE' ]-->"><!--[ pnml name='_PNBBCODE_SIZE_DEFINE' ]--></option>
diff -ruN 0.761/modules/pn_bbcode/pnuserapi.php 0.762/modules/pn_bbcode/pnuserapi.php
--- 0.761/modules/pn_bbcode/pnuserapi.php	2005-08-09 10:11:38.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnuserapi.php	2005-11-08 09:00:27.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnuserapi.php,v 1.32 2005/08/09 15:11:38 landseer Exp $
+// $Id: pnuserapi.php,v 1.38 2005/11/08 15:00:27 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -131,7 +131,7 @@
     $message = preg_replace("/\[i\](.*?)\[\/i\]/si", "<em>\\1</em>", $message);
 
     // [img]image_url_here[/img] code..
-    $message = preg_replace("#\[img\](http://)?(.*?)\[/img\]#si", "<img src=\"http://\\2\" />", $message);
+    $message = preg_replace("#\[img\](.*?)\[/img\]#si", "<img src=\"\\1\" alt=\"\\1\" />", $message);
     //$message = preg_replace("/\[img\](.*?)\[\/img\]/si", "<IMG SRC=\"\\1\" BORDER=\"0\">", $message);
 
     // three new bbcodes, thanks to Chris Miller (r3ap3r)
@@ -337,6 +337,7 @@
 
 /**
  * Nathan Codding - Jan. 12, 2001.
+ * Frank Schummertz - Sept. 2004ff
  * Performs [code][/code] bbencoding on the given string, and returns the results.
  * Any unmatched "[code]" or "[/code]" token will just be left alone.
  * This works fine with both having more than one code block in a message, and with nested code blocks.
@@ -490,6 +491,7 @@
 
 /**
  * Nathan Codding - Jan. 12, 2001.
+ * Frank Schummertz - Sept. 2004ff
  * Performs [list][/list] and [list=?][/list] bbencoding on the given string, and returns the results.
  * Any unmatched "[list]" or "[/list]" token will just be left alone.
  * This works fine with both having more than one list in a message, and with nested lists.
@@ -500,9 +502,8 @@
  */
 function pn_bbcode_encode_list($message)
 {
-    $start_length = array();
-    $start_length['ordered'] = 8;
-    $start_length['unordered'] = 6;
+    $start_length = array('ordered' => 8,
+                          'unordered' => 6);
 
     // First things first: If there aren't any "[list" strings in the message, we don't
     // need to process it at all.
@@ -538,6 +539,7 @@
             } else if (strcasecmp("[/list]", $possible_end) == 0) {
                 // We have an ending list tag.
                 // Check if we've already found a matching starting tag.
+                $new_between_tags = '';
                 if (sizeof($stack) > 0) {
                     // There exists a starting tag.
                     // We need to do 2 replacements now.
@@ -545,31 +547,49 @@
                     $start_index = $start[0];
                     $start_char = $start[1];
                     $is_ordered = ($start_char != "");
-                    $start_tag_length = ($is_ordered) ? $start_length['ordered'] : $start_length['unordered'];
+
+                    // configure list style
+                    // to-do: think about definition lists...
+                    if($is_ordered) {
+                        // ordered list
+                        $listitemclass    = 'bbcode_orderedlist_item';
+                        $start_tag_length = $start_length['ordered'];
+                        $start_tag        = '<ol type="' . $start_char . '" class="bbcode_orderedlist">';
+                        $end_tag          = '</ol>';
+                    } else {
+                        // list
+                        $listitemclass    = 'bbcode_list_item';
+                        $start_tag_length = $start_length['unordered'];
+                        $start_tag        = '<ul class="bbcode_list">';
+                        $end_tag          = '</ul>';
+                    }
 
                     // everything before the [list] tag.
                     $before_start_tag = substr($message, 0, $start_index);
 
-                    // everything after the [list] tag, but before the [/list] tag.
+                    // everything between [list] and [/list] tags.
                     $between_tags = substr($message, $start_index + $start_tag_length, $curr_pos - $start_index - $start_tag_length);
-                    // Need to replace [*] with <li> inside the list.
-                    $between_tags = str_replace("[*]", "<li>", $between_tags);
 
                     // everything after the [/list] tag.
                     $after_end_tag = substr($message, $curr_pos + 7);
-                    $between_tags = str_replace("\n", '</li>', $between_tags);
-                    $between_tags = substr($between_tags, 6, strlen($between_tags) - 6);
-
 
-                    if ($is_ordered) {
-                        $message = $before_start_tag . '<ol type="' . $start_char . '">';
-                        $message .= $between_tags . '</ol>';
-                    } else {
-                        $message = $before_start_tag . '<ul>';
-                        $message .= $between_tags . "</ul>";
+                    // replace [*]... with <li>...</li>
+                    // new: adding css classes for better styling of bbcode lists
+                    $listitems = explode('[*]', $between_tags);
+                    // listitems may be false, empty or containing [*] if between_tags was empty
+                    if(is_array($listitems) && count($listitems)>0 && $listitems[0]<>'[*]') {
+                        for($cnt=1; $cnt<count($listitems); $cnt++) {
+                            if(!empty($listitems[$cnt])) {
+                                $new_between_tags .= '<li class="' . $listitemclass . '">' . $listitems[$cnt] . '</li>';
+                            }
+                        }
                     }
 
-                    $message .= $after_end_tag;
+                    $message = $before_start_tag
+                             . $start_tag
+                             . $new_between_tags
+                             . $end_tag
+                             . $after_end_tag;
 
                     // Now.. we've screwed up the indices by changing the length of the string.
                     // So, if there's anything in the stack, we want to resume searching just after it.
@@ -687,7 +707,8 @@
             return '<a href="user.php" title="' . pnVarPrepForDisplay(_PNBBCODE_NOTALLOWEDTOSEEEXTERNALLINKS) . '">' . pnVarPrepForDisplay(_PNBBCODE_NOTALLOWEDTOSEEEXTERNALLINKS) . '</a>';
         }
     } else {
-        return '<a href="' . $matches[1] . $matches[2] . '">' . $matches[1] . $matches[2] . '</a>';
+        $displayurl = pn_bbcode_minimize_displayurl($matches[1] . $matches[2]);
+        return '<a href="' . $matches[1] . $matches[2] . '">' . $displayurl . '</a>';
     }
 }
 
@@ -714,7 +735,8 @@
             return '<a href="user.php" title="' . pnVarPrepForDisplay(_PNBBCODE_NOTALLOWEDTOSEEEXTERNALLINKS) . '">' . pnVarPrepForDisplay(_PNBBCODE_NOTALLOWEDTOSEEEXTERNALLINKS) . '</a>';
         }
     } else {
-        return '<a href="http://' . $matches[1] . '">' . $matches[1] . '</a>';
+        $displayurl = pn_bbcode_minimize_displayurl($matches[1]);
+        return '<a href="http://' . $matches[1] . '">' . $displayurl . '</a>';
     }
 }
 
@@ -738,6 +760,7 @@
         $displayurl = pnVarPrepForDisplay(_PNBBCODE_NOTALLOWEDTOSEEEXTERNALLINKS);
     } else {
         $displayurl = $matches[3];
+        $title = strip_tags($displayurl);
     }
     if( ($is_allowed==false) && (strpos($matches[1] . $matches[2], $our_url)===false) ) {
         // not allowed to see links and link is not on our site
@@ -747,7 +770,7 @@
             return '<a href="user.php" title="' . pnVarPrepForDisplay(_PNBBCODE_NOTALLOWEDTOSEEEXTERNALLINKS) . '">' . $displayurl . '</a>';
         }
     } else {
-        return '<a href="' . $matches[1] . $matches[2] . '" title="' . $displayurl . '">' . $displayurl . '</a>';
+        return '<a href="' . $matches[1] . $matches[2] . '" title="' . $title . '">' . $displayurl . '</a>';
     }
 }
 
@@ -771,6 +794,7 @@
         $displayurl = pnVarPrepForDisplay(_PNBBCODE_NOTALLOWEDTOSEEEXTERNALLINKS);
     } else {
         $displayurl = $matches[2];
+        $title = strip_tags($displayurl);
     }
     if( ($is_allowed==false) && (strpos('http://' . $matches[1], $our_url)===false) ) {
         // not allowed to see links and link is not on our site
@@ -780,7 +804,7 @@
             return '<a href="user.php" title="' . pnVarPrepForDisplay(_PNBBCODE_NOTALLOWEDTOSEEEXTERNALLINKS) . '">' . $displayurl . '</a>';
         }
     } else {
-        return '<a href="http://' . $matches[1] . '" title="' . $displayurl . '">' . $displayurl . '</a>';
+        return '<a href="http://' . $matches[1] . '" title="' . $title . '">' . $displayurl . '</a>';
     }
 }
 
@@ -809,4 +833,23 @@
     }
 }
 
+/** pn_bbcode_minimize_displayurl
+ *  helper function to cut down the displayed url to a maximum length
+ *
+ *
+ */
+function pn_bbcode_minimize_displayurl($displayurl)
+{
+    // get the maximum size of the urls to show
+    // todo: make this configurable
+    $maxsize = 30;
+    $before = round($maxsize / 2);
+    $after  = $maxsize - 3 - $before;
+
+    if(strlen($displayurl) > 30) {
+        $displayurl = substr($displayurl, 0, $before) . "..." . substr($displayurl, strlen($displayurl) - $after, $after);
+    }
+    return $displayurl;
+}
+
 ?>
\ No newline at end of file
diff -ruN 0.761/modules/pn_bbcode/pnuser.php 0.762/modules/pn_bbcode/pnuser.php
--- 0.761/modules/pn_bbcode/pnuser.php	2005-09-16 09:32:19.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnuser.php	2005-10-10 09:03:10.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnuser.php,v 1.9 2005/09/16 14:32:19 landseer Exp $
+// $Id: pnuser.php,v 1.11 2005/10/10 14:03:10 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -57,29 +57,6 @@
 }
 
 /**
- * codes
- * returns a html snippet with buttons for inserting bbocdes into a text
- *
- *@params $args['extrainfo'] extrainfo
- */
-function pn_bbcode_user_codes($args)
-{
-    extract($args);
-    unset($args);
-
-    // we do not need the objectid - we just want to display the smilies now
-
-    $displayhook = pnModGetVar('pn_bbcode', 'displayhook');
-    if($displayhook == 'yes') {
-        if(!isset($extrainfo) || !is_array($extrainfo) || empty($extrainfo) ) {
-            return _MODARGSERROR . ' (extrainfo)';
-        }
-        return pn_bbcode_user_bbcodes($extrainfo);
-    }
-    return '';
-}
-
-/**
  * bbcode
  * returns a html snippet with buttons for inserting bbocdes into a text
  *
@@ -95,14 +72,19 @@
         return _MODARGSERROR . ' (textfieldid)';
     }
 
-    // load language file
-    if(!pnModAPILoad('pn_bbcode', 'user')) {
-        $smarty->trigger_error("loading pn_bbcode api failed", e_error);
-        return;
+    // if we have more than one textarea we need to distinguish them, so we simply use
+    // a counter stored in a session var until we find a better solution
+    $counter = pnSessionGetVar('bbcode_counter');
+    if($counter==false) {
+        $counter = 1;
+    } else {
+        $counter++;
     }
+    pnSessionSetVar('bbcode_counter', $counter);
 
     $pnr =& new pnRender('pn_bbcode');
     $pnr->caching = false;
+    $pnr->assign('counter', $counter);
     $pnr->assign('allow_usersize', pnModGetVar('pn_bbcode', 'allow_usersize'));
     $pnr->assign('size_enabled', pnModGetVar('pn_bbcode', 'size_enabled'));
     $pnr->assign('allow_usercolor', pnModGetVar('pn_bbcode', 'allow_usercolor'));
diff -ruN 0.761/modules/pn_bbcode/pnversion.php 0.762/modules/pn_bbcode/pnversion.php
--- 0.761/modules/pn_bbcode/pnversion.php	2005-09-16 09:32:19.000000000 -0500
+++ 0.762/modules/pn_bbcode/pnversion.php	2005-11-22 14:40:46.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnversion.php,v 1.14 2005/09/16 14:32:19 landseer Exp $
+// $Id: pnversion.php,v 1.16 2005/11/22 20:40:46 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -34,7 +34,7 @@
 */
 
 $modversion['name']             = 'pn_bbcode';
-$modversion['version']          = '1.18';
+$modversion['version']          = '1.20';
 $modversion['id'] 				= '164';
 $modversion['description']      = 'BBCode Hook';
 $modversion['credits']          = 'pndocs/credits.txt';
diff -ruN 0.761/modules/pn_bbsmile/pnadminapi.php 0.762/modules/pn_bbsmile/pnadminapi.php
--- 0.761/modules/pn_bbsmile/pnadminapi.php	2005-05-11 13:00:40.000000000 -0500
+++ 0.762/modules/pn_bbsmile/pnadminapi.php	2005-10-07 07:11:23.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadminapi.php,v 1.2 2005/05/11 18:00:40 landseer Exp $
+// $Id: pnadminapi.php,v 1.3 2005/10/07 12:11:23 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -47,11 +47,6 @@
     extract($args);
     unset($args);
 
-    if(!pnModAPILoad('pn_bbsmile', 'user')) {
-        pnSessionSetVar('errormsg', _FAILEDTOLOAD);
-        return false;
-    }
-
     // Get the new array
     $new_smilies = pnModAPIFunc('pn_bbsmile', 'admin', 'load_smilies');
 
diff -ruN 0.761/modules/pn_bbsmile/pnadmin.php 0.762/modules/pn_bbsmile/pnadmin.php
--- 0.761/modules/pn_bbsmile/pnadmin.php	2005-09-16 09:56:46.000000000 -0500
+++ 0.762/modules/pn_bbsmile/pnadmin.php	2005-10-07 07:11:23.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.7 2005/09/16 14:56:46 landseer Exp $
+// $Id: pnadmin.php,v 1.8 2005/10/07 12:11:23 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -75,12 +75,6 @@
             $activate_auto = 'checked="checked"';
         $pnRender->assign('activate_auto', $activate_auto);
 
-        $displayhook_value = pnModGetVar('pn_bbsmile', 'displayhook');
-        $displayhook = "";
-        if ($displayhook_value)
-            $displayhook = 'checked="checked"';
-        $pnRender->assign('displayhook', $displayhook);
-
         $remove_inactive_value = pnModGetVar('pn_bbsmile', 'remove_inactive');
         $remove_inactive = "";
         if ($remove_inactive_value)
@@ -107,10 +101,6 @@
         if (empty($remove_inactive)) $remove_inactive = 0;
         pnModSetVar('pn_bbsmile', 'remove_inactive', $remove_inactive);
 
-        $displayhook = pnVarCleanFromInput('displayhook');
-        if (empty($displayhook)) $displayhook = 0;
-        pnModSetVar('pn_bbsmile', 'displayhook', $displayhook);
-
         pnSessionSetVar('statusmsg', _PNBBSMILE_ADMIN_CONFIGSAVED);
         pnRedirect(pnModURL('pn_bbsmile', 'admin'));
 
@@ -125,9 +115,6 @@
         return pnVarPrepHTMLDisplay(_PNBBSMILE_ADMIN_NOACCESS);;
     }
 
-    if(!pnModAPILoad('pn_bbsmile', 'admin')) {
-        return _FAILEDTOLOAD;
-    }
     $submit = pnVarCleanFromInput('submit');
 
     if(!$submit) {
diff -ruN 0.761/modules/pn_bbsmile/pndocs/changelog.txt 0.762/modules/pn_bbsmile/pndocs/changelog.txt
--- 0.761/modules/pn_bbsmile/pndocs/changelog.txt	2005-09-26 08:42:13.000000000 -0500
+++ 0.762/modules/pn_bbsmile/pndocs/changelog.txt	2005-10-07 07:11:23.000000000 -0500
@@ -1,7 +1,6 @@
-Version 1.15:
-    - showing smilies now as display hook:
-      <!--[ pnmodcallhooks hookobject=item hookaction=display hookid=$topic.topic_id implode=false textfieldid=message ]-->
-      <!--[ $hooks.pn_bbsmile ]-->
+Version 1.16
+    - minimum requirement now PN .760+
+    - removed displayhook due to compatibility problems
       **********************************************
       **                IMPORTANT!!!              **
       **   You need to go the hooks settings      **
@@ -11,6 +10,9 @@
       **   display hooks too!!!                   **
       **********************************************
 
+Version 1.15:
+    - showing smilies now as display hook.
+
 Version 1.14 AutoSmilie: 2005-04-29
 	- added a Module-Var, which indicates a directory
 	  All Files out of this directory (gif,jpg,pjep,png) are included automatically as
Files 0.761/modules/pn_bbsmile/pnimages/smilies_auto/ie_fox.gif and 0.762/modules/pn_bbsmile/pnimages/smilies_auto/ie_fox.gif differ
diff -ruN 0.761/modules/pn_bbsmile/pninit.php 0.762/modules/pn_bbsmile/pninit.php
--- 0.761/modules/pn_bbsmile/pninit.php	2005-09-26 08:42:13.000000000 -0500
+++ 0.762/modules/pn_bbsmile/pninit.php	2005-11-22 14:28:10.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pninit.php,v 1.7 2005/09/26 13:42:13 landseer Exp $
+// $Id: pninit.php,v 1.10 2005/11/22 20:28:10 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -61,18 +61,6 @@
         pnSessionSetVar('errormsg', _PNBBSMILE_COULDNOTREGISTER . ' (transform hook)');
         return false;
     }
-    // display hook
-    if (!pnModRegisterHook('item',
-                           'display',
-                           'GUI',
-                           'pn_bbsmile',
-                           'user',
-                           'smilies')) {
-        pnSessionSetVar('errormsg', _PNBBSMILE_COULDNOTREGISTER . ' (display hook)');
-        return false;
-    }
-    pnModSetVar('pn_bbsmile', 'displayhook', '1');
-
     // Initialisation successful
     return true;
 }
@@ -101,7 +89,17 @@
                 return false;
             }
             pnModSetVar('pn_bbsmile', 'displayhook', '1');
-
+        case '1.15':
+            if (!pnModUnregisterHook('item',
+                                     'display',
+                                     'GUI',
+                                     'pn_bbsmile',
+                                     'user',
+                                     'smilies')) {
+                pnSessionSetVar('errormsg', _PNBBSMILE_COULDNOTUNREGISTER . ' (display hook)');
+                return false;
+            }
+            pnModDelVar('pn_bbsmile', 'displayhook');
         default:
             break;
     }
@@ -124,23 +122,8 @@
         return false;
     }
 
-    if (!pnModUnregisterHook('item',
-                             'display',
-                             'GUI',
-                             'pn_bbsmile',
-                             'user',
-                             'bbsmiles')) {
-        pnSessionSetVar('errormsg', _PNBBSMILE_COULDNOTUNREGISTER . ' (display hook)');
-        return false;
-    }
-
     // Remove module variables
-    pnModDelVar('pn_bbsmile', 'smiliepath');
-    pnModDelVar('pn_bbsmile', 'smiliepath_auto');
-    pnModDelVar('pn_bbsmile', 'smilie_array');
-    pnModDelVar('pn_bbsmile', 'activate_auto');
-    pnModDelVar('pn_bbsmile', 'remove_inactive');
-    pnModDelVar('pn_bbsmile', 'displayhook');
+    pnModDelVar('pn_bbsmile');
 
     // Deletion successful
     return true;
diff -ruN 0.761/modules/pn_bbsmile/pnlang/eng/adminapi.php 0.762/modules/pn_bbsmile/pnlang/eng/adminapi.php
--- 0.761/modules/pn_bbsmile/pnlang/eng/adminapi.php	1969-12-31 18:00:00.000000000 -0600
+++ 0.762/modules/pn_bbsmile/pnlang/eng/adminapi.php	2005-11-22 14:25:25.000000000 -0600
@@ -0,0 +1,32 @@
+<?php
+// $Id: adminapi.php,v 1.1 2005/11/22 20:25:25 landseer Exp $
+// ----------------------------------------------------------------------
+// PostNuke Content Management System
+// Copyright (C) 2001 by the PostNuke Development Team.
+// http://www.postnuke.com/
+// ----------------------------------------------------------------------
+// Based on:
+// PHP-NUKE Web Portal System - http://phpnuke.org/
+// Thatware - http://thatware.org/
+// ----------------------------------------------------------------------
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License (GPL)
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
+// ----------------------------------------------------------------------
+// Original Author of file: Hinrich Donner
+// changed to pn_bbsmile: larsneo
+// ----------------------------------------------------------------------
+
+include_once 'modules/pn_bbsmile/pnlang/eng/global.php';
+
+?>
\ No newline at end of file
diff -ruN 0.761/modules/pn_bbsmile/pnlang/eng/admin.php 0.762/modules/pn_bbsmile/pnlang/eng/admin.php
--- 0.761/modules/pn_bbsmile/pnlang/eng/admin.php	2005-09-16 09:56:46.000000000 -0500
+++ 0.762/modules/pn_bbsmile/pnlang/eng/admin.php	2005-11-22 14:25:25.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: admin.php,v 1.6 2005/09/16 14:56:46 landseer Exp $
+// $Id: admin.php,v 1.8 2005/11/22 20:25:25 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -27,40 +27,6 @@
 // changed to pn_bbsmile: larsneo
 // ----------------------------------------------------------------------
 
-define('_PNBBSMILE_ADMIN_LABEL_ENABLE_DISPLAYHOOK', 'Enable displayhook');
-
-define('_PNBBSMILE_FORCERELOAD',               'Force reload of smilies, all data will be overwritten!');
-define('_PNBBSMILE_ADMIN_BTN_SUBMIT',          'Apply');
-define('_PNBBSMILE_ADMIN_BTN_CANCEL',          'Cancel');
-define('_PNBBSMILE_ADMIN_CONFIGSAVED',         'bbsmile configuration updated');
-define('_PNBBSMILE_ADMIN_HINT_IMAGEPATH',      'Enter the directory (relative), where the smilies are.No trailing slash and no backslashes!');
-define('_PNBBSMILE_ADMIN_LABEL_IMAGEPATH',     'Path to the smilies');
-define('_PNBBSMILE_ADMIN_NOACCESS',            'You do not have access to this module');
-define('_PNBBSMILE_ADMIN_TITLE',               'BBsmile Administration');
-define('_PNBBSMILE_ADMIN_TITLE_CONFIG',        'Modify Configuration');
-define('_PNBBSMILE_ADMIN_V1_HINT',             'Please note that the smilie hook function need to be activated for the specific module within administration -> modules.');
-
-define('_PNBBSMILE_ADMIN_HINT_IMAGEPATH_AUTO', 'Enter the directory (relative), where the smilies are, which are included automatically. All files with the ending gif, jpg, jpeg or png are included out of this directory. No trailing slash and no backslashes!');
-define('_PNBBSMILE_ADMIN_LABEL_IMAGEPATH_AUTO','Path to the automatically included smilies');
-
-define('_PNBBSMILE_ADMIN_LABEL_ACTIVATE_AUTO','Should the auto include of smilies be activated?');
-
-define('_PNBBSMILE_ADMIN_LABEL_SMILIETABLE','Currently defined Smilies');
-define('_PNBBSMILE_ADMIN_SMILIETABLE_SMILIE','Smilie');
-define('_PNBBSMILE_ADMIN_SMILIETABLE_SHORT','Shortcut/Trigger');
-define('_PNBBSMILE_ADMIN_SMILIETABLE_FILENAME','filename');
-define('_PNBBSMILE_ADMIN_SMILIETABLE_ALT','alterbative text');
-define('_PNBBSMILE_ADMIN_SMILIETABLE_ALIAS','Aliases for this smilie');
-define('_PNBBSMILE_ADMIN_SMILIETABLE_ALIAS_HINT','Aliase are seperted by ",". Don\'t uses spaces.');
-define('_PNBBSMILE_ADMIN_SMILIETABLE_ACTIVE', 'Active');
-define('_PNBBSMILE_ADMIN_TITLE_EDITSMILIES','Edit the defined smilies');
-define('_PNBBSMILE_ADMIN_EDITEDSMILIESSAVED','The edited smilies has been saved.');
-
-define('_PNBBSMILE_ADMIN_TITLE_READSMILIESFROMFILESYSTEM','Read smilies out of the directory');
-define('_PNBBSMILE_ADMIN_LABEL_READFROMFILESYSTEM','With confirmation all smilies out of the directory are read. Smilies without a image in the directory will be deleted. Changes on smilie information will be kept.');
-define('_PNBBSMILE_ADMIN_CONFIRM_READFROMFILESYSTEM','Should the smilies be read out of the directory?');
-define('_PNBBSMILE_ADMIN_SMILIESREADFROMFILESYSTEM','Smilies has been read out sucsessfully.');
-define('_PNBBSMILE_ADMIN_LABEL_READSMILIESFROMFILESYSTEM','Read smilies from filesystem');
-define('_PNBBSMILE_ADMIN_LABEL_REMOVE_INACTIVE', 'Remove inactive smilie shortcuts');
+include_once 'modules/pn_bbsmile/pnlang/eng/global.php';
 
 ?>
\ No newline at end of file
diff -ruN 0.761/modules/pn_bbsmile/pnlang/eng/global.php 0.762/modules/pn_bbsmile/pnlang/eng/global.php
--- 0.761/modules/pn_bbsmile/pnlang/eng/global.php	1969-12-31 18:00:00.000000000 -0600
+++ 0.762/modules/pn_bbsmile/pnlang/eng/global.php	2005-11-22 14:25:25.000000000 -0600
@@ -0,0 +1,92 @@
+<?php
+// $Id: global.php,v 1.1 2005/11/22 20:25:25 landseer Exp $
+// ----------------------------------------------------------------------
+// PostNuke Content Management System
+// Copyright (C) 2001 by the PostNuke Development Team.
+// http://www.postnuke.com/
+// ----------------------------------------------------------------------
+// Based on:
+// PHP-NUKE Web Portal System - http://phpnuke.org/
+// Thatware - http://thatware.org/
+// ----------------------------------------------------------------------
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License (GPL)
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
+// ----------------------------------------------------------------------
+// Original Author of file: Hinrich Donner
+// changed to pn_bbsmile: larsneo
+// ----------------------------------------------------------------------
+
+// include smilie alternative text defines
+@include_once('modules/pn_bbsmile/pnlang/eng/smilies.php');
+
+//
+// A
+//
+define('_PNBBSMILE_ADMIN_BTN_CANCEL', 'Cancel');
+define('_PNBBSMILE_ADMIN_BTN_SUBMIT', 'Apply');
+define('_PNBBSMILE_ADMIN_CONFIGSAVED', 'pn_bbsmile configuration updated');
+define('_PNBBSMILE_ADMIN_CONFIRM_READFROMFILESYSTEM', 'Should the smilies be read out of the directory?');
+define('_PNBBSMILE_ADMIN_EDITEDSMILIESSAVED', 'The edited smilies has been saved.');
+define('_PNBBSMILE_ADMIN_HINT_IMAGEPATH', 'Enter the directory (relative), where the smilies are.No trailing slash and no backslashes!');
+define('_PNBBSMILE_ADMIN_HINT_IMAGEPATH_AUTO', 'Enter the directory (relative), where the smilies are, which are included automatically. All files with the ending gif, jpg, jpeg or png are included out of this directory. No trailing slash and no backslashes!');
+define('_PNBBSMILE_ADMIN_LABEL_ACTIVATE_AUTO', 'Should the auto include of smilies be activated?');
+define('_PNBBSMILE_ADMIN_LABEL_IMAGEPATH', 'Path to the smilies');
+define('_PNBBSMILE_ADMIN_LABEL_IMAGEPATH_AUTO', 'Path to the automatically included smilies');
+define('_PNBBSMILE_ADMIN_LABEL_READFROMFILESYSTEM', 'With confirmation all smilies out of the directory are read. Smilies without a image in the directory will be deleted. Changes on smilie information will be kept.');
+define('_PNBBSMILE_ADMIN_LABEL_READSMILIESFROMFILESYSTEM', 'Read smilies from filesystem');
+define('_PNBBSMILE_ADMIN_LABEL_REMOVE_INACTIVE', 'Remove inactive smilie shortcuts');
+define('_PNBBSMILE_ADMIN_LABEL_SMILIETABLE', 'Currently defined Smilies');
+define('_PNBBSMILE_ADMIN_NOACCESS', 'You do not have access to this module');
+define('_PNBBSMILE_ADMIN_SMILIESREADFROMFILESYSTEM', 'Smilies have been read from filesystem sucsessfully.');
+define('_PNBBSMILE_ADMIN_SMILIETABLE_ACTIVE', 'Active');
+define('_PNBBSMILE_ADMIN_SMILIETABLE_ALIAS', 'Aliases for this smilie');
+define('_PNBBSMILE_ADMIN_SMILIETABLE_ALIAS_HINT', 'Aliases are seperated by ",". Don\'t uses spaces.');
+define('_PNBBSMILE_ADMIN_SMILIETABLE_ALT', 'alternative text');
+define('_PNBBSMILE_ADMIN_SMILIETABLE_FILENAME', 'Filename');
+define('_PNBBSMILE_ADMIN_SMILIETABLE_SHORT', 'Shortcut/Trigger');
+define('_PNBBSMILE_ADMIN_SMILIETABLE_SMILIE', 'Smilie');
+define('_PNBBSMILE_ADMIN_TITLE', 'pn_bbsmile Administration');
+define('_PNBBSMILE_ADMIN_TITLE_CONFIG', 'Modify Configuration');
+define('_PNBBSMILE_ADMIN_TITLE_EDITSMILIES', 'Edit the defined smilies');
+define('_PNBBSMILE_ADMIN_TITLE_READSMILIESFROMFILESYSTEM', 'Read smilies out of the directory');
+define('_PNBBSMILE_ADMIN_V1_HINT', 'Please note that the smilie hook function need to be activated for the specific module within administration -> modules.');
+define('_PNBBSMILE_ARGSERROR', '[pn_bbsmile] Internal error! Arguments missing!');
+
+//
+// C
+//
+define('_PNBBSMILE_COULDNOTREGISTER', 'pn_bbsmile was NOT installed!');
+define('_PNBBSMILE_COULDNOTUNREGISTER', 'pn_bbsmile was NOT removed!');
+
+//
+// F
+//
+define('_PNBBSMILE_FORCERELOAD', 'Force reload of smilies, all data will be overwritten!');
+
+//
+// M
+//
+define('_PNBBSMILE_MORESMILIES', 'More Smilies');
+
+//
+// N
+//
+define('_PNBBSMILE_NOSCRIPTWARNING', 'Your browser does not support javascript or you turned it off. This means that several features on this page will not work as intended');
+
+//
+// S
+//
+define('_PNBBSMILE_SHOWHIDE_SMILIES', 'show/hide smilies');
+
+?>
\ No newline at end of file
diff -ruN 0.761/modules/pn_bbsmile/pnlang/eng/init.php 0.762/modules/pn_bbsmile/pnlang/eng/init.php
--- 0.761/modules/pn_bbsmile/pnlang/eng/init.php	2004-11-09 09:48:23.000000000 -0600
+++ 0.762/modules/pn_bbsmile/pnlang/eng/init.php	2005-11-22 14:25:25.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: init.php,v 1.3 2004/11/09 15:48:23 landseer Exp $
+// $Id: init.php,v 1.4 2005/11/22 20:25:25 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -27,6 +27,6 @@
 // changes for pn_bbsmile: larsneo
 // ----------------------------------------------------------------------
 
-define('_PNBBSMILE_COULDNOTREGISTER',          'pn_bbsmile was NOT installed!');
-define('_PNBBSMILE_COULDNOTUNREGISTER',        'pn_bbsmile was NOT removed!');
+include_once 'modules/pn_bbsmile/pnlang/eng/global.php';
+
 ?>
\ No newline at end of file
diff -ruN 0.761/modules/pn_bbsmile/pnlang/eng/userapi.php 0.762/modules/pn_bbsmile/pnlang/eng/userapi.php
--- 0.761/modules/pn_bbsmile/pnlang/eng/userapi.php	2005-05-08 06:14:00.000000000 -0500
+++ 0.762/modules/pn_bbsmile/pnlang/eng/userapi.php	2005-11-22 14:25:25.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: userapi.php,v 1.5 2005/05/08 11:14:00 landseer Exp $
+// $Id: userapi.php,v 1.6 2005/11/22 20:25:25 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -27,14 +27,6 @@
 // changed to pn_bbsmile: larsneo
 // ----------------------------------------------------------------------
 
-// include smilie alternative text defines
-@include_once('modules/pn_bbsmile/pnlang/eng/smilies.php');
-
-define('_PNBBSMILE_NOSCRIPTWARNING',           'Your browser does not support javascript or you turned it off. This means that several features on this page will not work as intended');
-define('_PNBBSMILE_ARGSERROR',                 '[pn_bbsmile] Internal error! Arguments missing!');
-define('_PNBBSMILE_MORESMILIES',               'More Smilies');
-
-define('_PNBBSMILE_SHOWHIDE_SMILIES','show/hide smilies');
-
+include_once 'modules/pn_bbsmile/pnlang/eng/global.php';
 
 ?>
\ No newline at end of file
diff -ruN 0.761/modules/pn_bbsmile/pnlang/eng/user.php 0.762/modules/pn_bbsmile/pnlang/eng/user.php
--- 0.761/modules/pn_bbsmile/pnlang/eng/user.php	1969-12-31 18:00:00.000000000 -0600
+++ 0.762/modules/pn_bbsmile/pnlang/eng/user.php	2005-11-22 14:25:25.000000000 -0600
@@ -0,0 +1,32 @@
+<?php
+// $Id: user.php,v 1.1 2005/11/22 20:25:25 landseer Exp $
+// ----------------------------------------------------------------------
+// PostNuke Content Management System
+// Copyright (C) 2001 by the PostNuke Development Team.
+// http://www.postnuke.com/
+// ----------------------------------------------------------------------
+// Based on:
+// PHP-NUKE Web Portal System - http://phpnuke.org/
+// Thatware - http://thatware.org/
+// ----------------------------------------------------------------------
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License (GPL)
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
+// ----------------------------------------------------------------------
+// Original Author of file: Hinrich Donner
+// changed to pn_bbsmile: larsneo
+// ----------------------------------------------------------------------
+
+include_once 'modules/pn_bbsmile/pnlang/eng/global.php';
+
+?>
\ No newline at end of file
diff -ruN 0.761/modules/pn_bbsmile/pntemplates/pn_bbsmile_admin_menu.html 0.762/modules/pn_bbsmile/pntemplates/pn_bbsmile_admin_menu.html
--- 0.761/modules/pn_bbsmile/pntemplates/pn_bbsmile_admin_menu.html	2005-05-07 08:15:12.000000000 -0500
+++ 0.762/modules/pn_bbsmile/pntemplates/pn_bbsmile_admin_menu.html	2005-10-07 07:11:23.000000000 -0500
@@ -1,12 +1,12 @@
-<!--[*  $Id: pn_bbsmile_admin_menu.html,v 1.1 2005/05/07 13:15:12 landseer Exp $  *]-->
-<!--[pngetstatusmsg]-->
+<!--[*  $Id: pn_bbsmile_admin_menu.html,v 1.2 2005/10/07 12:11:23 landseer Exp $  *]-->
+<!--[admincategorymenu]-->
 <h2 style="width:99%; background-color:<!--[pnthemegetvar name="bgcolor2"]-->; text-align:center; padding:4px;">
     <!--[pnml name='_PNBBSMILE_ADMIN_TITLE']-->
 </h2>
 <h3>
     <!--[pnml name=_PNBBSMILE_ADMIN_V1_HINT]-->
 </h3>
-<div class="pn-menu"><span class="pn-menuitem-title"><a href="admin.php"><!--[pnml name="_ADMINMENU"]--></a></span></div>
+<br />
 <div class="pn-menu">
 [<a href="<!--[ pnmodurl modname=pn_bbsmile type=admin func=modifyconfig ]-->"><!--[ pnml name='_PNBBSMILE_ADMIN_TITLE_CONFIG' ]--></a>]&nbsp;
 [<a href="<!--[ pnmodurl modname=pn_bbsmile type=admin func=readsmilies ]-->"><!--[ pnml name='_PNBBSMILE_ADMIN_TITLE_READSMILIESFROMFILESYSTEM' ]--></a>]&nbsp;
diff -ruN 0.761/modules/pn_bbsmile/pntemplates/pn_bbsmile_admin_modifyconfig.html 0.762/modules/pn_bbsmile/pntemplates/pn_bbsmile_admin_modifyconfig.html
--- 0.761/modules/pn_bbsmile/pntemplates/pn_bbsmile_admin_modifyconfig.html	2005-09-16 09:56:46.000000000 -0500
+++ 0.762/modules/pn_bbsmile/pntemplates/pn_bbsmile_admin_modifyconfig.html	2005-10-07 07:11:23.000000000 -0500
@@ -1,4 +1,4 @@
-<!--[*  $Id: pn_bbsmile_admin_modifyconfig.html,v 1.3 2005/09/16 14:56:46 landseer Exp $  *]-->
+<!--[*  $Id: pn_bbsmile_admin_modifyconfig.html,v 1.4 2005/10/07 12:11:23 landseer Exp $  *]-->
 <!--[include file="pn_bbsmile_admin_menu.html"]-->
 <h2><!--[pnml name=_PNBBSMILE_ADMIN_TITLE_CONFIG]--></h2>
 <br />
@@ -29,11 +29,6 @@
     </div>
     <br />
     <div class="formrow">
-        <label for="pnbbsmile_displayhook"><!--[pnml name="_PNBBSMILE_ADMIN_LABEL_ENABLE_DISPLAYHOOK"]--></label>
-        <input id="pnbbsmile_displayhook" type="checkbox" name="displayhook" value="1" <!--[$displayhook]--> /><br />
-    </div>
-    <br />
-    <div class="formrow">
         <input name="submit" type="submit" value="<!--[pnml name="_PNBBSMILE_ADMIN_BTN_SUBMIT"]-->" />
     </div>
     <div style="clear:both"></div>
diff -ruN 0.761/modules/pn_bbsmile/pntemplates/pn_bbsmile_user_bbsmiles.html 0.762/modules/pn_bbsmile/pntemplates/pn_bbsmile_user_bbsmiles.html
--- 0.761/modules/pn_bbsmile/pntemplates/pn_bbsmile_user_bbsmiles.html	2005-08-18 15:22:51.000000000 -0500
+++ 0.762/modules/pn_bbsmile/pntemplates/pn_bbsmile_user_bbsmiles.html	2005-10-10 09:03:35.000000000 -0500
@@ -1,4 +1,4 @@
-<!--[* $Id: pn_bbsmile_user_bbsmiles.html,v 1.8 2005/08/18 20:22:51 landseer Exp $ *]-->
+<!--[* $Id: pn_bbsmile_user_bbsmiles.html,v 1.9 2005/10/10 14:03:35 landseer Exp $ *]-->
 
 <!--[* add the javascript file  *]-->
 <!--[ add_additional_header header=$jsheader ]-->
@@ -20,10 +20,10 @@
 <!--[if ( $activate_auto && $smilies|@count > 0 ) ]-->
 
 <div>
-	<a onkeypress="javascript:ShowHide('more_smilies')" href="javascript:ShowHide('more_smilies')" title="<!--[pnml name="_PNBBSMILE_SHOWHIDE_SMILIES"]-->"><!--[pnml name="_PNBBSMILE_MORESMILIES"]--></a>
+	<a onkeypress="javascript:ShowHide('more_smilies_<!--[ $counter ]-->')" href="javascript:ShowHide('more_smilies_<!--[ $counter ]-->')" title="<!--[pnml name="_PNBBSMILE_SHOWHIDE_SMILIES"]-->"><!--[pnml name="_PNBBSMILE_MORESMILIES"]--></a>
 </div>
 
-<div id="more_smilies" style="display:none; margin-bottom: 10px; width: 400px; height: 250px; overflow:auto; color: #00009C;  background-color: #FFFFCE;  border: none;">
+<div id="more_smilies_<!--[ $counter ]-->" style="display:none; margin-bottom: 10px; width: 400px; height: 250px; overflow:auto; color: #00009C;  background-color: #FFFFCE;  border: none;">
     <fieldset>
         <legend style="font-weight: bold;font-size:smaller;">
             <!--[pnml name="_PNBBSMILE_MORESMILIES"]-->
diff -ruN 0.761/modules/pn_bbsmile/pnuser.php 0.762/modules/pn_bbsmile/pnuser.php
--- 0.761/modules/pn_bbsmile/pnuser.php	2005-09-16 09:56:46.000000000 -0500
+++ 0.762/modules/pn_bbsmile/pnuser.php	2005-10-10 09:03:35.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnuser.php,v 1.8 2005/09/16 14:56:46 landseer Exp $
+// $Id: pnuser.php,v 1.10 2005/10/10 14:03:35 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -45,30 +45,6 @@
 }
 
 /**
- * smilies (hook function)
- *
- * @param    $args['objectid']     ID of the item to display comments for
- * @param    $args['extrainfo']    extrainfo
- *
- */
-function pn_bbsmile_user_smilies($args)
-{
-    extract($args);
-    unset($args);
-
-    // we do not need the objectid - we just want to display the smilies now
-
-    $displayhook =  pnModGetVar('pn_bbsmile', 'displayhook');
-    if($displayhook == 1) {
-        if(!isset($extrainfo) || !is_array($extrainfo) || empty($extrainfo) ) {
-            return _MODARGSERROR . ' (extrainfo)';
-        }
-        return pn_bbsmile_user_bbsmiles($extrainfo);
-    }
-    return '';
-}
-
-/**
  * bbsmile
  * returns a html snippet with buttons for inserting bbsmiles into a text
  *
@@ -79,17 +55,23 @@
     extract($args);
     unset($args);
 
-    // load language file
-    if(!pnModAPILoad('pn_bbsmile', 'user')) {
-        return "loading pn_bbsmile api failed";
-    }
-
     if(!isset($textfieldid) || empty($textfieldid)) {
         return _MODARGSERROR . ' (textfieldid)';
     }
 
+    // if we have more than one textarea we need to distinguish them, so we simply use
+    // a counter stored in a session var until we find a better solution
+    $counter = pnSessionGetVar('bbsmile_counter');
+    if($counter==false) {
+        $counter = 1;
+    } else {
+        $counter++;
+    }
+    pnSessionSetVar('bbsmile_counter', $counter);
+
     $pnr =& new pnRender('pn_bbsmile');
     $pnr->caching = false;
+    $pnr->assign('counter', $counter);
     $pnr->assign('imagepath', pnModGetVar('pn_bbsmile', 'smiliepath'));
     $pnr->assign('activate_auto', pnModGetVar('pn_bbsmile', 'activate_auto'));
     $pnr->assign('imagepath_auto', pnModGetVar('pn_bbsmile', 'smiliepath_auto'));
@@ -113,11 +95,6 @@
 {
     extract($args);
 
-    // load language file
-    if(!pnModAPILoad('pn_bbsmile', 'user')) {
-        return "loading pn_bbsmile api failed";
-    }
-
     $pnr =& new pnRender('pn_bbsmile');
     $pnr->caching = false;
     $pnr->assign('imagepath', pnModGetVar('pn_bbsmile', 'smiliepath'));
diff -ruN 0.761/modules/pn_bbsmile/pnversion.php 0.762/modules/pn_bbsmile/pnversion.php
--- 0.761/modules/pn_bbsmile/pnversion.php	2005-09-16 09:56:46.000000000 -0500
+++ 0.762/modules/pn_bbsmile/pnversion.php	2005-10-07 07:11:23.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnversion.php,v 1.10 2005/09/16 14:56:46 landseer Exp $
+// $Id: pnversion.php,v 1.11 2005/10/07 12:11:23 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -34,7 +34,7 @@
 */
 
 $modversion['name']             = 'pn_bbsmile';
-$modversion['version']          = '1.15';
+$modversion['version']          = '1.16';
 $modversion['id']               = '163';
 $modversion['description']      = 'Smilie Hook (Autoincluded)';
 $modversion['credits']          = 'pndocs/credits.txt';
diff -ruN 0.761/modules/pnRender/plugins/function.pager.php 0.762/modules/pnRender/plugins/function.pager.php
--- 0.761/modules/pnRender/plugins/function.pager.php	2005-08-21 05:08:06.000000000 -0500
+++ 0.762/modules/pnRender/plugins/function.pager.php	2005-11-15 10:07:58.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: function.pager.php,v 1.8.2.8 2005/08/21 10:08:06 drak Exp $
+// $Id: function.pager.php,v 1.8.2.8.2.1 2005/11/15 16:07:58 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -16,7 +16,7 @@
  *
  ***    @package      Xanthia_Templating_Environment
  ***    @subpackage   pnRender
- ***    @version      $Id: function.pager.php,v 1.8.2.8 2005/08/21 10:08:06 drak Exp $
+ ***    @version      $Id: function.pager.php,v 1.8.2.8.2.1 2005/11/15 16:07:58 markwest Exp $
  ***    @author       Peter Dudas <duda at bigfish dot hu>
  ***    @link         http://www.postnuke.com  The PostNuke Home Page
  ***    @link         http://www.smarty.hu/plugins/duda/function.pager.phps
@@ -72,7 +72,7 @@
     // START INIT
     $show         = 'record';
     $posvar       = 'pos';
-    $separator    = '&#150;'; // En-dash: &#151; is em-dash
+    $separator    = '&ndash;';
     $class_text   = 'nav';
     $class_num    = 'small';
     $class_numon  = 'big';
@@ -368,4 +368,4 @@
     // END DISPLAY
     return '';
 }
-?>
+?>
\ No newline at end of file
diff -ruN 0.761/modules/pnRender/plugins/function.pnmodavailable.php 0.762/modules/pnRender/plugins/function.pnmodavailable.php
--- 0.761/modules/pnRender/plugins/function.pnmodavailable.php	2005-01-25 10:12:45.000000000 -0600
+++ 0.762/modules/pnRender/plugins/function.pnmodavailable.php	2005-10-03 04:54:50.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: function.pnmodavailable.php,v 1.1.2.2 2005/01/25 16:12:45 markwest Exp $
+// $Id: function.pnmodavailable.php,v 1.1.2.2.2.1 2005/10/03 09:54:50 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -30,7 +30,7 @@
  *
  * @package      Xanthia_Templating_Environment
  * @subpackage   pnRender
- * @version      $Id: function.pnmodavailable.php,v 1.1.2.2 2005/01/25 16:12:45 markwest Exp $
+ * @version      $Id: function.pnmodavailable.php,v 1.1.2.2.2.1 2005/10/03 09:54:50 markwest Exp $
  * @author       Michael Nagy
  * @license      http://www.gnu.org/copyleft/gpl.html GNU General Public License
  */ 
@@ -66,7 +66,11 @@
     extract($params); 
 	unset($params);
 
-	$result = pnModAvailable($mod);
+	// minor backwards compatability fix
+	if (isset($mod)) {
+		$modname = $mod;
+	}
+	$result = pnModAvailable($modname);
     if(isset($assign))  {
 		$smarty->assign($assign, $result);
 	} else {
diff -ruN 0.761/modules/Polls/admin.php 0.762/modules/Polls/admin.php
--- 0.761/modules/Polls/admin.php	2005-02-04 00:30:30.000000000 -0600
+++ 0.762/modules/Polls/admin.php	2006-01-12 08:29:40.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: admin.php,v 1.3 2005/02/04 06:30:30 jorg Exp $
+// File: $Id: admin.php,v 1.4 2006/01/12 14:29:40 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -371,6 +371,12 @@
 
     include ('header.php');
 
+    if (!pnSecAuthAction(0, 'Polls::', '::', ACCESS_ADMIN)) {
+		    echo _POLLSNOAUTH;
+		    include 'footer.php';
+		    return;
+    }
+   
     // prepare vars
     $sel_pollcomm['0'] = '';
     $sel_pollcomm['1'] = '';
@@ -398,6 +404,13 @@
 
 function polls_admin_setConfig($var)
 {
+    if (!pnSecAuthAction(0, 'Polls::', '::', ACCESS_ADMIN)) {
+		    include 'header.php';
+		    echo _POLLSNOAUTH;
+		    include 'footer.php';
+		    return;
+    }
+   
     if (!pnSecConfirmAuthKey()) {
         include 'header.php';
         echo _BADAUTHKEY;
@@ -428,9 +441,9 @@
 function polls_admin_main($var)
 {
     if (!pnSecAuthAction(0, 'Polls::', '::', ACCESS_ADMIN)) {
-		include 'header.php';
-		echo _POLLSNOAUTH;
-		include 'footer.php';
+		    include 'header.php';
+		    echo _POLLSNOAUTH;
+		    include 'footer.php';
     } else {
     	$op = pnVarCleanFromInput('op');
         switch($op) {
diff -ruN 0.761/modules/Polls/comments.php 0.762/modules/Polls/comments.php
--- 0.761/modules/Polls/comments.php	2005-07-23 08:52:06.000000000 -0500
+++ 0.762/modules/Polls/comments.php	2006-01-14 08:32:02.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: comments.php,v 1.15 2005/07/23 13:52:06 dabase Exp $
+// $Id: comments.php,v 1.16 2006/01/14 14:32:02 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -551,7 +551,7 @@
 			}
 			echo '</div>';
 			DisplayKids($tid, $mode, $order, $thold, $level);
-			if($hr) echo "<hr />";
+            if($hr) echo "<hr />";
 			echo "";
 			$count_times += 1;
 		}
@@ -691,8 +691,10 @@
     $AllowableHTML = pnConfigGetVar('AllowableHTML');
     $anonymous = pnConfigGetVar('anonymous');
 
-    $subject = stripslashes($subject);
-    $comment = stripslashes($comment);
+    list($subject, $comment) = pnVarCleanFromInput('subject','comment');
+    //$subject = stripslashes($subject);
+    //$comment = stripslashes($comment);
+
     if (!isset($pid) || !isset($pollID)) {
         echo _NOTRIGHT;
         exit();
@@ -728,9 +730,9 @@
         echo $anonymous;
     }
     echo "<br /><h2>"._SUBJECT.":</h2><br />"
-        ."<input type=\"text\" name=\"subject\" size=\"50\" maxlength=\"85\" value=\"$subject\"><br />"
+        ."<input type=\"text\" name=\"subject\" size=\"50\" maxlength=\"85\" value=\"".pnVarPrepForDisplay($subject)."\"><br />"
         .'<h2>'._COMMENT.":</h2><br />"
-        ."<textarea cols=\"80\" rows=\"10\" name=\"comment\">$comment</textarea><br />";
+        ."<textarea cols=\"80\" rows=\"10\" name=\"comment\">".pnVarPrepForDisplay($comment)."</textarea><br />";
         echo _ALLOWEDHTML.'<br />';
         while (list($key, $access, ) = each($AllowableHTML)) {
             if ($access > 0) echo " &lt;".$key."&gt;";
@@ -803,7 +805,7 @@
         $result =& $dbconn->Execute("SELECT COUNT(*)
                                FROM $pntable[pollcomments]
                                WHERE ($column[score]=-1)
-                                 AND ($column[name]='" . pnUserGetVar('uname') . "'
+                                 AND ($column[name]='" . pnVarPrepForStore(pnUserGetVar('uname')) . "'
                                  AND (to_days(now()) - to_days($column[date]) < 3)");
 
         list($troll) = $result->fields;
diff -ruN 0.761/modules/Quotes/pnadmin.php 0.762/modules/Quotes/pnadmin.php
--- 0.761/modules/Quotes/pnadmin.php	2005-02-04 00:35:40.000000000 -0600
+++ 0.762/modules/Quotes/pnadmin.php	2006-01-12 07:40:37.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: pnadmin.php,v 1.29 2005/02/04 06:35:40 jorg Exp $
+// File: $Id: pnadmin.php,v 1.29.2.1 2006/01/12 13:40:37 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -70,6 +70,12 @@
  */
 function quotes_admin_new()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Quotes::', '::', ACCESS_ADD)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
 	$pnRender =& new pnRender('Quotes');
@@ -77,12 +83,6 @@
 	// As Admin output changes often, we do not want caching.
 	$pnRender->caching = false;
 
-    // Security check - important to do this as early as possible to avoid
-    // potential security holes or just too much wasted processing
-    if (!pnSecAuthAction(0, 'Quotes::', '::', ACCESS_ADD)) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     // Return the output that has been generated by this function
     return $pnRender->fetch('quotes_admin_new.htm');
 
@@ -153,6 +153,11 @@
  */
 function quotes_admin_view()
 {
+    // Security check
+    if(!(pnSecAuthAction(0, 'Quotes::', '::', ACCESS_EDIT))) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
@@ -166,10 +171,6 @@
 	// As Admin output changes often, we do not want caching.
 	$pnRender->caching = false;
 
-    if(!(pnSecAuthAction(0, 'Quotes::', '::', ACCESS_READ))) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     // The user API function is called.  This takes the number of items
     // required and the first number in the list of all items, which we
     // obtained from the input and gets us the information on the appropriate
@@ -506,6 +507,12 @@
  */
 function Quotes_admin_modifyconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Quotes::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
 	$pnRender =& new pnRender('Quotes');
@@ -513,13 +520,6 @@
 	// As Admin output changes often, we do not want caching.
 	$pnRender->caching = false;
 
-    // Security check - important to do this as early as possible to avoid
-    // potential security holes or just too much wasted processing
-
-    if (!pnSecAuthAction(0, 'Quotes::', '::', ACCESS_ADMIN)) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     // Number of items to display per page
     $pnRender->assign(pnModGetVar('Quotes'));
 
@@ -534,11 +534,11 @@
  */
 function Quotes_admin_updateconfig()
 {
-    // Get parameters from whatever input we need.  All arguments to this
-    // function should be obtained from pnVarCleanFromInput(), getting them
-    // from other places such as the environment is not allowed, as that makes
-    // assumptions that will not hold in future versions of PostNuke
-    $itemsperpage = pnVarCleanFromInput('itemsperpage');
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'Quotes::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
 
     // Confirm authorisation code.  This checks that the form had a valid
     // authorisation code attached to it.  If it did not then the function will
@@ -550,6 +550,12 @@
         return true;
     }
 
+    // Get parameters from whatever input we need.  All arguments to this
+    // function should be obtained from pnVarCleanFromInput(), getting them
+    // from other places such as the environment is not allowed, as that makes
+    // assumptions that will not hold in future versions of PostNuke
+    $itemsperpage = pnVarCleanFromInput('itemsperpage');
+
     // Update module variables.  Note that depending on the HTML structure used
     // to obtain the information from the user it is possible that the values
     // might be unset, so it is important to check them all and assign them
@@ -581,6 +587,18 @@
  */
 function quotes_admin_search()
 {
+    // Security check
+    if(!(pnSecAuthAction(0, 'Quotes::', '::', ACCESS_EDIT))) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
+    // Get parameters from whatever input we need.  All arguments to this
+    // function should be obtained from pnVarCleanFromInput(), getting them
+    // from other places such as the environment is not allowed, as that makes
+    // assumptions that will not hold in future versions of PostNuke
+    $itemsperpage = pnVarCleanFromInput('itemsperpage');
+
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
diff -ruN 0.761/modules/Ratings/pnadmin.php 0.762/modules/Ratings/pnadmin.php
--- 0.761/modules/Ratings/pnadmin.php	2005-01-10 09:25:04.000000000 -0600
+++ 0.762/modules/Ratings/pnadmin.php	2006-01-12 07:42:45.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.19 2005/01/10 15:25:04 markwest Exp $
+// $Id: pnadmin.php,v 1.19.2.1 2006/01/12 13:42:45 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -41,7 +41,7 @@
 function ratings_admin_main()
 {
     // Security check
-    if (!pnSecAuthAction(0, 'Ratings::', '::', ACCESS_DELETE)) {
+    if (!pnSecAuthAction(0, 'Ratings::', '::', ACCESS_ADMIN)) {
         return pnVarPrepHTMLDisplay(_MODULENOAUTH);
     }
 
@@ -63,6 +63,11 @@
  */
 function ratings_admin_modifyconfig()
 {
+    // Security check
+    if (!pnSecAuthAction(0, 'Ratings::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Create output object - this object will store all of our output so that
     // we can return it easily when required
 	$pnRender =& new pnRender('Ratings');
@@ -70,11 +75,6 @@
 	// As Admin output changes often, we do not want caching.
 	$pnRender->caching = false;
 
-    // Security check
-    if (!pnSecAuthAction(0, 'Ratings::', '::', ACCESS_ADMIN)) {
-        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
-    }
-
     $pnRender->assign('defaultstylevalues', array('percentage' => _RATINGSPERCENTAGE,
                                             'outoffive' => _RATINGSOUTOFFIVE,
                                             'outoffivestars' => _RATINGSOUTOFFIVESTARS,
@@ -102,6 +102,11 @@
  */
 function ratings_admin_updateconfig()
 {
+    // Security check
+    if (!pnSecAuthAction(0, 'Ratings::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters
     list($style,
          $seclevel) = pnVarCleanFromInput('style',
diff -ruN 0.761/modules/Ratings/pninit.php 0.762/modules/Ratings/pninit.php
--- 0.761/modules/Ratings/pninit.php	2005-03-15 03:39:04.000000000 -0600
+++ 0.762/modules/Ratings/pninit.php	2006-02-03 03:28:10.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pninit.php,v 1.17 2005/03/15 09:39:04 markwest Exp $
+// $Id: pninit.php,v 1.17.2.1 2006/02/03 09:28:10 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -62,7 +62,7 @@
             pn_module C(32)  NOTNULL DEFAULT '',
             pn_itemid C(64)  NOTNULL DEFAULT '',
             pn_ratingtype C(64)  NOTNULL DEFAULT '',
-            pn_rating F(3.5)  NOTNULL DEFAULT '0',
+            pn_rating F(8.5)  NOTNULL DEFAULT '0',
             pn_numratings I(5) NOTNULL DEFAULT '1'
 		   ";
 
@@ -149,7 +149,7 @@
             $ratingstable = $pntable['ratings'];
             $ratingscolumn = &$pntable['ratings_column'];
             $sql = "ALTER TABLE $ratingstable
-                    CHANGE $ratingscolumn[rating] $ratingscolumn[rating] double(3,5) NOT NULL default 0";
+                    CHANGE $ratingscolumn[rating] $ratingscolumn[rating] double(8,5) NOT NULL default 0";
             $dbconn->Execute($sql);
 
             // Check database result
diff -ruN 0.761/modules/Ratings/pnuser.php 0.762/modules/Ratings/pnuser.php
--- 0.761/modules/Ratings/pnuser.php	2005-06-03 04:21:49.000000000 -0500
+++ 0.762/modules/Ratings/pnuser.php	2006-02-03 06:21:53.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnuser.php,v 1.27 2005/06/03 09:21:49 markwest Exp $
+// $Id: pnuser.php,v 1.27.2.1 2006/02/03 12:21:53 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -49,7 +49,6 @@
  * @param $args['objectid'] ID of the item this rating is for
  * @param $args['extrainfo'] URL to return to if user chooses to rate
  * @param $args['style'] style to display this rating in (optional)
- * @param $args['ratingtype'] specific type of rating for this item (optional)
  * @return string output with rating information
  */
 function ratings_user_display($args)
@@ -59,9 +58,6 @@
     if (!isset($style)) {
         $style = pnModGetVar('Ratings', 'defaultstyle');
     }
-    if (!isset($ratingtype)) {
-        $ratingtype = 'default';
-    }
 
 	// work out the return url
 	if (is_array($extrainfo)) {
@@ -138,7 +134,6 @@
 
     // Multiple rate check
     $seclevel = pnModGetVar('Ratings', 'seclevel');
-    $modname = pnModGetName();
 	
     if ($seclevel == 'high') {
         // Database information
@@ -157,7 +152,7 @@
                 FROM $ratingslogtable
                 WHERE ( $ratingslogcolumn[id] = '" . pnVarPrepForStore($logid) . "'
                    OR $ratingslogcolumn[id] = '" . pnVarPrepForStore($logip) . "' )
-                  AND $ratingslogcolumn[ratingid] = '" . $modname . $objectid . $ratingtype . "'";
+                  AND $ratingslogcolumn[ratingid] = '" . $args['modname'] . $objectid . $style . "'";
         $result =& $dbconn->Execute($sql);
         if (!$result->EOF) {
             $result->Close();
@@ -165,17 +160,18 @@
         }
     } elseif ($seclevel == 'medium') {
         // Check against session to see if user has voted recently
-        if (pnSessionGetVar("Rated$modname$ratingtype$objectid")) {
+        if (pnSessionGetVar("Rated$args[modname]$style$objectid")) {
             return $pnRender->fetch('ratings_user_display.htm');
         }
     } 
+
     // No check for low
     // This user hasn't rated this yet, ask them
     $pnRender->assign('showratingform', 1);
     $pnRender->assign('returnurl', $returnurl);
-    $pnRender->assign('modname', $modname);
+    $pnRender->assign('modname', $args['modname']);
     $pnRender->assign('objectid', $objectid);
-    $pnRender->assign('ratingtype', $ratingtype);
+    $pnRender->assign('ratingtype', $style);
 	$pnRender->assign('permission', $permission);
 
     return $pnRender->fetch('ratings_user_display.htm');
@@ -222,7 +218,7 @@
                                     'ratingtype' => $ratingtype,
                                     'rating'     => $rating));
 
-    if (isset($newrating)) {
+    if ($newrating) {
         // Success
         pnSessionSetVar('statusmsg', _THANKYOUFORRATING);
     }
diff -ruN 0.761/modules/Reviews/index.php 0.762/modules/Reviews/index.php
--- 0.761/modules/Reviews/index.php	2005-07-25 15:45:19.000000000 -0500
+++ 0.762/modules/Reviews/index.php	2006-01-05 07:02:18.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: index.php,v 1.51 2005/07/25 20:45:19 markwest Exp $
+// $Id: index.php,v 1.52 2006/01/05 13:02:18 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -526,8 +526,8 @@
     $column = &$pntable['reviews_main_column'];
     $result =& $dbconn->Execute("SELECT $column[title], $column[description] FROM $pntable[reviews_main]");
     list($title, $description) = $result->fields;
-    echo "<h2>$title</h2>";
-	echo "<div style=\"text-align:center\">$description</div>";
+    echo "<h2>" . pnVarPrepForDisplay($title) . "</h2>";
+	echo "<div style=\"text-align:center\">" . pnVarPrepHTMLDisplay($description) . "</div>";
     alpha();
     echo "<table border=\"0\" width=\"95%\" cellpadding=\"2\" cellspacing=\"4\">";
     echo "<tr><td style=\"width:50%;background-color:$GLOBALS[bgcolor2]\"><strong>"._10MOSTPOP."</strong></td>";
@@ -602,7 +602,7 @@
 	}
         $hits=$hitsb[$x];
         if (pnSecAuthAction(0, 'Reviews::', "$title::$id", ACCESS_READ)) {
-            echo "<td style=\"width:50%;background-color:$GLOBALS[bgcolor4]\">$y) <a href=\"index.php?name=$GLOBALS[ModName]&amp;req=showcontent&amp;id=$id\">$title</a></td>";
+            echo "<td style=\"width:50%;background-color:$GLOBALS[bgcolor4]\">$y) <a href=\"index.php?name=$GLOBALS[ModName]&amp;req=showcontent&amp;id=$id\">" . pnVarPrepForDisplay($title) . "</a></td>";
         } else {
             echo "<td style=\"width:50%;background-color:$GLOBALS[bgcolor4]\">$y)</td>";
         }
diff -ruN 0.761/modules/RSS/pnadmin.php 0.762/modules/RSS/pnadmin.php
--- 0.761/modules/RSS/pnadmin.php	2005-01-10 09:29:57.000000000 -0600
+++ 0.762/modules/RSS/pnadmin.php	2006-01-12 07:47:57.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadmin.php,v 1.16 2005/01/10 15:29:57 markwest Exp $
+// $Id: pnadmin.php,v 1.16.2.1 2006/01/12 13:47:57 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -448,12 +448,6 @@
  */
 function RSS_admin_view()
 {
-    // Get parameters from whatever input we need.  All arguments to this
-    // function should be obtained from pnVarCleanFromInput(), getting them
-    // from other places such as the environment is not allowed, as that makes
-    // assumptions that will not hold in future versions of PostNuke
-    $startnum = pnVarCleanFromInput('startnum');
-
     // Security check - important to do this as early as possible to avoid
     // potential security holes or just too much wasted processing.  However,
     // in this case we had to wait until we could obtain the item name to
@@ -463,6 +457,12 @@
         return pnVarPrepHTMLDisplay(_MODULENOAUTH);
     }
 
+    // Get parameters from whatever input we need.  All arguments to this
+    // function should be obtained from pnVarCleanFromInput(), getting them
+    // from other places such as the environment is not allowed, as that makes
+    // assumptions that will not hold in future versions of PostNuke
+    $startnum = pnVarCleanFromInput('startnum');
+
     // The user API function is called.  This takes the url of items
     // required and the first url in the list of all items, which we
     // obtained from the input and gets us the information on the appropriate
@@ -569,6 +569,12 @@
  */
 function RSS_admin_updateconfig()
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing
+    if (!pnSecAuthAction(0, 'RSS::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_MODULENOAUTH);
+    }
+
     // Get parameters from whatever input we need.  All arguments to this
     // function should be obtained from pnVarCleanFromInput(), getting them
     // from other places such as the environment is not allowed, as that makes
diff -ruN 0.761/modules/RSS/pnincludes/extlib/Snoopy.class.inc 0.762/modules/RSS/pnincludes/extlib/Snoopy.class.inc
--- 0.761/modules/RSS/pnincludes/extlib/Snoopy.class.inc	2004-06-02 08:06:25.000000000 -0500
+++ 0.762/modules/RSS/pnincludes/extlib/Snoopy.class.inc	2005-10-26 10:43:46.000000000 -0500
@@ -5,7 +5,7 @@
 Snoopy - the PHP net client
 Author: Monte Ohrt <monte@ispi.net>
 Copyright (c): 1999-2000 ispi, all rights reserved
-Version: 1.0
+Version: 1.01
 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -31,7 +31,7 @@
 Lincoln, NE 68510
 
 The latest version of Snoopy can be obtained from:
-http://snoopy.sourceforge.com
+http://snoopy.sourceforge.net/
 
 *************************************************/
 
@@ -45,7 +45,10 @@
 	var $port			=	80;					// port we are connecting to
 	var $proxy_host		=	"";					// proxy host to use
 	var $proxy_port		=	"";					// proxy port to use
-	var $agent			=	"Snoopy v1.0";		// agent we masquerade as
+	var $proxy_user		=	"";					// proxy user to use
+	var $proxy_pass		=	"";					// proxy password to use
+	
+	var $agent			=	"Snoopy v1.01";		// agent we masquerade as
 	var	$referer		=	"";					// referer info to pass
 	var $cookies		=	array();			// array of cookies to pass
 												// $cookies["username"]="joe";
@@ -58,7 +61,7 @@
 	var $maxframes		=	0;					// frame content depth maximum. 0 = disallow
 	var $expandlinks	=	true;				// expand links to fully qualified URLs.
 												// this only applies to fetchlinks()
-												// or submitlinks()
+												// submitlinks(), and submittext()
 	var $passcookies	=	true;				// pass set cookies back through redirects
 												// NOTE: this currently does not respect
 												// dates, domains or paths.
@@ -80,8 +83,12 @@
 												// set to 0 to disallow timeouts
 	var $timed_out		=	false;				// if a read operation timed out
 	var	$status			=	0;					// http request status
-	
-	var	$curl_path		=	"/usr/bin/curl";
+
+	var $temp_dir		=	"/tmp";				// temporary directory that the webserver
+												// has permission to write to.
+												// under Windows, this should be C:\temp
+
+	var	$curl_path		=	"/usr/local/bin/curl";
 												// Snoopy will use cURL for fetching
 												// SSL content if a full system path to
 												// the cURL binary is supplied here.
@@ -93,9 +100,6 @@
 												// as these functions are not stable
 												// as of this Snoopy release.
 	
-	// send Accept-encoding: gzip?
-	var $use_gzip		= true;	
-	
 	/**** Private variables ****/	
 	
 	var	$_maxlinelen	=	4096;				// max line length (headers)
@@ -131,6 +135,10 @@
 			$this->user = $URI_PARTS["user"];
 		if (!empty($URI_PARTS["pass"]))
 			$this->pass = $URI_PARTS["pass"];
+		if (empty($URI_PARTS["query"]))
+			$URI_PARTS["query"] = '';
+		if (empty($URI_PARTS["path"]))
+			$URI_PARTS["path"] = '';
 				
 		switch($URI_PARTS["scheme"])
 		{
@@ -147,7 +155,7 @@
 					}
 					else
 					{
-						$path = $URI_PARTS["path"].(isset($URI_PARTS["query"]) ? "?".$URI_PARTS["query"] : "");
+						$path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
 						// no proxy, send only the path
 						$this->_httprequest($path, $fp, $URI, $this->_httpmethod);
 					}
@@ -194,10 +202,11 @@
 				return true;					
 				break;
 			case "https":
-				if(!$this->curl_path || (!is_executable($this->curl_path))) {
-					$this->error = "Bad curl ($this->curl_path), can't fetch HTTPS \n";
+				if(!$this->curl_path)
 					return false;
-				}
+				if(function_exists("is_executable"))
+				    if (!is_executable($this->curl_path))
+				        return false;
 				$this->host = $URI_PARTS["host"];
 				if(!empty($URI_PARTS["port"]))
 					$this->port = $URI_PARTS["port"];
@@ -256,7 +265,346 @@
 		return true;
 	}
 
+/*======================================================================*\
+	Function:	submit
+	Purpose:	submit an http form
+	Input:		$URI	the location to post the data
+				$formvars	the formvars to use.
+					format: $formvars["var"] = "val";
+				$formfiles  an array of files to submit
+					format: $formfiles["var"] = "/dir/filename.ext";
+	Output:		$this->results	the text output from the post
+\*======================================================================*/
+
+	function submit($URI, $formvars="", $formfiles="")
+	{
+		unset($postdata);
+		
+		$postdata = $this->_prepare_post_body($formvars, $formfiles);
+			
+		$URI_PARTS = parse_url($URI);
+		if (!empty($URI_PARTS["user"]))
+			$this->user = $URI_PARTS["user"];
+		if (!empty($URI_PARTS["pass"]))
+			$this->pass = $URI_PARTS["pass"];
+		if (empty($URI_PARTS["query"]))
+			$URI_PARTS["query"] = '';
+		if (empty($URI_PARTS["path"]))
+			$URI_PARTS["path"] = '';
+
+		switch($URI_PARTS["scheme"])
+		{
+			case "http":
+				$this->host = $URI_PARTS["host"];
+				if(!empty($URI_PARTS["port"]))
+					$this->port = $URI_PARTS["port"];
+				if($this->_connect($fp))
+				{
+					if($this->_isproxy)
+					{
+						// using proxy, send entire URI
+						$this->_httprequest($URI,$fp,$URI,$this->_submit_method,$this->_submit_type,$postdata);
+					}
+					else
+					{
+						$path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
+						// no proxy, send only the path
+						$this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata);
+					}
+					
+					$this->_disconnect($fp);
+
+					if($this->_redirectaddr)
+					{
+						/* url was redirected, check if we've hit the max depth */
+						if($this->maxredirs > $this->_redirectdepth)
+						{						
+							if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr))
+								$this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PARTS["host"]);						
+							
+							// only follow redirect if it's on this site, or offsiteok is true
+							if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
+							{
+								/* follow the redirect */
+								$this->_redirectdepth++;
+								$this->lastredirectaddr=$this->_redirectaddr;
+								if( strpos( $this->_redirectaddr, "?" ) > 0 )
+									$this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get
+								else
+									$this->submit($this->_redirectaddr,$formvars, $formfiles);
+							}
+						}
+					}
+
+					if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
+					{
+						$frameurls = $this->_frameurls;
+						$this->_frameurls = array();
+						
+						while(list(,$frameurl) = each($frameurls))
+						{														
+							if($this->_framedepth < $this->maxframes)
+							{
+								$this->fetch($frameurl);
+								$this->_framedepth++;
+							}
+							else
+								break;
+						}
+					}					
+					
+				}
+				else
+				{
+					return false;
+				}
+				return true;					
+				break;
+			case "https":
+				if(!$this->curl_path)
+					return false;
+				if(function_exists("is_executable"))
+				    if (!is_executable($this->curl_path))
+				        return false;
+				$this->host = $URI_PARTS["host"];
+				if(!empty($URI_PARTS["port"]))
+					$this->port = $URI_PARTS["port"];
+				if($this->_isproxy)
+				{
+					// using proxy, send entire URI
+					$this->_httpsrequest($URI, $URI, $this->_submit_method, $this->_submit_type, $postdata);
+				}
+				else
+				{
+					$path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
+					// no proxy, send only the path
+					$this->_httpsrequest($path, $URI, $this->_submit_method, $this->_submit_type, $postdata);
+				}
+
+				if($this->_redirectaddr)
+				{
+					/* url was redirected, check if we've hit the max depth */
+					if($this->maxredirs > $this->_redirectdepth)
+					{						
+						if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr))
+							$this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PARTS["host"]);						
+
+						// only follow redirect if it's on this site, or offsiteok is true
+						if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
+						{
+							/* follow the redirect */
+							$this->_redirectdepth++;
+							$this->lastredirectaddr=$this->_redirectaddr;
+							if( strpos( $this->_redirectaddr, "?" ) > 0 )
+								$this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get
+							else
+								$this->submit($this->_redirectaddr,$formvars, $formfiles);
+						}
+					}
+				}
 
+				if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
+				{
+					$frameurls = $this->_frameurls;
+					$this->_frameurls = array();
+
+					while(list(,$frameurl) = each($frameurls))
+					{														
+						if($this->_framedepth < $this->maxframes)
+						{
+							$this->fetch($frameurl);
+							$this->_framedepth++;
+						}
+						else
+							break;
+					}
+				}					
+				return true;					
+				break;
+				
+			default:
+				// not a valid protocol
+				$this->error	=	'Invalid protocol "'.$URI_PARTS["scheme"].'"\n';
+				return false;
+				break;
+		}		
+		return true;
+	}
+
+/*======================================================================*\
+	Function:	fetchlinks
+	Purpose:	fetch the links from a web page
+	Input:		$URI	where you are fetching from
+	Output:		$this->results	an array of the URLs
+\*======================================================================*/
+
+	function fetchlinks($URI)
+	{
+		if ($this->fetch($URI))
+		{			
+			if($this->lastredirectaddr)
+				$URI = $this->lastredirectaddr;
+			if(is_array($this->results))
+			{
+				for($x=0;$x<count($this->results);$x++)
+					$this->results[$x] = $this->_striplinks($this->results[$x]);
+			}
+			else
+				$this->results = $this->_striplinks($this->results);
+
+			if($this->expandlinks)
+				$this->results = $this->_expandlinks($this->results, $URI);
+			return true;
+		}
+		else
+			return false;
+	}
+
+/*======================================================================*\
+	Function:	fetchform
+	Purpose:	fetch the form elements from a web page
+	Input:		$URI	where you are fetching from
+	Output:		$this->results	the resulting html form
+\*======================================================================*/
+
+	function fetchform($URI)
+	{
+		
+		if ($this->fetch($URI))
+		{			
+
+			if(is_array($this->results))
+			{
+				for($x=0;$x<count($this->results);$x++)
+					$this->results[$x] = $this->_stripform($this->results[$x]);
+			}
+			else
+				$this->results = $this->_stripform($this->results);
+			
+			return true;
+		}
+		else
+			return false;
+	}
+	
+	
+/*======================================================================*\
+	Function:	fetchtext
+	Purpose:	fetch the text from a web page, stripping the links
+	Input:		$URI	where you are fetching from
+	Output:		$this->results	the text from the web page
+\*======================================================================*/
+
+	function fetchtext($URI)
+	{
+		if($this->fetch($URI))
+		{			
+			if(is_array($this->results))
+			{
+				for($x=0;$x<count($this->results);$x++)
+					$this->results[$x] = $this->_striptext($this->results[$x]);
+			}
+			else
+				$this->results = $this->_striptext($this->results);
+			return true;
+		}
+		else
+			return false;
+	}
+
+/*======================================================================*\
+	Function:	submitlinks
+	Purpose:	grab links from a form submission
+	Input:		$URI	where you are submitting from
+	Output:		$this->results	an array of the links from the post
+\*======================================================================*/
+
+	function submitlinks($URI, $formvars="", $formfiles="")
+	{
+		if($this->submit($URI,$formvars, $formfiles))
+		{			
+			if($this->lastredirectaddr)
+				$URI = $this->lastredirectaddr;
+			if(is_array($this->results))
+			{
+				for($x=0;$x<count($this->results);$x++)
+				{
+					$this->results[$x] = $this->_striplinks($this->results[$x]);
+					if($this->expandlinks)
+						$this->results[$x] = $this->_expandlinks($this->results[$x],$URI);
+				}
+			}
+			else
+			{
+				$this->results = $this->_striplinks($this->results);
+				if($this->expandlinks)
+					$this->results = $this->_expandlinks($this->results,$URI);
+			}
+			return true;
+		}
+		else
+			return false;
+	}
+
+/*======================================================================*\
+	Function:	submittext
+	Purpose:	grab text from a form submission
+	Input:		$URI	where you are submitting from
+	Output:		$this->results	the text from the web page
+\*======================================================================*/
+
+	function submittext($URI, $formvars = "", $formfiles = "")
+	{
+		if($this->submit($URI,$formvars, $formfiles))
+		{			
+			if($this->lastredirectaddr)
+				$URI = $this->lastredirectaddr;
+			if(is_array($this->results))
+			{
+				for($x=0;$x<count($this->results);$x++)
+				{
+					$this->results[$x] = $this->_striptext($this->results[$x]);
+					if($this->expandlinks)
+						$this->results[$x] = $this->_expandlinks($this->results[$x],$URI);
+				}
+			}
+			else
+			{
+				$this->results = $this->_striptext($this->results);
+				if($this->expandlinks)
+					$this->results = $this->_expandlinks($this->results,$URI);
+			}
+			return true;
+		}
+		else
+			return false;
+	}
+
+	
+
+/*======================================================================*\
+	Function:	set_submit_multipart
+	Purpose:	Set the form submission content type to
+				multipart/form-data
+\*======================================================================*/
+	function set_submit_multipart()
+	{
+		$this->_submit_type = "multipart/form-data";
+	}
+
+	
+/*======================================================================*\
+	Function:	set_submit_normal
+	Purpose:	Set the form submission content type to
+				application/x-www-form-urlencoded
+\*======================================================================*/
+	function set_submit_normal()
+	{
+		$this->_submit_type = "application/x-www-form-urlencoded";
+	}
+
+	
+	
 
 /*======================================================================*\
 	Private functions
@@ -272,7 +620,7 @@
 
 	function _striplinks($document)
 	{	
-		preg_match_all("'<\s*a\s+.*href\s*=\s*			# find <a href=
+		preg_match_all("'<\s*a\s.*?href\s*=\s*			# find <a href=
 						([\"\'])?					# find single or double quote
 						(?(1) (.*?)\\1 | ([^\s\>]+))		# if quote found, match up to next matching
 													# quote, otherwise match up to next space
@@ -334,16 +682,27 @@
 		$search = array("'<script[^>]*?>.*?</script>'si",	// strip out javascript
 						"'<[\/\!]*?[^<>]*?>'si",			// strip out html tags
 						"'([\r\n])[\s]+'",					// strip out white space
-						"'&(quote|#34);'i",					// replace html entities
-						"'&(amp|#38);'i",
-						"'&(lt|#60);'i",
-						"'&(gt|#62);'i",
-						"'&(nbsp|#160);'i",
+						"'&(quot|#34|#034|#x22);'i",		// replace html entities
+						"'&(amp|#38|#038|#x26);'i",			// added hexadecimal values
+						"'&(lt|#60|#060|#x3c);'i",
+						"'&(gt|#62|#062|#x3e);'i",
+						"'&(nbsp|#160|#xa0);'i",
 						"'&(iexcl|#161);'i",
 						"'&(cent|#162);'i",
 						"'&(pound|#163);'i",
-						"'&(copy|#169);'i"
-						);				
+						"'&(copy|#169);'i",
+						"'&(reg|#174);'i",
+						"'&(deg|#176);'i",
+						"'&(#39|#039|#x27);'",
+						"'&(euro|#8364);'i",				// europe
+						"'&a(uml|UML);'",					// german
+						"'&o(uml|UML);'",
+						"'&u(uml|UML);'",
+						"'&A(uml|UML);'",
+						"'&O(uml|UML);'",
+						"'&U(uml|UML);'",
+						"'&szlig;'i",
+						);
 		$replace = array(	"",
 							"",
 							"\\1",
@@ -355,7 +714,19 @@
 							chr(161),
 							chr(162),
 							chr(163),
-							chr(169));
+							chr(169),
+							chr(174),
+							chr(176),
+							chr(39),
+							chr(128),
+							"",
+							"",
+							"",
+							"",
+							"",
+							"",
+							"",
+						);
 					
 		$text = preg_replace($search,$replace,$document);
 								
@@ -376,14 +747,20 @@
 		preg_match("/^[^\?]+/",$URI,$match);
 
 		$match = preg_replace("|/[^\/\.]+\.[^\/\.]+$|","",$match[0]);
+		$match = preg_replace("|/$|","",$match);
+		$match_part = parse_url($match);
+		$match_root =
+		$match_part["scheme"]."://".$match_part["host"];
 				
 		$search = array( 	"|^http://".preg_quote($this->host)."|i",
-							"|^(?!http://)(\/)?(?!mailto:)|i",
+							"|^(\/)|i",
+							"|^(?!http://)(?!mailto:)|i",
 							"|/\./|",
 							"|/[^\/]+/\.\./|"
 						);
 						
 		$replace = array(	"",
+							$match_root."/",
 							$match."/",
 							"/",
 							"/"
@@ -406,6 +783,7 @@
 	
 	function _httprequest($url,$fp,$URI,$http_method,$content_type="",$body="")
 	{
+		$cookie_headers = '';
 		if($this->passcookies && $this->_redirectaddr)
 			$this->setcookies();
 			
@@ -419,21 +797,6 @@
 			$headers .= "Host: ".$this->host."\r\n";
 		if(!empty($this->accept))
 			$headers .= "Accept: ".$this->accept."\r\n";
-		
-		if($this->use_gzip) {
-			// make sure PHP was built with --with-zlib
-			// and we can handle gzipp'ed data
-			if ( function_exists(gzinflate) ) {
-			   $headers .= "Accept-encoding: gzip\r\n";
-			}
-			else {
-			   trigger_error(
-			   	"use_gzip is on, but PHP was built without zlib support.".
-				"  Requesting file(s) without gzip encoding.", 
-				E_USER_NOTICE);
-			}
-		}
-		
 		if(!empty($this->referer))
 			$headers .= "Referer: ".$this->referer."\r\n";
 		if(!empty($this->cookies))
@@ -466,7 +829,12 @@
 		if(!empty($body))	
 			$headers .= "Content-length: ".strlen($body)."\r\n";
 		if(!empty($this->user) || !empty($this->pass))	
-			$headers .= "Authorization: BASIC ".base64_encode($this->user.":".$this->pass)."\r\n";
+			$headers .= "Authorization: Basic ".base64_encode($this->user.":".$this->pass)."\r\n";
+		
+		//add proxy auth headers
+		if(!empty($this->proxy_user))	
+			$headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass)."\r\n";
+
 
 		$headers .= "\r\n";
 		
@@ -479,9 +847,6 @@
 		
 		$this->_redirectaddr = false;
 		unset($this->headers);
-		
-		// content was returned gzip encoded?
-		$is_gzipped = false;
 						
 		while($currentHeader = fgets($fp,$this->_maxlinelen))
 		{
@@ -491,15 +856,14 @@
 				return false;
 			}
 				
-		//	if($currentHeader == "\r\n")
-			if(preg_match("/^\r?\n$/", $currentHeader) )
-			      break;
+			if($currentHeader == "\r\n")
+				break;
 						
 			// if a header begins with Location: or URI:, set the redirect
 			if(preg_match("/^(Location:|URI:)/i",$currentHeader))
 			{
 				// get URL portion of the redirect
-				preg_match("/^(Location:|URI:)\s+(.*)/",chop($currentHeader),$matches);
+				preg_match("/^(Location:|URI:)[ ]+(.*)/",chop($currentHeader),$matches);
 				// look for :// in the Location header to see if hostname is included
 				if(!preg_match("|\:\/\/|",$matches[2]))
 				{
@@ -523,31 +887,19 @@
                 }				
 				$this->response_code = $currentHeader;
 			}
-			
-			if (preg_match("/Content-Encoding: gzip/", $currentHeader) ) {
-				$is_gzipped = true;
-			}
-			
+				
 			$this->headers[] = $currentHeader;
 		}
 
-		# $results = fread($fp, $this->maxlength);
-		$results = "";
-		while ( $data = fread($fp, $this->maxlength) ) {
-		    $results .= $data;
-		    if (
-		        strlen($results) > $this->maxlength ) {
-		        break;
-		    }
-		}
-		
-		// gunzip
-		if ( $is_gzipped ) {
-			// per http://www.php.net/manual/en/function.gzencode.php
-			$results = substr($results, 10);
-			$results = gzinflate($results);
-		}
-		
+		$results = '';
+		do {
+    		$_data = fread($fp, $this->maxlength);
+    		if (strlen($_data) == 0) {
+        		break;
+    		}
+    		$results .= $_data;
+		} while(true);
+
 		if ($this->read_timeout > 0 && $this->_check_timeout($fp))
 		{
 			$this->status=-100;
@@ -556,7 +908,8 @@
 		
 		// check if there is a a redirect meta tag
 		
-		if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]+URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
+		if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
+
 		{
 			$this->_redirectaddr = $this->_expandlinks($match[1],$URI);	
 		}
@@ -640,7 +993,8 @@
 			$headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass);
 			
 		for($curr_header = 0; $curr_header < count($headers); $curr_header++)
-			$cmdline_params .= " -H \"".$headers[$curr_header]."\"";
+			$safer_header = strtr( $headers[$curr_header], "\"", " " );
+			$cmdline_params .= " -H \"".$safer_header."\"";
 		
 		if(!empty($body))
 			$cmdline_params .= " -d \"$body\"";
@@ -648,11 +1002,10 @@
 		if($this->read_timeout > 0)
 			$cmdline_params .= " -m ".$this->read_timeout;
 		
-		$headerfile = uniqid(time());
-		
-		# accept self-signed certs
-		$cmdline_params .= " -k";
-		exec($this->curl_path." -D \"/tmp/$headerfile\"".$cmdline_params." ".$URI,$results,$return);
+		$headerfile = tempnam($temp_dir, "sno");
+
+		$safer_URI = strtr( $URI, "\"", " " ); // strip quotes from the URI to avoid shell access
+		exec($this->curl_path." -D \"$headerfile\"".$cmdline_params." \"".$safer_URI."\"",$results,$return);
 		
 		if($return)
 		{
@@ -663,7 +1016,7 @@
 			
 		$results = implode("\r\n",$results);
 		
-		$result_headers = file("/tmp/$headerfile");
+		$result_headers = file("$headerfile");
 						
 		$this->_redirectaddr = false;
 		unset($this->headers);
@@ -675,7 +1028,7 @@
 			if(preg_match("/^(Location: |URI: )/i",$result_headers[$currentHeader]))
 			{
 				// get URL portion of the redirect
-				preg_match("/^(Location: |URI:)(.*)/",chop($result_headers[$currentHeader]),$matches);
+				preg_match("/^(Location: |URI:)\s+(.*)/",chop($result_headers[$currentHeader]),$matches);
 				// look for :// in the Location header to see if hostname is included
 				if(!preg_match("|\:\/\/|",$matches[2]))
 				{
@@ -692,19 +1045,14 @@
 			}
 		
 			if(preg_match("|^HTTP/|",$result_headers[$currentHeader]))
-			{
-			    $this->response_code = $result_headers[$currentHeader];
-			    if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$this->response_code, $match))
-			    {
-				$this->status= $match[1];
-                	    }
-			}
+				$this->response_code = $result_headers[$currentHeader];
+
 			$this->headers[] = $result_headers[$currentHeader];
 		}
 
 		// check if there is a a redirect meta tag
 		
-		if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]+URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
+		if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
 		{
 			$this->_redirectaddr = $this->_expandlinks($match[1],$URI);	
 		}
@@ -723,7 +1071,7 @@
 		else
 			$this->results = $results;
 
-		unlink("/tmp/$headerfile");
+		unlink("$headerfile");
 		
 		return true;
 	}
@@ -737,8 +1085,8 @@
 	{
 		for($x=0; $x<count($this->headers); $x++)
 		{
-		if(preg_match("/^set-cookie:[\s]+([^=]+)=([^;]+)/i", $this->headers[$x],$match))
-			$this->cookies[$match[1]] = $match[2];
+		if(preg_match('/^set-cookie:[\s]+([^=]+)=([^;]+)/i', $this->headers[$x],$match))
+			$this->cookies[$match[1]] = urldecode($match[2]);
 		}
 	}
 
@@ -772,6 +1120,7 @@
 		if(!empty($this->proxy_host) && !empty($this->proxy_port))
 			{
 				$this->_isproxy = true;
+				
 				$host = $this->proxy_host;
 				$port = $this->proxy_port;
 			}
@@ -837,6 +1186,7 @@
 	{
 		settype($formvars, "array");
 		settype($formfiles, "array");
+		$postdata = '';
 
 		if (count($formvars) == 0 && count($formfiles) == 0)
 			return;
diff -ruN 0.761/modules/RSS/pntemplates/rss_block_displayfeed.htm 0.762/modules/RSS/pntemplates/rss_block_displayfeed.htm
--- 0.761/modules/RSS/pntemplates/rss_block_displayfeed.htm	2005-03-22 06:11:51.000000000 -0600
+++ 0.762/modules/RSS/pntemplates/rss_block_displayfeed.htm	2005-10-19 11:04:37.000000000 -0500
@@ -2,6 +2,6 @@
 	<a href="<!--[$feed->image.link|pnvarprepfordisplay]-->"><img src="<!--[$feed->image.url|pnvarprepfordisplay]-->" alt="<!--[$feed->image.title|pnvarprephtmldisplay]-->" /></a><br /><br />
 <!--[/if]-->
 <!--[section name=rssitems loop=$feed->items max=$numitems]-->  
-    <a href="<!--[$feed->items[rssitems].link|pnvarprepfordisplay]-->" <!--[if $openinnewwindow eq 1]-->target="_blank"<!--[/if]-->><!--[$feed->items[rssitems].title|pnvarprepfordisplay]--></a>
+    <a href="<!--[$feed->items[rssitems].link|pnvarprepfordisplay]-->" <!--[if $openinnewwindow eq 1]-->target="_blank"<!--[/if]-->><!--[$feed->items[rssitems].title|pnvarprephtmldisplay]--></a>
     <hr />
 <!--[/section]-->
\ No newline at end of file
diff -ruN 0.761/modules/RSS/pnuserapi.php 0.762/modules/RSS/pnuserapi.php
--- 0.761/modules/RSS/pnuserapi.php	2005-05-21 12:58:56.000000000 -0500
+++ 0.762/modules/RSS/pnuserapi.php	2005-10-24 10:37:20.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnuserapi.php,v 1.17 2005/05/21 17:58:56 markwest Exp $
+// $Id: pnuserapi.php,v 1.17.2.1 2005/10/24 15:37:20 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -335,7 +335,7 @@
 
 	// define the cache directory
 	if (!defined('MAGPIE_CACHE_DIR')) {
-		define ('MAGPIE_CACHE_DIR', pnVarPrepForOS(pnConfigGetVar('temp')).'/'.pnVarPrepForOS(pnModGetVar('RSS', 'cachedirectory')).'/');
+		define ('MAGPIE_CACHE_DIR', pnConfigGetVar('temp').'/'.pnVarPrepForOS(pnModGetVar('RSS', 'cachedirectory')).'/');
 	}
 
 	// include the Magpie RSS class
diff -ruN 0.761/modules/Sections/admin.php 0.762/modules/Sections/admin.php
--- 0.761/modules/Sections/admin.php	2005-02-04 00:30:34.000000000 -0600
+++ 0.762/modules/Sections/admin.php	2005-11-25 19:20:37.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: admin.php,v 1.39 2005/02/04 06:30:34 jorg Exp $
+// File: $Id: admin.php,v 1.40 2005/11/26 01:20:37 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -343,7 +343,7 @@
         }
         echo '</select>';
         echo "<br /><strong>"._CONTENT.":</strong><br />"
-        ."<textarea name=\"content\" cols=\"80\" rows=\"10\">".pnVarPrepHTMLDisplay($content)."</textarea><br />"
+        ."<textarea name=\"content\" cols=\"80\" rows=\"10\">".pnVarPrepForDisplay($content)."</textarea><br />"
         ."<input type=\"hidden\" name=\"artid\" value=\"$artid\" />"
         ."<input type=\"hidden\" name=\"op\" value=\"secartchange\" />"
         ."<input type=\"hidden\" name=\"module\" value=\"".$GLOBALS['module']."\" />"
diff -ruN 0.761/modules/Sections/index.php 0.762/modules/Sections/index.php
--- 0.761/modules/Sections/index.php	2005-08-05 04:33:46.000000000 -0500
+++ 0.762/modules/Sections/index.php	2006-01-03 03:53:29.000000000 -0600
@@ -1,5 +1,5 @@
 <?php 
-// $Id: index.php,v 1.44 2005/08/05 09:33:46 markwest Exp $ 
+// $Id: index.php,v 1.45 2006/01/03 09:53:29 markwest Exp $ 
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -269,13 +269,13 @@
     echo pnVarPrepHTMLDisplay(pnVarCensor($contentpages[$arrayelement]));
 
     if($page >= $pageno) {
-      $next_page = '';
+        $next_page = '';
     } else {
         $next_pagenumber = $page + 1;
         if ($page != 1) {
             $next_page = '<img src="modules/'.pnVarPrepForOS($GLOBALS['ModName']).'/images/blackpixel.gif" width="10" height="2" alt="" /> &nbsp;&nbsp; ';
         }
-        $next_page = '<a href="index.php?name=Sections&amp;req=viewarticle&amp;artid='.pnVarPrepForDisplay($artid).'&amp;page='.pnVarPrepForDisplay($next_pagenumber).'">'._NEXT
+        $next_page  .= '<a href="index.php?name=Sections&amp;req=viewarticle&amp;artid='.pnVarPrepForDisplay($artid).'&amp;page='.pnVarPrepForDisplay($next_pagenumber).'">'._NEXT
 		            .' ('.pnVarPrepForDisplay($next_pagenumber).'/'.pnVarPrepForDisplay($pageno).')</a> '
 					.'<a href="index.php?name=Sections&amp;req=viewarticle&amp;artid='.pnVarPrepForDisplay($artid).'&amp;page='.pnVarPrepForDisplay($next_pagenumber).'">'
 					.'<img src="modules/'.pnVarPrepForOS($GLOBALS['name']).'/images/right.gif" alt="'._NEXT.'"></a>';
@@ -292,7 +292,7 @@
     echo '<div style="text-align:center;">'
         .$previous_page.' &nbsp;&nbsp; '.$next_page.'<br />'
         .'[ <a href="index.php?name=Sections&amp;req=listarticles&amp;secid='.pnVarPrepForDisplay($secid).'">'._BACKTO.' '.pnVarPrepForDisplay($secname).'</a> | '
-        .'<a href="index.php?name=Sections&amp;listsections">'._SECINDEX.'</a> ]'
+        .'<a href="index.php?name=Sections">'._SECINDEX.'</a> ]'
         .'</div>';
     CloseTable();
     $result->Close();
diff -ruN 0.761/modules/Settings/admin.php 0.762/modules/Settings/admin.php
--- 0.761/modules/Settings/admin.php	2005-08-29 06:43:19.000000000 -0500
+++ 0.762/modules/Settings/admin.php	2006-01-21 14:59:06.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: admin.php,v 1.12 2005/08/29 11:43:19 markwest Exp $
+// File: $Id: admin.php,v 1.16 2006/01/21 20:59:06 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -36,7 +36,7 @@
    if (!(pnSecAuthAction(0, 'Settings::', '::', ACCESS_ADMIN)))
    {
       include 'header.php';
-      echo _SETTINGSNOAUTH;
+      echo 'Access denied';
       include 'footer.php';
    }
 
@@ -54,16 +54,16 @@
         $pnconfig['tipath'] = str_replace(WHERE_IS_PERSO, '', pnConfigGetVar('tipath'));
 
     include 'header.php';
+    if (!(pnSecAuthAction(0, 'Settings::', '::', ACCESS_ADMIN))) {
+        echo _SETTINGSNOAUTH;
+        include 'footer.php';
+        return;
+     }
     GraphicAdmin();
     OpenTable();
     print '<h1>'._SITECONFIG.'</h1>';
     CloseTable();
 
-    if (!(pnSecAuthAction(0, 'Settings::', '::', ACCESS_ADMIN))) {
-        echo _SETTINGSNOAUTH;
-        include 'footer.php';
-        return;
-    }
     // Set the current settings for select fields, radio buttons and checkboxes.
     // Much better then using if() statements all over the place :-)
     $sel_dynkeywords['0'] = '';
@@ -87,6 +87,17 @@
     $sel_themechange['1'] = '';
     $sel_themechange[pnConfigGetVar('theme_change')] = ' checked="checked"';
     $sel_lang[pnConfigGetVar('language')] = ' selected="selected"';
+
+    $sel_multilingual['0'] = '';
+    $sel_multilingual['1'] = '';
+    $sel_multilingual[pnConfigGetVar('multilingual')] = ' checked="checked"';
+    $sel_useflags['0'] = '';
+    $sel_useflags['1'] = '';
+    $sel_useflags[pnConfigGetVar('useflags')] = ' checked="checked"';
+    $sel_langdetect['0'] = '';
+    $sel_langdetect['1'] = '';
+    $sel_langdetect[pnConfigGetVar('language_detect')] = ' checked="checked"';
+  
     $sel_tzoffset[pnConfigGetVar('timezone_offset')] = ' selected="selected"';
     $sel_backendlanguage[pnConfigGetVar('backend_language')] = ' selected="selected"';
     $sel_newspager['0'] = '';
@@ -109,15 +120,15 @@
     $sel_funtext['0'] = '';
     $sel_funtext['1'] = '';
     $sel_funtext[pnConfigGetVar('funtext')] = ' checked="checked"';
-//    $sel_intranet['0'] = '';
-//    $sel_intranet['1'] = '';
     $sel_pnAntiCracker['0'] = '';
     $sel_pnAntiCracker['1'] = '';
     $sel_pnAntiCracker[pnConfigGetVar('pnAntiCracker')] = ' checked="checked"';
+    $sel_safehtml['0'] = '';
+    $sel_safehtml['1'] = '';
+    $sel_safehtml[pnConfigGetVar('safehtml')] = ' checked="checked"';
     $sel_loadlegacy['0'] = '';
     $sel_loadlegacy['1'] = '';
     $sel_loadlegacy[pnConfigGetVar('loadlegacy')] = ' checked="checked"';
-//    $sel_intranet[pnConfigGetVar('intranet')] = ' checked="checked"';
     $sel_seclevel['High'] = '';
     $sel_seclevel['Medium'] = '';
     $sel_seclevel['Low'] = '';
@@ -135,24 +146,7 @@
     $sel_anonsessions['1'] = '';
     $sel_anonsessions[pnConfigGetVar('anonymoussessions')] = ' checked="checked"';
 
-    //
-    // let's pre-create an array of the current times for each TZ
-    //
-    $tzo = 0;
-    $gmt = time() - date('Z');
-    for ($i = -12; $i <= 12; $i++)
-    {
-        $tzstring["tz$tzo"] = strftime(_TIMEBRIEF, $gmt + (3600 * $i));
-        $tzo++;
-    }
-    // some special cases
-    $tzstring['tz8a'] = strftime(_TIMEBRIEF, $gmt - 12600);
-    $tzstring['tz15a'] = strftime(_TIMEBRIEF, $gmt + 12600);
-    $tzstring['tz16a'] = strftime(_TIMEBRIEF, $gmt + 16200);
-    $tzstring['tz17a'] = strftime(_TIMEBRIEF, $gmt + 19800);
-    $tzstring['tz21a'] = strftime(_TIMEBRIEF, $gmt + 34200);
     // done, now on to the form
-
     echo '<form action="admin.php" method="post"><div>';
     OpenTable();
     print '<h2>'._GENSITEINFO.'</h2>'
@@ -214,15 +208,20 @@
         .'<table border="0"><tr><td>'
         ._SELLANGUAGE.":</td><td><select name=\"xlanguage\" size=\"1\">";
     $lang = languagelist();
+    $lang = languagelist();
+    $handle = opendir('language');
     foreach ($lang as $k=>$v) {
-        echo '<option value="'.$k.'"';
-        if (isset($sel_lang[$k])) {
-            echo ' selected="selected"';
+        $osk = pnVarPrepForOS($k);
+        if (is_dir("language/$osk") && (!empty($v))) {
+            echo '<option value="'.$k.'"';
+            if (isset($sel_lang[$k])) {
+                echo ' selected="selected"';
+            }
+            echo '>';
+            echo "[$k] ";
+            echo "$v";
+            echo '</option>' . "\n";
         }
-        echo '>';
-        echo "[$k] ";
-        echo "$v";
-        echo '</option>' . "\n";
     }
     echo "</select>"
         ."</td></tr>"
@@ -243,7 +242,22 @@
     }
 
     echo "</select>"
-        ."</td></tr></table>";
+        ."</td></tr>"
+        
+	    .'<tr><td>'
+	    ._ACTMULTILINGUAL.'</td><td>'
+	    ."<input type=\"radio\" name=\"xmultilingual\" value=\"1\" ".$sel_multilingual['1']." />"._YES.' &nbsp;'
+	    ."<input type=\"radio\" name=\"xmultilingual\" value=\"0\" ".$sel_multilingual['0']." />"._NO
+	    .'</td></tr><tr><td>'
+	    ._ACTUSEFLAGS.'</td><td>'
+	    ."<input type=\"radio\" name=\"xuseflags\" value=\"1\" ".$sel_useflags['1']." />"._YES." &nbsp;"
+	    ."<input type=\"radio\" name=\"xuseflags\" value=\"0\" ".$sel_useflags['0']." />"._NO
+	    .'</td></tr><tr><td>'
+	    ._ACTAUTODETECT.'</td><td>'
+	    ."<input type=\"radio\" name=\"xlanguage_detect\" value=\"1\" ".$sel_langdetect['1']." />"._YES." &nbsp;"
+	    ."<input type=\"radio\" name=\"xlanguage_detect\" value=\"0\" ".$sel_langdetect['0']." />"._NO
+	    .'</td></tr></table>';
+	    
    CloseTable();
    OpenTable();
    print '<h2>'._STARTPAGE.'</h2>'
@@ -443,9 +457,15 @@
     echo '<table><tr><td><strong>' . _HTMLWARNING. '</strong>';
     echo '<br />';
 
-    echo _HTMLALLOWENTITIES .
-         '<input type="radio" name="xhtmlentities" value="1"' . $sel_htmlentities[1]. ' />' . _YES . ' &nbsp;' .
-         '<input type="radio" name="xhtmlentities" value="0"' . $sel_htmlentities[0] . ' />' . _NO;
+    echo '<table><tr><td>'._HTMLALLOWENTITIES .'</td>'.
+         '<td><input type="radio" name="xhtmlentities" value="1"' . $sel_htmlentities[1]. ' />' . _YES . ' &nbsp;' .
+         '<input type="radio" name="xhtmlentities" value="0"' . $sel_htmlentities[0] . ' />' . _NO .'</td>';
+    echo '</tr><tr>';
+
+    echo '<td>'. _HTMLSAFEHTML .'</td>' .
+         '<td><input type="radio" name="xsafehtml" value="1"' . $sel_safehtml[1]. ' />' . _YES . ' &nbsp;' .
+         '<input type="radio" name="xsafehtml" value="0"' . $sel_safehtml[0] . ' />' . _NO .'</td>' .
+         '</tr></table>';
 
     // Finish
     echo '<input type="hidden" name="op" value="generate" />'
@@ -462,7 +482,7 @@
 
     if (!(pnSecAuthAction(0, 'Settings::', '::', ACCESS_ADMIN))) {
         include 'header.php';
-        echo _SETTINGSNOAUTH;
+        echo 'Access denied';
         include 'footer.php';
         return;
     }
diff -ruN 0.761/modules/Settings/lang/eng/global.php 0.762/modules/Settings/lang/eng/global.php
--- 0.761/modules/Settings/lang/eng/global.php	2005-07-09 10:15:31.000000000 -0500
+++ 0.762/modules/Settings/lang/eng/global.php	2006-01-21 15:00:03.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: global.php,v 1.5 2005/07/09 15:15:31 markwest Exp $
+// File: $Id: global.php,v 1.7 2006/01/21 21:00:03 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by The PostNuke Development Team.
@@ -27,6 +27,14 @@
 // Purpose of file: Translation files
 // Translation team: Read credits in /docs/CREDITS.txt
 // ----------------------------------------------------------------------
+
+define('_HTMLSAFEHTML','Enable Safehtml sanitation for output');
+
+// taken from deprecated Languages
+define('_ACTMULTILINGUAL','Activate multilingual features');
+define('_ACTUSEFLAGS','Activate user flags');
+define('_ACTAUTODETECT', 'Auto detect language from browser settings');
+
 define('_ADMINEMAIL','Administrator e-mail address');
 define('_ADMINGRAPHIC','Enable graphics in administration menu');
 define('_ANONYMOUSSESSIONS', 'Use sessions for unregistered users');
diff -ruN 0.761/modules/Submit_News/admin.php 0.762/modules/Submit_News/admin.php
--- 0.761/modules/Submit_News/admin.php	2005-02-04 00:30:36.000000000 -0600
+++ 0.762/modules/Submit_News/admin.php	2006-01-12 08:13:53.000000000 -0600
@@ -1,5 +1,5 @@
 <?PHP
-// File: $Id: admin.php,v 1.16 2005/02/04 06:30:36 jorg Exp $
+// File: $Id: admin.php,v 1.17 2006/01/12 14:13:53 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -31,8 +31,6 @@
     die ('Access Denied');
 }
 
-if (pnSecAuthAction(0, 'Submit News::', '::', ACCESS_ADMIN)) {
-
 modules_get_language();
 modules_get_manual();
 
@@ -40,6 +38,12 @@
 
     include ('header.php');
 
+    if (!pnSecAuthAction(0, 'Submit News::', '::', ACCESS_ADMIN)) {
+        echo 'Access denied';
+        include('footer.php');
+        return;
+    }
+
     // prepare vars
     $sel_notify['0'] = '';
     $sel_notify['1'] = '';
@@ -88,8 +92,9 @@
 {
     if (!pnSecAuthAction(0, 'Submit News::', '::', ACCESS_ADMIN)) {
         include 'header.php';
-        echo _NOAUTH;
+        echo 'Access denied';
         include 'footer.php';
+        return;
     } 
     if (!pnSecConfirmAuthKey()) {
         include 'header.php';
@@ -128,6 +133,13 @@
 	$op = pnVarCleanFromInput('op');
 	extract($var);
 
+  if (!pnSecAuthAction(0, 'Submit News::', '::', ACCESS_ADMIN)) {
+      include 'header.php';
+      echo 'Access denied';
+      include 'footer.php';
+      return;
+  } 
+
 	switch ($op) {
 		case 'getConfig':
 			submit_news_admin_getConfig();
@@ -140,8 +152,4 @@
 			break;
 	}
 }
-
-} else {
-    echo "Access Denied";
-}
 ?>
\ No newline at end of file
diff -ruN 0.761/modules/Submit_News/index.php 0.762/modules/Submit_News/index.php
--- 0.761/modules/Submit_News/index.php	2005-05-18 15:22:38.000000000 -0500
+++ 0.762/modules/Submit_News/index.php	2005-10-21 08:26:02.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: index.php,v 1.51 2005/05/18 20:22:38 landseer Exp $
+// $Id: index.php,v 1.53 2005/10/21 13:26:02 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -60,7 +60,7 @@
 
     OpenTable();
 
-    echo '<form action="index.php?name=Submit_News" method="post"><div>'
+    echo '<form name="news" id="news" action="index.php?name=Submit_News" method="post"><div>'
 	    .'<strong>'._YOURNAME.':</strong> ';
     if (pnUserLoggedIn()) {
         echo '<a href="user.php">' . pnUserGetVar('uname') . '</a>';
@@ -98,11 +98,26 @@
 		echo '<input type="hidden" name="alanguage" value="" />';
 	}
 
+    $bbcode = array('', '');
+    if(pnModIsHooked('pn_bbcode', 'Submit_News') && pnModIsHooked('pn_bbcode', 'AddStory') && pnModIsHooked('pn_bbcode', 'News')) {
+        $bbcode[0] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'articletext'));
+        $bbcode[1] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'extendedtext'));
+    }
+    $bbsmile = array('', '');
+    if(pnModIsHooked('pn_bbsmile', 'Submit_News') && pnModIsHooked('pn_bbsmile', 'AddStory') && pnModIsHooked('pn_bbsmile', 'News')) {
+        pnModAPILoad('pn_bbsmile', 'user');
+        $bbsmile[0] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'articletext'));
+        $bbsmile[1] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'extendedtext'));
+    }
     echo '<br /><strong><label for="articletext">'._ARTICLETEXT.'</label></strong> '
         .'('._HTMLISFINE.')<br />'
         .'<textarea cols="80" rows="10" name="storytext" id="articletext"></textarea> '._REQUIRED.'<br />'
+        . $bbcode[0]
+        . $bbsmile[0]
         .'<br /><strong><label for="extendedtext">'._EXTENDEDTEXT.'</label></strong>'
-        .'<br /><textarea cols="80" rows="10" name="bodytext" id="extendedtext"></textarea><br />';
+        .'<br /><textarea cols="80" rows="10" name="bodytext" id="extendedtext"></textarea><br />'
+        . $bbcode[1]
+        . $bbsmile[1];
 
 	// show pagebreak instructions
 	echo _PAGEBREAK.'<br />';
@@ -233,12 +248,27 @@
 		echo '<input type="hidden" name="language" value="" />';
 	}
 
+    $bbcode = array('', '');
+    if(pnModIsHooked('pn_bbcode', 'Submit_News') && pnModIsHooked('pn_bbcode', 'AddStory') && pnModIsHooked('pn_bbcode', 'News')) {
+        $bbcode[0] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'articletext'));
+        $bbcode[1] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'extendedtext'));
+    }
+    $bbsmile = array('', '');
+    if(pnModIsHooked('pn_bbsmile', 'Submit_News') && pnModIsHooked('pn_bbsmile', 'AddStory') && pnModIsHooked('pn_bbsmile', 'News')) {
+        pnModAPILoad('pn_bbsmile', 'user');
+        $bbsmile[0] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'articletext'));
+        $bbsmile[1] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'extendedtext'));
+    }
     echo"<br /><strong>"._ARTICLETEXT.'</strong> '
         .'('._HTMLISFINE.')<br />'
-        .'<textarea cols="80" rows="10" name="storytext">' . pnVarPrepForDisplay($storytext) . '</textarea> '._REQUIRED.'<br />'
+        .'<textarea cols="80" rows="10" name="storytext" id="articletext">' . pnVarPrepForDisplay($storytext) . '</textarea> '._REQUIRED.'<br />'
+        . $bbcode[0]
+        . $bbsmile[0]
         .'<br /><strong>'._EXTENDEDTEXT.'</strong>'
-        .'<br /><textarea cols="80" rows="10" name="bodytext">' . pnVarPrepForDisplay($bodytext) . '</textarea><br />'
-        .'('._AREYOUSURE.')<br />'
+        .'<br /><textarea cols="80" rows="10" name="bodytext" id="extendedtext">' . pnVarPrepForDisplay($bodytext) . '</textarea>'
+        . $bbcode[1]
+        . $bbsmile[1]
+        .'<br />('._AREYOUSURE.')<br />'
         .'<input type="submit" name="request_preview" value="'._PREVIEW.'"> <input type="submit" name="request_ok" value="'._OK.'" />'
         .'</div></form>';
     CloseTable();
diff -ruN 0.761/modules/Topics/admin.php 0.762/modules/Topics/admin.php
--- 0.761/modules/Topics/admin.php	2005-07-14 16:34:54.000000000 -0500
+++ 0.762/modules/Topics/admin.php	2006-01-12 07:58:00.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: admin.php,v 1.40 2005/07/14 21:34:54 hammerhead Exp $
+// File: $Id: admin.php,v 1.41 2006/01/12 13:58:00 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -601,6 +601,12 @@
 
     include ('header.php');
 
+    if (!pnSecAuthAction(0, 'Topics::', '::', ACCESS_ADMIN)) {
+        echo _TOPICSNOAUTH;
+        include 'footer.php';
+        return;
+    }
+
     // prepare vars
     $sel_topicsinrow['1'] = '';
     $sel_topicsinrow['2'] = '';
@@ -637,6 +643,13 @@
 
 function topics_admin_setConfig($var)
 {
+    if (!pnSecAuthAction(0, 'Topics::', '::', ACCESS_ADMIN)) {
+        include 'header.php';
+        echo _TOPICSNOAUTH;
+        include 'footer.php';
+        return;
+    }
+
     if (!pnSecConfirmAuthKey()) {
         include 'header.php';
         echo _BADAUTHKEY;
@@ -679,6 +692,7 @@
        include 'header.php';
        echo _TOPICSNOAUTH;
        include 'footer.php';
+       return;
    } else {
        switch ($op) {
 
diff -ruN 0.761/modules/Topics/index.php 0.762/modules/Topics/index.php
--- 0.761/modules/Topics/index.php	2005-04-03 16:57:55.000000000 -0500
+++ 0.762/modules/Topics/index.php	2005-12-14 10:01:34.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: index.php,v 1.23 2005/04/03 21:57:55 larsneo Exp $
+// $Id: index.php,v 1.24 2005/12/14 16:01:34 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -83,7 +83,7 @@
 				echo '<a href="index.php?name=News&amp;catid=&amp;topic='. pnVarPrepForDIsplay($topicid).'">';
 				echo '<img src="'. pnVarPrepForDIsplay($tipath.$topicimage).'" alt="'.pnVarPrepForDIsplay($topictext).'" title="'.pnVarPrepForDIsplay($topictext).'" /></a><br />'. "\n";
 			}
-            echo '[ <a href="index.php?name=News&amp;catid=&amp;topic='. pnVarPrepForDIsplay($topicid).'">'.pnVarPrepForDIsplay($topictext).'</a> ]'."\n";
+            echo '[&nbsp;<a href="index.php?name=News&amp;catid=&amp;topic='. pnVarPrepForDIsplay($topicid).'">'.pnVarPrepForDIsplay($topictext).'</a>&nbsp;]'."\n";
             echo '</td>'."\n";
 
             /* Thanks to John Hoffmann from softlinux.org for the next 5 lines ;) */
diff -ruN 0.761/modules/Top_List/admin.php 0.762/modules/Top_List/admin.php
--- 0.761/modules/Top_List/admin.php	2005-02-04 00:30:37.000000000 -0600
+++ 0.762/modules/Top_List/admin.php	2006-01-12 08:07:26.000000000 -0600
@@ -1,5 +1,5 @@
 <?PHP
-// File: $Id: admin.php,v 1.15 2005/02/04 06:30:37 jorg Exp $
+// File: $Id: admin.php,v 1.16 2006/01/12 14:07:26 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -31,8 +31,6 @@
     die ('Access Denied');
 }
 
-if (pnSecAuthAction(0, 'Top List::', '::', ACCESS_ADMIN)) {
-
 modules_get_language();
 modules_get_manual();
 
@@ -40,6 +38,12 @@
 {
     include ('header.php');
 
+    if (!pnSecAuthAction(0, 'Top List::', '::', ACCESS_ADMIN)) {
+        echo "Access Denied";
+        include('footer.php');
+        return;
+    }
+    
     GraphicAdmin();
 
     OpenTable();
@@ -65,6 +69,13 @@
 
 function top_list_admin_setConfig($var)
 {
+    if (!pnSecAuthAction(0, 'Top List::', '::', ACCESS_ADMIN)) {
+        include('header.php');
+        echo "Access Denied";
+        include('footer.php');
+        return;
+    }
+
     if (!pnSecConfirmAuthKey()) {
         include 'header.php';
         echo _BADAUTHKEY;
@@ -98,6 +109,13 @@
 
 function top_list_admin_main($var)
 {
+    if (!pnSecAuthAction(0, 'Top List::', '::', ACCESS_ADMIN)) {
+        include('header.php');
+        echo "Access Denied";
+        include('footer.php');
+        return;
+    }
+
    $op = pnVarCleanFromInput('op');
    extract($var);
 
@@ -117,8 +135,4 @@
    }
 }
 
-} else {
-    echo "Access Denied";
-}
-
 ?>
\ No newline at end of file
diff -ruN 0.761/modules/typetool/pnadmin.php 0.762/modules/typetool/pnadmin.php
--- 0.761/modules/typetool/pnadmin.php	2004-12-15 10:47:44.000000000 -0600
+++ 0.762/modules/typetool/pnadmin.php	2006-01-12 07:53:30.000000000 -0600
@@ -111,6 +111,12 @@
  */
 function typetool_admin_updateconfig($args)
 {
+    // Security check - important to do this as early as possible to avoid
+    // potential security holes or just too much wasted processing.
+    if (!pnSecAuthAction(0, 'typetool::', '::', ACCESS_ADMIN)) {
+        return pnVarPrepHTMLDisplay(_BADAUTHKEY);
+    }
+
     list($tt_enable,
          $tt_language) = pnVarCleanFromInput('tt_enable',
                                               'tt_language');
diff -ruN 0.761/modules/User/admin.php 0.762/modules/User/admin.php
--- 0.761/modules/User/admin.php	2005-08-05 04:04:20.000000000 -0500
+++ 0.762/modules/User/admin.php	2006-01-06 15:03:13.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: admin.php,v 1.32 2005/08/05 09:04:20 larsneo Exp $
+// File: $Id: admin.php,v 1.34 2006/01/06 21:03:13 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -71,20 +71,21 @@
         include 'footer.php';
         return;
     }
-    // Edit current user
-    if (pnSecAuthAction(0, 'Users::', '::', ACCESS_EDIT)) {
-        OpenTable();
-        echo '<h2>' . _EDITUSER . '</h2>'
-           . "<form method=\"post\" action=\"admin.php\"><div>"
-           . '<strong>' . _NICKNAME . ": </strong>"
-           . "<input type=\"text\" name=\"chng_uid\" size=\"20\" />\n"
-           . "<select name=\"op\"><option value=\"modifyUser\">" . _MODIFY . "</option>\n"
-           . "<option value=\"delUser\">" . _DELETE . "</option></select>\n"
-           . "<input type=\"hidden\" name=\"module\" value=\"User\" />"
-           . "<input type=\"hidden\" name=\"authid\" value=\"" . pnSecGenAuthKey()
-           . "\" /><input type=\"submit\" value=\"" . _OK . "\" /></div></form>";
-        CloseTable();
-    }
+    // Edit and Delete current user
+    OpenTable();
+    echo '<h2>' . _EDITUSER . '</h2>'
+       . "<form method=\"post\" action=\"admin.php\"><div>"
+       . '<strong>' . _NICKNAME . ": </strong>"
+       . "<input type=\"text\" name=\"chng_uname\" size=\"20\" />\n"
+       . "<select name=\"op\">\n"
+       . "<option value=\"modifyUser\">" . _MODIFY . "</option>\n"
+       . "<option value=\"delUser\">" . _DELETE . "</option>\n"
+       . "</select>\n"
+       . "<input type=\"hidden\" name=\"module\" value=\"User\" />"
+       . "<input type=\"hidden\" name=\"authid\" value=\"" . pnSecGenAuthKey(). "\" />"
+       . "<input type=\"submit\" value=\"" . _OK . "\" /></div></form>";
+    CloseTable();
+    
     // Add new user
     if (pnSecAuthAction(0, 'Users::', '::', ACCESS_ADD)) {
         OpenTable();
@@ -104,22 +105,13 @@
            . "</td></tr><tr><td><input type=\"submit\" value=\"" . _ADDUSERBUT . "\" /></td></tr></table></div></form>";
         CloseTable();
     }
-/*
-    // Access User Settings
-    if (pnSecAuthAction(0, 'Users::', '::', ACCESS_ADD)) {
-        OpenTable();
-        echo '<h2>' . _USERCONF . '</h2>';
-        echo "<div style=\"text-align:center\"><a href=\"admin.php?module=" . $GLOBALS['module'] . "&amp;op=getRegConfig\">" . _REGCONF . "</a></div>";
-        echo "<div style=\"text-align:center\"><a href=\"admin.php?module=" . $GLOBALS['module'] . "&amp;op=getConfig\">" . _USERCONF . "</a></div>";
-        echo "<div style=\"text-align:center\"><a href=\"admin.php?module=" . $GLOBALS['module'] . "&amp;op=getDynamic\">" . _DYNAMICDATA . "</a></div>";
-        CloseTable();
-    }
-*/
     include('footer.php');
 }
 
-function modifyUser($chng_user)
+function modifyUser($chng_uname)
 {
+	  $chng_uname=pnVarCleanFromInput('chng_uname');
+	  
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
@@ -139,19 +131,8 @@
                                         $column[user_sig],     $column[bio],            $column[pass],
                                         $column[user_regdate]
                                  FROM   $pntable[users]
-                                 WHERE  $column[uname] = '".pnVarPrepForStore($chng_user)."'");
+                                 WHERE  $column[uname] = '".pnVarPrepForStore($chng_uname)."'");
 
-    if ($result->EOF) {
-        $result =& $dbconn->Execute("SELECT $column[uid],          $column[uname],          $column[name],
-                                            $column[url],          $column[email],          $column[femail],
-                                            $column[user_icq],     $column[user_aim],       $column[user_yim],
-                                            $column[user_msnm],    $column[user_from],      $column[user_occ],
-                                            $column[user_intrest], $column[user_viewemail], $column[user_avatar],
-                                            $column[user_sig],     $column[bio],            $column[pass],
-                                            $column[user_regdate]
-                                     FROM   $pntable[users]
-                                     WHERE  $column[uid] = '".pnVarPrepForStore($chng_user)."'");
-    }
     if (!$result->EOF) {
         list($chng_uid,          $chng_uname,          $chng_name,
              $chng_url,          $chng_email,          $chng_femail,
@@ -176,16 +157,16 @@
             $access_types_array[$group['gid']]=$group['name'];
         }
         OpenTable();
-        echo '<h2>' . _USERUPDATE . ': <em>' . pnVarPrepForDisplay(stripslashes($chng_uname)) . '</em></h2>' .
+        echo '<h2>' . _USERUPDATE . ': <em>' . pnVarPrepForDisplay($chng_uname) . '</em></h2>' .
              '<form name="Register" action="admin.php" method="post"><div>' .
              '<table border="0">' .
              '<tr><td>'._USERID.'</td><td><strong>'.pnVarPrepForDisplay($chng_uid).'</strong></td></tr>' .
              '<tr><td>'._REGDATE.'</td><td>'.pnVarPrepForDisplay(ml_ftime(_DATETIMEBRIEF, $chng_regdate)).'</td></tr>' .
-             '<tr><td>'._NICKNAME.'</td><td><input type="text" name="chng_uname" value="'.pnVarPrepForDisplay($chng_uname).'" /> '.
+             '<tr><td>'._NICKNAME.'</td><td><input type="text" name="chng_uname" value="'.pnVarPrepForDisplay($chng_uname).'" size="30" maxlength="25" /> '.
              '<span class="pn-sub">' . _REQUIRED . '</span></td></tr>' .
-             '<tr><td>'._NAME.'</td><td><input type="text" name="chng_name" value="'.pnVarPrepHTMLDisplay($chng_name).'" size="30" maxlength="60" />'.
-             '<tr><td>'._EMAIL.'</td><td><input type="text" name="chng_email" value="'.pnVarPrepForDisplay($chng_email).'" size="30" maxlength="60" /> <span class="pn-sub">'._REQUIRED . '</span></td></tr>' .
-             '<tr><td>'._UFAKEMAIL.'</td><td><input type="text" name="chng_femail" value="'.pnVarPrepHTMLDisplay($chng_femail).'" size="30" maxlength="60" />' .
+             '<tr><td>'._NAME.'</td><td><input type="text" name="chng_name" value="'.pnVarPrepForDisplay($chng_name).'" size="30" maxlength="60" />'.
+             '<tr><td>'._EMAIL.'</td><td><input type="text" name="chng_email" value="'.pnVarPrepHTMLDisplay($chng_email).'" size="30" maxlength="60" /> <span class="pn-sub">'._REQUIRED . '</span></td></tr>' .
+             '<tr><td>'._UFAKEMAIL.'</td><td><input type="text" name="chng_femail" value="'.pnVarPrepForDisplay($chng_femail).'" size="30" maxlength="60" />' .
              '<tr><td>'._URL.'</td><td><input type="text" name="chng_url" value="'.pnVarPrepForDisplay($chng_url).'" size="30" maxlength="255" />';
         echo '<tr><td>'._AVATAR.'</td><td><select name="user_avatar" onchange="showimage()">';
         $handle = opendir('images/avatar');
@@ -204,15 +185,15 @@
             }
         }
         echo '</select>&nbsp;&nbsp;<img src="images/avatar/' . pnVarPrepForDisplay($chng_avatar) . '" name="avatar" width="32" height="32" alt="" /></td>'.
-             '<tr><td>'._ICQ.'</td><td><input type="text" name="chng_user_icq" value="'.pnVarPrepHTMLDisplay($chng_user_icq).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
-             '<tr><td>'._AIM.'</td><td><input type="text" name="chng_user_aim" value="'.pnVarPrepHTMLDisplay($chng_user_aim).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
-             '<tr><td>'._YIM.'</td><td><input type="text" name="chng_user_yim" value="'.pnVarPrepHTMLDisplay($chng_user_yim).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
-             '<tr><td>'._MSNM.'</td><td><input type="text" name="chng_user_msnm" value="'.pnVarPrepHTMLDisplay($chng_user_msnm).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
-             '<tr><td>'._LOCATION.'</td><td><input type="text" name="chng_user_from" value="'.pnVarPrepHTMLDisplay($chng_user_from).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
-             '<tr><td>'._OCCUPATION.'</td><td><input type="text" name="chng_user_occ" value="'.pnVarPrepHTMLDisplay($chng_user_occ).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
-             '<tr><td>'._INTERESTS.'</td><td><input type="text" name="chng_user_intrest" value="'.pnVarPrepHTMLDisplay($chng_user_intrest).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
-             '<tr><td>'._SIGNATURE.'</td><td><textarea cols="65" rows="4" name="chng_user_sig">'.pnVarPrepHTMLDisplay($chng_user_sig).'</textarea>' .
-             '<tr><td>'._BIO.'</td><td><textarea cols="65" rows="4" name="chng_bio">' . pnVarPrepHTMLDisplay(nl2br($chng_bio)) . '</textarea></td></tr>' .
+             '<tr><td>'._ICQ.'</td><td><input type="text" name="chng_user_icq" value="'.pnVarPrepForDisplay($chng_user_icq).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
+             '<tr><td>'._AIM.'</td><td><input type="text" name="chng_user_aim" value="'.pnVarPrepForDisplay($chng_user_aim).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
+             '<tr><td>'._YIM.'</td><td><input type="text" name="chng_user_yim" value="'.pnVarPrepForDisplay($chng_user_yim).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
+             '<tr><td>'._MSNM.'</td><td><input type="text" name="chng_user_msnm" value="'.pnVarPrepForDisplay($chng_user_msnm).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
+             '<tr><td>'._LOCATION.'</td><td><input type="text" name="chng_user_from" value="'.pnVarPrepForDisplay($chng_user_from).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
+             '<tr><td>'._OCCUPATION.'</td><td><input type="text" name="chng_user_occ" value="'.pnVarPrepForDisplay($chng_user_occ).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
+             '<tr><td>'._INTERESTS.'</td><td><input type="text" name="chng_user_intrest" value="'.pnVarPrepForDisplay($chng_user_intrest).'" size="30" maxlength="255" />&nbsp;'._OPTIONAL.
+             '<tr><td>'._SIGNATURE.'</td><td><textarea cols="65" rows="4" name="chng_user_sig">'.pnVarPrepForDisplay($chng_user_sig).'</textarea>' .
+             '<tr><td>'._BIO.'</td><td><textarea cols="65" rows="4" name="chng_bio">' . pnVarPrepForDisplay($chng_bio). '</textarea></td></tr>' .
              '<tr><td>'._OPTION.'</td>';
         if ($chng_user_viewemail == 1) {
             echo "<td><input type=\"checkbox\" name=\"chng_user_viewemail\" value=\"1\" checked=\"checked\" /> " . _ALLOWUSERS . "</td></tr>";
@@ -229,7 +210,7 @@
         echo "<tr><th>" . _GROUP . "</th><th>" . _MEMBEROF . "</th></tr>";
         while(list($access_id, $access_title) = each($access_types_array)) {
             if ((int)$access_id>=0) {
-                echo "<tr><td>$access_title</td>";
+                echo "<tr><td>".pnVarPrepForDisplay($access_title)."</td>";
                 echo "<td><input type=\"checkbox\" ";
                 foreach($permissions_array as $member) {
                     if ($access_id==$member) {
@@ -237,13 +218,13 @@
                         break;
                     }
                 }
-                echo " name=\"access_permissions[]\" value=\"$access_id\" /></td>";
+                echo " name=\"access_permissions[]\" value=\"".pnVarPrepForDisplay($access_id)."\" /></td>";
                 echo "</tr>\n";
             }
         }
         echo "</table>\n</td>\n</tr>\n" .
              "<tr><td><input type=\"submit\" value=\"" . _SAVECHANGES . "\" /></td></tr></table>" .
-             "<input type=\"hidden\" name=\"chng_uid\" value=\"$chng_uid\" />" .
+             "<input type=\"hidden\" name=\"chng_uid\" value=\"".(int)pnVarPrepForDisplay($chng_uid)."\" />" .
              "<input type=\"hidden\" name=\"module\" value=\"User\" />" .
              "<input type=\"hidden\" name=\"op\" value=\"updateUser\" />" .
              "<input type=\"hidden\" name=\"authid\" value=\"" . pnSecGenAuthKey() . "\" />" .
@@ -251,7 +232,7 @@
         CloseTable();
     } else {
         OpenTable();
-        echo '<div style="text-align:center"><strong>' . _USERNOEXIST . '</strong><br />' . _GOBACK . '</div>';
+        echo '<div style="text-align:center"><strong>' . _USERNOEXIST . ' ('.pnVarPrepForDisplay($chng_uname).')</strong><br />' . _GOBACK . '</div>';
         CloseTable();
     }
     include('footer.php');
@@ -296,7 +277,7 @@
         'chng_user_icq',
         'chng_user_aim',
         'chng_user_yim',
-        'chng_nachng_user_msnmme',
+        'chng_user_msnm',
         'chng_user_from',
         'chng_user_occ',
         'chng_user_intrest',
@@ -306,17 +287,17 @@
         'chng_bio',
         'access_permissions');
 
+    if (empty($chng_user_viewemail)) {
+        $chng_user_viewemail = 0;
+    }
+
     $dbconn  =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
     $column = &$pntable['users_column'];
     $result =& $dbconn->Execute("SELECT $column[uname]
                                  FROM   $pntable[users]
-                                 WHERE  $column[uid] = '" . pnVarPrepForStore($chng_uid) . "'");
-
-    if (!isset($chng_user_viewemail)) {
-        $chng_user_viewemail = 0;
-    }
+                                 WHERE  $column[uid] = '" . (int)pnVarPrepForStore($chng_uid) . "'");
 
     if (!$result->EOF) {
         list($old_uname) = $result->fields;
@@ -332,9 +313,7 @@
         include 'footer.php';
         return;
     }
-    // Bug #507260 - space in username
-    // 2002-01-27: hdonner
-    if ((!$chng_uname) || !(ereg("^[[:print:]]+", $chng_uname) && !ereg("[[:space:]]", $chng_uname))) {
+    if (!$chng_uname || stristr($chng_uname,'&') || preg_match("/[[:space:]]/", $chng_uname) || strip_tags($chng_uname) != $chng_uname) {
         include('header.php');
         GraphicAdmin();
         OpenTable();
@@ -348,13 +327,14 @@
         exit;
     }
 
-    // Fix for Wrong Error warning bug
-    if (!empty($chng_url)) {
-        $url_array = explode(":", $chng_url);
-        if ($url_array[0] != "http" && $url_array[0] != "https" && $url_array[0] != "ftp" ) {
-            $chng_url = "http://" . $chng_url;
-        }
-        $chng_url = preg_replace('/[^a-zA-Z0-9_@.&#?;:\/-~-]/','',$chng_url);
+    // Fix for wrong URL adress
+    if (!pnVarValidate($chng_url, 'url')) {
+        $chng_url="";
+    }
+    
+    // validate uname
+    if (!pnVarValidate($chng_uname, 'uname')) {
+    	  $chng_uname=$old_uname;
     }
 
     $tmp = 0;
@@ -394,7 +374,7 @@
                                             $column[user_avatar]='"     . pnVarPrepForStore($chng_avatar)         . "',
                                             $column[user_sig]='"        . pnVarPrepForStore($chng_user_sig)       . "',
                                             $column[bio]='"             . pnVarPrepForStore($chng_bio)            . "'
-                                     WHERE  $column[uid]='"             . pnVarPrepForStore($chng_uid)            . "'");
+                                     WHERE  $column[uid]='"             . (int)pnVarPrepForStore($chng_uid)       . "'");
         if ($dbconn->ErrorNo() <> 0) {
             error_log("DB Error: " . $dbconn->ErrorMsg());
         }
@@ -420,7 +400,7 @@
                                             $column[user_sig]='"        . pnVarPrepForStore($chng_user_sig)       . "',
                                             $column[bio]='"             . pnVarPrepForStore($chng_bio)            . "',
                                             $column[pass]='"            . pnVarPrepForStore($cpass)               . "'
-                                     WHERE  $column[uid]='"             . pnVarPrepForStore($chng_uid)            . "'");
+                                     WHERE  $column[uid]='"             . (int)pnVarPrepForStore($chng_uid)       . "'");
         if ($dbconn->ErrorNo() <> 0) {
             error_log("DB Error: " . $dbconn->ErrorMsg());
         }
@@ -443,8 +423,10 @@
     pnRedirect("admin.php?module=User&op=main");
 }
 
-function deleteUser($chng_uid)
+function deleteUser($chng_uname)
 {
+	  $chng_uname = pnVarCleanFromInput('chng_uname');
+	  
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
@@ -460,30 +442,25 @@
     echo '<h2>' . _DELETEUSER . '</h2>';
 
     $column = &$pntable['users_column'];
-    // Someone got uname and uid the wrong way around in the form.
-    // This needs to be sorted one day to avoid further confusion
-    $chng_uid = pnVarPrepForStore($chng_uid);
-    $result =& $dbconn->Execute("SELECT $column[uname],
-                                        $column[uid]
+    $result =& $dbconn->Execute("SELECT $column[uid]
                                  FROM   $pntable[users]
-                                 WHERE ($column[uid]   = '$chng_uid')
-                                 OR    ($column[uname] = '$chng_uid')");
+                                 WHERE $column[uname] = '".pnVarPrepForStore($chng_uname)."'");
 
     if (!$result->EOF) {
-        list($uname, $uid) = $result->fields;
+        list($uid) = $result->fields;
     } else {
-        echo _USERNOEXIST;
+        echo _USERNOEXIST." (".pnVarPrepForDisplay($chng_uname).")";
         CloseTable();
         include 'footer.php';
         exit;
     }
-    if (!pnSecAuthAction(0, 'Users::', "$uname::$chng_uid", ACCESS_DELETE)) {
+    if (!pnSecAuthAction(0, 'Users::', "$chng_uname::$uid", ACCESS_DELETE)) {
         echo _MODIFYUSERSDELNOAUTH;
         CloseTable();
         include 'footer.php';
         exit;
     }
-    echo '<h2>' . _SURE2DELETE . " " . pnVarPrepForDisplay(stripslashes($chng_uid)) . "?<br />" . "[ <a href=\"admin.php?module=User&amp;op=delUserConf&amp;del_uid=$uid&amp;authid=$authid\">" . _YES . "</a> | <a href=\"admin.php?module=User&amp;op=mod_users\">" . _NO . "</a> ]</h2>";
+    echo '<h2>' . _SURE2DELETE . " " . pnVarPrepForDisplay($chng_uname) ." (".pnVarPrepForDisplay($uid) . ")?<br />" . "[ <a href=\"admin.php?module=User&amp;op=delUserConf&amp;del_uid=".(int)pnVarPrepForDisplay($uid)."&amp;authid=".pnVarPrepForDisplay($authid)."\">" . _YES . "</a> | <a href=\"admin.php?module=User&amp;op=mod_users\">" . _NO . "</a> ]</h2>";
     CloseTable();
     include('footer.php');
 }
@@ -496,6 +473,9 @@
         include 'footer.php';
         exit;
     }
+    
+    $del_uid = (int)pnVarCleanFromInput('del_uid');
+    
     $dbconn  =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
@@ -503,13 +483,13 @@
 
     $result =& $dbconn->Execute("SELECT $column[uname]
                                  FROM   $pntable[users]
-                                 WHERE  $column[uid] = '".pnVarPrepForStore($del_uid)."'");
+                                 WHERE  $column[uid] = '".(int)pnVarPrepForStore($del_uid)."'");
 
     if (!$result->EOF) {
         list($uname) = $result->fields;
     } else {
         include 'header.php';
-        echo _USERNOEXIST;
+        echo _USERNOEXIST." (".pnVarPrepForDisplay($uname)."/".pnVarPrepForDisplay($del_uid).")";
         include 'footer.php';
         exit;
     }
@@ -521,21 +501,21 @@
     }
     $column = &$pntable['user_perms_column'];
     $dbconn->Execute("DELETE FROM $pntable[user_perms]
-                      WHERE       $column[uid] = '".pnVarPrepForStore($del_uid)."'");
+                      WHERE       $column[uid] = '".(int)pnVarPrepForStore($del_uid)."'");
     if ($dbconn->ErrorNo() <> 0) {
         echo $dbconn->ErrorMsg();
         error_log("DB Error: " . $dbconn->ErrorMsg());
     }
     $column = &$pntable['group_membership_column'];
     $dbconn->Execute("DELETE FROM $pntable[group_membership]
-                      WHERE       $column[uid] = '".pnVarPrepForStore($del_uid)."'");
+                      WHERE       $column[uid] = '".(int)pnVarPrepForStore($del_uid)."'");
     if ($dbconn->ErrorNo() <> 0) {
         echo $dbconn->ErrorMsg();
         error_log("DB Error: " . $dbconn->ErrorMsg());
     }
     $column = &$pntable['users_column'];
     $dbconn->Execute("DELETE FROM $pntable[users]
-                      WHERE       $column[uid] = '".pnVarPrepForStore($del_uid)."'");
+                      WHERE       $column[uid] = '".(int)pnVarPrepForStore($del_uid)."'");
     if ($dbconn->ErrorNo() <> 0) {
         echo $dbconn->ErrorMsg();
         error_log("DB Error: " . $dbconn->ErrorMsg());
@@ -543,7 +523,7 @@
     // remove dud - markwest bug \616 - patch from mrkshrt
     $column = &$pntable['user_data_column'];
     $dbconn->Execute("DELETE FROM $pntable[user_data]
-                      WHERE       $column[uda_uid] = '".pnVarPrepForStore($del_uid)."'");
+                      WHERE       $column[uda_uid] = '".(int)pnVarPrepForStore($del_uid)."'");
     if ($dbconn->ErrorNo() <> 0) {
       echo $dbconn->ErrorMsg();
       error_log("DB Error: " . $dbconn->ErrorMsg());
@@ -555,7 +535,7 @@
     pnRedirect("admin.php?module=User&op=main");
 }
 
-function addUser($var)
+function addUser($add_uname, $add_email, $add_pass)
 {
     if (!pnSecConfirmAuthKey()) {
         include 'header.php';
@@ -563,18 +543,20 @@
         include 'footer.php';
         exit;
     }
+    
+    list($add_uname, $add_email, $add_pass) = pnVarCleanFromInput('add_uname','add_email','add_pass');
+    
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
 
-    if (!pnSecAuthAction(0, 'Users::', $var['add_uname'] . "::", ACCESS_ADD)) {
+    if (!pnSecAuthAction(0, 'Users::', $add_uname . "::", ACCESS_ADD)) {
         include 'header.php';
         echo _MODIFYUSERSADDNOAUTH;
         include 'footer.php';
         exit;
     }
 
-    $add_pass = md5($var['add_pass']);
-    if (!($var['add_uname'] && $var['add_email'] && $var['add_pass'])) {
+    if (empty($add_uname) || empty($add_email) || empty($add_pass)) {
         include('header.php');
         GraphicAdmin();
         OpenTable();
@@ -588,11 +570,8 @@
         return;
     }
 
-    $stop = userCheck($var);
+    $stop = userCheck($add_uname, $add_email);
     if (empty($stop)) {
-        if (empty($var['add_user_viewemail'])) {
-            $var['add_user_viewemail'] = 0;
-        }
         $Default_Theme  = pnConfigGetVar('Default_Theme');
         $commentlimit   = pnConfigGetVar('commentlimit');
         $storynum       = pnConfigGetVar('storyhome');
@@ -601,13 +580,14 @@
         $column         = &$pntable['users_column'];
         $existinguser =& $dbconn->Execute("SELECT $column[uname]
                                            FROM   $pntable[users]
-                                           WHERE  $column[uname] = '" . pnVarPrepForStore($var['add_uname']) . "'");
+                                           WHERE  $column[uname] = '" . pnVarPrepForStore(add_uname) . "'");
         if (!$existinguser->EOF) {
             include 'header.php';
-            echo '<h2>' . _USEREXIST . " <a href=\"admin.php?module=User&op=modifyUser&chng_uid=$var[add_uname] \">(" . pnVarPrepForDisplay($var['add_uname']) . ") " . "</a></h2>";
+            echo '<h2>' . _USEREXIST . " <a href=\"admin.php?module=User&op=modifyUser&chng_uid=".pnVarPrepForDisplay($add_uname)." \">(" . pnVarPrepForDisplay($add_uname) . ") " . "</a></h2>";
             echo "<a href=\"admin.php?module=User&op=main\">" . _ADDUSER . "</a>";
             include 'footer.php';
         } else {
+            $add_pass = md5($add_pass);
             $uid = $dbconn->GenId($pntable['users']);
             $sql = "INSERT INTO $pntable[users] ($column[uid],          $column[name],         $column[uname],
                                                  $column[email],        $column[femail],       $column[url],
@@ -616,11 +596,11 @@
                                                  $column[user_occ],     $column[user_intrest], $column[user_viewemail],
                                                  $column[user_avatar],  $column[user_sig],     $column[pass],
                                                  $column[timezone_offset])
-                    VALUES                      (" . pnVarPrepForStore($uid) . ",'','" . $var['add_uname'] . "',
-                                                '" . $var['add_email'] . "', '', '',
+                    VALUES                      (" . (int)pnVarPrepForStore($uid) . ",'','" . pnVarPrepForStore($add_uname) . "',
+                                                '" . pnVarPrepForStore($add_email) . "', '', '',
                                                 '" . pnVarPrepForStore($user_regdate) . "', '', '',
                                                 '', '', '',
-                                                '', '', '" . $var['add_user_viewemail'] . "',
+                                                '', '', '0',
                                                 'blank.gif', '', '" . pnVarPrepForStore($add_pass) . "',
                                                 '" . pnVarPrepForStore($timezoneoffset) . "')";
             $result =& $dbconn->Execute($sql);
@@ -630,16 +610,16 @@
                 return;
             }
 
+            // Let any hooks know that we have created a new link
+            pnModCallHooks('item', 'create', $uid, 'uid');
+
             // Add user to group
             // get the generated id
             $uid = $dbconn->PO_Insert_ID($pntable['users'], $column['uid']);
             $column = &$pntable['groups_column'];
             $result =& $dbconn->Execute("SELECT $column[gid]
                                          FROM   $pntable[groups]
-                                         WHERE  $column[name] = '" . pnModGetVar('Groups', 'defaultgroup') . "'");
-
-            // Let any hooks know that we have created a new link
-            pnModCallHooks('item', 'create', $uid, 'uid');
+                                         WHERE  $column[name] = '" . pnVarPrepForStore(pnModGetVar('Groups', 'defaultgroup')) . "'");
 
             if ($dbconn->ErrorNo() <> 0) {
                 echo $dbconn->ErrorNo() . "Get default group: " . $dbconn->ErrorMsg() . '<br />';
@@ -652,8 +632,8 @@
                 $column = &$pntable['group_membership_column'];
                 $result =& $dbconn->Execute("INSERT INTO $pntable[group_membership] ($column[gid],
                                                                                      $column[uid])
-                                             VALUES                                 (" . pnVarPrepForStore($gid) . ",
-                                                                                     " . pnVarPrepForStore($uid) . ")");
+                                             VALUES                                 (" . (int)pnVarPrepForStore($gid) . ",
+                                                                                     " . (int)pnVarPrepForStore($uid) . ")");
 
                 if ($dbconn->ErrorNo() <> 0) {
                     echo $dbconn->ErrorNo() . "Add to default group: " . $dbconn->ErrorMsg() . '<br />';
@@ -662,13 +642,13 @@
                 }
             }
             // fix for #1566 [landseer]
-            pnSessionSetVar('statusmsg', pnVarPrepForDisplay(_ADDED) . ' ' . $var['add_uname']);
+            pnSessionSetVar('statusmsg', pnVarPrepForDisplay(_ADDED) . ' ' . pnVarPrepForDisplay($add_uname));
             pnRedirect("admin.php?module=User&op=main");
             return true;
         }
     } else {
         include 'header.php';
-        echo "$stop";
+        echo "<h2>".pnVarPrepForDisplay($stop)."</h2>";
         include 'footer.php';
     }
 }
@@ -856,7 +836,6 @@
         } else {
             $del_text = "<a href=\"admin.php?module=" . $GLOBALS['module'] . "&amp;op=delete_property&amp;property=$prop_id\">" . _DELETE . '</a>';
         }
-        // .'<img src="images/global/green_dot.gif">'
         print '<tr><td style="width:5%" align="center">' . "$img_cmd" . '</td>'
             . '<td style="width:12%">' . $prop_label . '</td>'
             . '<td style="width:12%">' . $prop_label_text . '</td>'
@@ -890,7 +869,6 @@
         . '&nbsp;' . _STRING_INSTRUCTIONS . '</td></tr>'
         . '<tr><td></td><td>'
         . "<input type=\"hidden\" name=\"module\" value=\"" . $GLOBALS['module'] . "\" />"
-        //. "<input type=\"hidden\" name=\"op\" value=\"addDynamic\" />"
         . "<input type=\"submit\" value=\"" . _SUBMIT . "\" />"
         . '</td></tr></table>'
         . '<input type="hidden" name="prop_weight" value="' . $next_prop_weight . '" />'
@@ -955,9 +933,6 @@
     }
     if ($pweight != 0) {
         echo _FIELD_DEACTIVATE;
-        // CloseTable();
-        // include 'footer.php';
-        // exit;
     }
     if (!pnSecAuthAction(0, 'Users::', '::', ACCESS_ADMIN)) {
         echo _MODIFYUSERSDELNOAUTH;
@@ -1101,7 +1076,7 @@
         $new_weight = $var['weight'] + 1;
         $column = &$pntable['user_property_column'];
         $result =& $dbconn->Execute("UPDATE $pntable[user_property]
-                                     SET    $column[prop_weight] = "  . pnVarPrepForStore($new_weight) . "
+                                     SET    $column[prop_weight] = '" . pnVarPrepForStore($new_weight) . "'
                                      WHERE  $column[prop_id]     = '" . pnVarPrepForStore($var['property']) . "'
                                      AND    $column[prop_weight] = '" . pnVarPrepForStore($var['weight']) . "'");
         if ($dbconn->ErrorNo() <> 0) {
@@ -1111,7 +1086,7 @@
         }
 
         $result =& $dbconn->Execute("UPDATE $pntable[user_property]
-                                     SET    $column[prop_weight] =  "  . pnVarPrepForStore($var['weight'])   . "
+                                     SET    $column[prop_weight] =  '" . pnVarPrepForStore($var['weight'])   . "'
                                      WHERE  $column[prop_id]     <> '" . pnVarPrepForStore($var['property']) . "'
                                      AND    $column[prop_weight] =  '" . pnVarPrepForStore($new_weight)      . "'");
         if ($dbconn->ErrorNo() <> 0) {
@@ -1132,7 +1107,7 @@
         $new_weight = $var['weight'] - 1;
         $column = &$pntable['user_property_column'];
         $result =& $dbconn->Execute("UPDATE $pntable[user_property]
-                                     SET    $column[prop_weight] =  " . pnVarPrepForStore($new_weight)      . "
+                                     SET    $column[prop_weight] = '" . pnVarPrepForStore($new_weight)      . "'
                                      WHERE  $column[prop_id]     = '" . pnVarPrepForStore($var['property']) . "'
                                      AND    $column[prop_weight] = '" . pnVarPrepForStore($var['weight'])   . "'");
         if ($dbconn->ErrorNo() <> 0) {
@@ -1142,7 +1117,7 @@
         }
 
         $result =& $dbconn->Execute("UPDATE $pntable[user_property]
-                                     SET    $column[prop_weight] =   " . $var['weight']                      . "
+                                     SET    $column[prop_weight] =  '" . pnVarPrepForStore($var['weight'])  . "'
                                      WHERE  $column[prop_id]     <> '" . pnVarPrepForStore($var['property']) . "'
                                      AND    $column[prop_weight] =  '" . pnVarPrepForStore($new_weight)      . "'");
         if ($dbconn->ErrorNo() <> 0) {
@@ -1169,8 +1144,8 @@
         }
         $max_weight++;
         $result =& $dbconn->Execute("UPDATE $pntable[user_property]
-                                     SET    $column[prop_weight] = " . pnVarPrepForStore($max_weight) . "
-                                     WHERE  $column[prop_id]     ='" . pnVarPrepForStore($var['property']) . "'");
+                                     SET    $column[prop_weight] = '" . pnVarPrepForStore($max_weight) . "'
+                                     WHERE  $column[prop_id]     = '" . pnVarPrepForStore($var['property']) . "'");
         if ($dbconn->ErrorNo() <> 0) {
             echo $dbconn->ErrorNo() . "Activate User Property 1" . $dbconn->ErrorMsg() . '<br />';
             error_log ($dbconn->ErrorNo() . "Activate User Property 1: " . $dbconn->ErrorMsg() . '<br />');
@@ -1209,29 +1184,47 @@
     pnRedirect("admin.php?module=User&op=getDynamic");
 }
 
-function userCheck($var)
+function userCheck($add_uname, $add_email)
 {
     $dbconn =& pnDBGetConn(true);
     $pntable =& pnDBGetTables();
+    $column = &$pntable['users_column'];
+
+    $uname = pnVarCleanFromInput('add_uname');
+    $email = pnVarCleanFromInput('add_email');
+    $stop = '';
 
-    $uname = $var['add_uname'];
-    $email = $var['add_email'];
-    $stop  = "";
-
-    $res = pnVarValidate($email, 'email');
-    if ($res == false) {
-        $stop = '<h2>' . _ERRORINVEMAIL . '</h2>';
-    }
-    // Here we test the uname. Any value is possible but space.
-    // On special character sets you might configure the server.
-    // (was bug #455288)
-    if (!$uname || stristr($uname,'&') || preg_match("/[[:space:]]/", $uname)) {
-        $stop = '<h2>' . _ERRORINVNICK . '</h2>';
+    // check for valid email
+    $res1 = pnVarValidate($email, 'email');
+    if ($res1 == false) {
+        $stop = _ERRORINVEMAIL;
     }
-    if (strlen($uname) > 25) {
-        $stop = '<h2>' . _NICK2LONG . '</h2>';
+
+    // check for valid uname
+    $res2 = pnVarValidate($uname, 'uname');
+    if ($res2 == false) {
+        $stop = _NICK2LONG;
+    }
+
+    // check for some e-mail domains.
+    list($foo, $maildomain) = split('@', $email);
+    $maildomain = strtolower($maildomain);
+    // get the list of banned domains
+    $domains = pnConfigGetVar('reg_Illegaldomains');
+    // fix any text formatting and convert to an array
+    $domains = str_replace(', ', ',', $domains);
+    $checkdomains = explode(',', $domains);
+    // check if our main domain is amonsgt the banned list
+    if (in_array($maildomain, $checkdomains)) {
+       $stop = _EMAILINVALIDDOMAIN;
+    }
+
+    // check for valid username
+    if (!$uname || stristr($uname,'&') || preg_match("/[[:space:]]/", $uname) || strip_tags($uname) != $uname) {
+        $stop = _ERRORINVNICK;
     }
-    // Illegal Usernames [class007]
+
+    // check for forbidden names
     $reg_illegalusername = trim(pnConfigGetVar('reg_Illegalusername'));
     if (!empty($reg_illegalusername)) {
         $usernames = explode(" ", $reg_illegalusername);
@@ -1244,68 +1237,30 @@
                 $pregcondition .= $usernames[$i] . "))/iAD";
             }
         }
-        // die ($pregcondition);
         if (preg_match($pregcondition, $uname)) {
-            $stop = '<h2>' . _NAMERESERVED . '</h2>';
+            $stop = _NAMERESERVED;
         }
     }
-    if (strrpos($uname, ' ') > 0) {
-        $stop = '<h2>' . _NICKNOSPACES . '</h2>';
-    }
-    $column = &$pntable['users_column'];
-    $existinguser =& $dbconn->Execute("SELECT $column[uname]
-                                       FROM   $pntable[users]
-                                       WHERE  $column[uname] = '" . pnVarPrepForStore($uname) . "'");
+
+    // check if user already exists
+    $existinguser =& $dbconn->Execute("SELECT $column[uname] FROM $pntable[users] WHERE $column[uname]='" . pnVarPrepForStore($uname) . "'");
     if (!$existinguser->EOF) {
-        $stop = '<h2>' . _NICKTAKEN . '</h2>';
+        $stop = _NICKTAKEN;
     }
     $existinguser->Close();
-    // new by class007
+
+    // check if email is unique (if wanted)
     if (pnConfigGetVar('reg_uniemail')) {
-        if (!$existinguser->EOF) {
-            $existinguser =& $dbconn->Execute("SELECT $column[email] FROM $pntable[users] WHERE $column[email]='" . pnVarPrepForStore($email) . "'");
-            $stop = '<h2>' . _EMAILREGISTERED . '</h2>';
-            $existinguser->Close();
+        $existingemail =& $dbconn->Execute("SELECT $column[email] FROM $pntable[users] WHERE $column[email]='" . pnVarPrepForStore($email) . "'");
+        if (!$existingemail->EOF) {
+            $stop = _EMAILREGISTERED;
         }
+        $existingemail->Close();
     }
+    
     return($stop);
 }
 
-/*
-// replaced by updateConfig and updateRegConfig [landseer]
-function user_admin_setConfig($var)
-{
-    if (!pnSecConfirmAuthKey()) {
-        include 'header.php';
-        echo _BADAUTHKEY;
-        include 'footer.php';
-        exit;
-    }
-    // Escape some characters in these variables.
-    // hehe, I like doing this, much cleaner :-)
-    $fixvars = array();
-    // todo: make FixConfigQuotes global / replace with other function
-    foreach ($fixvars as $v) {
-        // $var[$v] = FixConfigQuotes($var[$v]);
-    }
-    // Set any numerical variables that havn't been set, to 0. i.e. paranoia check :-)
-    $fixvars = array();
-
-    foreach ($fixvars as $v) {
-        if (empty($var[$v])) {
-            $var[$v] = 0;
-        }
-    }
-    // all variables starting with x are the config vars.
-    while (list ($key, $val) = each ($var)) {
-        if (substr($key, 0, 1) == 'x') {
-            pnConfigSetVar(substr($key, 1), $val);
-        }
-    }
-    pnRedirect("admin.php?module=User&op=main");
-}
-*/
-// new [landseer]
 function user_admin_updateRegConfig()
 {
     if (!pnSecAuthAction(0, 'Users::', '::', ACCESS_ADMIN)) {
@@ -1380,7 +1335,6 @@
     pnRedirect("admin.php?module=User&op=main");
 }
 
-// new by class007
 function user_admin_getRegConfig()
 {
     include ('header.php');
@@ -1422,16 +1376,16 @@
         . '</td></tr><tr><td valign="top">' . _ALLOWREG . ' </td><td>'
         . "<input type=\"radio\" name=\"xreg_allowreg\" value=\"1\"" . $sel_reg_allowreg['1'] . " />" . _YES . ' &nbsp;'
         . "<input type=\"radio\" name=\"xreg_allowreg\" value=\"0\"" . $sel_reg_allowreg['0'] . " />" . _NO . " &nbsp;<br />\n" . _IFNO
-        . "<br />&nbsp;&nbsp;&nbsp;<textarea name=\"xreg_noregreasons\" cols=\"80\" rows=\"10\">" . pnConfigGetVar('reg_noregreasons') . "</textarea>"
+        . "<br />&nbsp;&nbsp;&nbsp;<textarea name=\"xreg_noregreasons\" cols=\"80\" rows=\"10\">" . pnVarPrepForDisplay(pnConfigGetVar('reg_noregreasons')) . "</textarea>"
         . '</td></tr><tr><td>' . _VERIFYEMAIL . '</td><td>'
         . "<input type=\"radio\" name=\"xreg_verifyemail\" value=\"1\"" . $sel_reg_verifyemail['1'] . " />" . _YES . ' &nbsp;'
         . "<input type=\"radio\" name=\"xreg_verifyemail\" value=\"0\"" . $sel_reg_verifyemail['0'] . " />" . _NO . " &nbsp;" . _PASSBYMAIL . "\n"
         . "</td></tr><tr><td>" . _NOTIFYEMAIL . "</td><td>"
-        . "<input type=\"text\" name=\"xreg_notifyemail\" value=\"" . pnConfigGetVar('reg_notifyemail') . "\" size=\"20\" maxlength=\"200\" />" . _NOTIFYEMAILDESC . "\n"
+        . "<input type=\"text\" name=\"xreg_notifyemail\" value=\"" . pnVarPrepForDisplay(pnConfigGetVar('reg_notifyemail')) . "\" size=\"20\" maxlength=\"200\" />" . _NOTIFYEMAILDESC . "\n"
         . "</td></tr><tr><td>" . _ILLEGALUNAME . "</td><td>"
-        . "<input type=\"text\" name=\"xreg_Illegalusername\" value=\"" . pnConfigGetVar('reg_Illegalusername') . "\" size=\"20\" />" . _ILLEGALUNAMEDESC . "\n"
+        . "<input type=\"text\" name=\"xreg_Illegalusername\" value=\"" . pnVarPrepForDisplay(pnConfigGetVar('reg_Illegalusername')) . "\" size=\"20\" />" . _ILLEGALUNAMEDESC . "\n"
         . "</td></tr><tr><td>" . _ILLEGALMAILDOMAINS . "</td><td>"
-        . "<textarea name=\"xreg_Illegaldomains\" rows=\"5\" cols=\"50\">" . pnConfigGetVar('reg_Illegaldomains') . "</textarea><br />" . _ILLEGALDOMAINDESC . "\n"
+        . "<textarea name=\"xreg_Illegaldomains\" rows=\"5\" cols=\"50\">" . pnVarPrepForDisplay(pnConfigGetVar('reg_Illegaldomains')) . "</textarea><br />" . _ILLEGALDOMAINDESC . "\n"
         . '</td></tr><tr><td>' . _MINAGE . "</td><td><input type=\"text\" name=\"xminage\" value=\""
         . pnConfigGetVar('minage') . "\" size=\"2\" maxlength=\"2\" /> " . _MINAGEDESCR . "\n"
         . '</td></tr><tr><td>' . _PASSWDLEN . '</td><td>' . '<select name="xminpass" size="1">'
@@ -1452,13 +1406,6 @@
     include ('footer.php');
 }
 
-/*
-function user_admin_setRegConfig($var)
-{
-    user_admin_setConfig($var);
-    return true;
-}
-*/
 function user_admin_main($var)
 {
     if (!isset($var['op'])) {
@@ -1466,7 +1413,8 @@
     }
     switch ($var['op']) {
         case "modifyUser":
-            modifyUser($var['chng_uid']);
+            $chng_uname=pnVarCleanFromInput('chng_uname');
+            modifyUser($chng_uname);
             break;
 
         case "updateUser":
@@ -1474,33 +1422,28 @@
             break;
 
         case "delUser":
-            deleteUser($var['chng_uid']);
+            $chng_uname=pnVarCleanFromInput('chng_uname');
+            deleteUser($chng_uname);
             break;
 
         case "delUserConf":
-            deleteUserConfirm($var['del_uid']);
+            $del_uid=(int)pnVarCleanFromInput('del_uid');
+            deleteUserConfirm($del_uid);
             break;
 
         case "addUser":
-            addUser($var);
+            list($add_uname, $add_email, $add_pass) = pnVarCleanFromInput('add_uname','add_email','add_pass');
+            addUser($add_uname, $add_email, $add_pass);
             break;
 
         case "getConfig":
             user_admin_getConfig();
             break;
-/*
-        case "setConfig":
-            user_admin_setConfig($var);
-            break;
-*/
+
         case "getRegConfig":
             user_admin_getRegConfig();
             break;
-/*
-        case "setRegConfig":
-            user_admin_setRegConfig($var);
-            break;
-*/
+
         case "getDynamic":
             user_dynamic_data();
             break;
diff -ruN 0.761/modules/User/lang/eng/global.php 0.762/modules/User/lang/eng/global.php
--- 0.761/modules/User/lang/eng/global.php	2005-08-05 04:04:21.000000000 -0500
+++ 0.762/modules/User/lang/eng/global.php	2005-09-28 04:09:38.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: global.php,v 1.8 2005/08/05 09:04:21 larsneo Exp $
+// $Id: global.php,v 1.9 2005/09/28 09:09:38 chestnut Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by The PostNuke Development Team.
@@ -32,7 +32,6 @@
 define('_COOKIEHINTFORLOGIN', 'Cookies must be enabled past this point.');
 define('_USERALLOWCOOKIES', 'Please allow Cookies for this site!');
 define('_USERREDIRECT', 'Continue');
-define('_USERPROFILELINK', 'Profile');
 define('_IDNNAMES','IDN-Domains:');
 define('_IDNNAMESDESC', 'Allow special characters in email addresses and URLs');
 define('_ADDFIELD','Add fields');
diff -ruN 0.761/modules/Web_Links/admin.php 0.762/modules/Web_Links/admin.php
--- 0.761/modules/Web_Links/admin.php	2005-03-22 05:57:06.000000000 -0600
+++ 0.762/modules/Web_Links/admin.php	2006-01-12 07:53:25.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: admin.php,v 1.46 2005/03/22 11:57:06 markwest Exp $
+// File: $Id: admin.php,v 1.47 2006/01/12 13:53:25 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -1516,6 +1516,12 @@
 
     include ('header.php');
 
+    if (!pnSecAuthAction(0, 'Web Links::', '::', ACCESS_ADMIN)) {
+        echo _WEBLINKSNOAUTH;
+        include 'footer.php';
+        return;
+    }
+
     // prepare vars
     $sel_perpage['10'] = '';
     $sel_perpage['15'] = '';
@@ -1684,6 +1690,13 @@
 
 function web_links_admin_setConfig($var) {
 
+    if (!pnSecAuthAction(0, 'Web Links::', '::', ACCESS_ADMIN)) {
+        include 'header.php';
+        echo _WEBLINKSNOAUTH;
+        include 'footer.php';
+        return;
+    }
+
     // Escape some characters in these variables.
     // hehe, I like doing this, much cleaner :-)
     $fixvars = array (
@@ -1722,6 +1735,7 @@
     include 'header.php';
     echo _WEBLINKSNOAUTH;
     include 'footer.php';
+    return;
 } else {
     switch ($op) {
 
diff -ruN 0.761/modules/Web_Links/wl-addlink.php 0.762/modules/Web_Links/wl-addlink.php
--- 0.761/modules/Web_Links/wl-addlink.php	2005-02-04 00:30:39.000000000 -0600
+++ 0.762/modules/Web_Links/wl-addlink.php	2005-09-29 16:37:13.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: wl-addlink.php,v 1.29 2005/02/04 06:30:39 jorg Exp $
+// File: $Id: wl-addlink.php,v 1.31 2005/09/29 21:37:13 hammerhead Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -115,6 +115,13 @@
         exit;
     }
 
+    if (!pnSecAuthAction(0, 'Web Links::', "::", ACCESS_COMMENT)) {
+	    include 'header.php';
+	    echo _WEBLINKSADDNOAUTH;
+	    include 'footer.php';
+	    return;
+    }
+    
     $column = &$pntable['links_links_column'];
     $existingurl =& $dbconn->Execute("SELECT $column[title] FROM $pntable[links_links] WHERE $column[url]='" . pnVarPrepForStore($url) . "'");
     //$result =& $dbconn->Execute("SELECT COUNT(*) FROM $pntable[links_links] WHERE $column[url]='".pnVarPrepForStore($url)."'");
diff -ruN 0.761/modules/Web_Links/wl-viewlink.php 0.762/modules/Web_Links/wl-viewlink.php
--- 0.761/modules/Web_Links/wl-viewlink.php	2005-07-26 17:45:23.000000000 -0500
+++ 0.762/modules/Web_Links/wl-viewlink.php	2006-01-06 14:55:52.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: wl-viewlink.php,v 1.45 2005/07/26 22:45:23 markwest Exp $
+// File: $Id: wl-viewlink.php,v 1.47 2006/01/06 20:55:52 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -157,7 +157,7 @@
 				FROM $pntable[links_links]
 				WHERE $column[cat_id]='".(int)pnVarPrepForStore($cid)."' 
 				ORDER BY $orderby";
-    $result = $dbconn->SelectLimit($query, $linkresults, (int)$min);
+    $result = $dbconn->SelectLimit($query, $perpage, (int)$min);
 	
     while(list($lid, $title, $description, $time, $hits, $linkratingsummary, $totalvotes, $totalcomments)=$result->fields) {
 
@@ -224,7 +224,7 @@
             $cpage = $counter;
             $mintemp = ($perpage * $counter) - $perpage;
             if ($counter == $currentpage) {
-                echo "".(int)$counter."&nbsp";
+                echo "".(int)$counter."&nbsp;";
             } else {
                 echo "<a href=\"".$GLOBALS['modurl']."&amp;req=viewlink&amp;cid=".(int)$cid."&amp;min=".(int)$mintemp."&amp;orderby=".pnVarPrepForDisplay($orderby)."&amp;show=".pnVarPrepForDisplay($show)."\">".(int)$counter."</a> ";
             }
diff -ruN 0.761/modules/Xanthia/plugins/function.userlogin.php 0.762/modules/Xanthia/plugins/function.userlogin.php
--- 0.761/modules/Xanthia/plugins/function.userlogin.php	2005-07-27 13:44:37.000000000 -0500
+++ 0.762/modules/Xanthia/plugins/function.userlogin.php	2005-11-11 02:06:27.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: function.userlogin.php,v 1.10.2.4 2005/07/27 18:44:37 markwest Exp $
+// $Id: function.userlogin.php,v 1.10.2.4.2.1 2005/11/11 08:06:27 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -30,7 +30,7 @@
  *
  * @package      Xanthia_Templating_Environment
  * @subpackage   Xanthia
- * @version      $Id: function.userlogin.php,v 1.10.2.4 2005/07/27 18:44:37 markwest Exp $
+ * @version      $Id: function.userlogin.php,v 1.10.2.4.2.1 2005/11/11 08:06:27 landseer Exp $
  * @author       The PostNuke development team
  * @link         http://www.postnuke.com  The PostNuke Home Page
  * @copyright    Copyright (C) 2002 by the PostNuke Development Team
@@ -101,17 +101,17 @@
 
 	if (!pnUserLoggedIn()) {
 		$loginbox =  '<form style="display:inline" action="user.php" method="post"><div>'
-  				.'<span'.$class.'">&nbsp;<label for="uname_xte_plugin">' . pnVarPrepForDisplay(_NICKNAME) . '</label></span>'
+  				.'<span'.$class.'>&nbsp;<label for="uname_xte_plugin">' . pnVarPrepForDisplay(_NICKNAME) . '</label></span>'
 				.'<input type="text" name="uname" id="uname_xte_plugin" size="'.$size.'" maxlength="'.$maxlength.'" />'
-  				.'<span'.$class.'">&nbsp;<label for="pass_xte_plugin">' . pnVarPrepForDisplay(_PASSWORD) . '</label></span>'
+  				.'<span'.$class.'>&nbsp;<label for="pass_xte_plugin">' . pnVarPrepForDisplay(_PASSWORD) . '</label></span>'
 				.'<input type="password" name="pass" id="pass_xte_plugin" size="'.$size.'" maxlength="'.$maxlengthpass.'" />';
 
         if (pnConfigGetVar('seclevel') <> 'high') {
-			$loginbox .= '<input type="checkbox" value="1" name="rememberme" id="rememberme_xte_plugin">'
-					.'  <span'.$class.'">&nbsp;<label for="rememberme_xte_plugin">' . pnVarPrepForDisplay(_REMEMBERME) . '</label></span>';
+			$loginbox .= '<input type="checkbox" value="1" name="rememberme" id="rememberme_xte_plugin" />'
+					.'  <span'.$class.'>&nbsp;<label for="rememberme_xte_plugin">' . pnVarPrepForDisplay(_REMEMBERME) . '</label></span>';
 		}
 
-		$loginbox .= '<input type="hidden" name="module" value="NS-User">'
+		$loginbox .= '<input type="hidden" name="module" value="User" />'
 				.'<input type="hidden" name="op" value="login" />'
 				.'<input type="hidden" name="url" value="' . pnVarPrepForDisplay($path) .'" />'
 				.'<input class="pn-button" type="submit" value="' . pnVarPrepForDisplay(_LOGIN) . '" />'
diff -ruN 0.761/modules/Xanthia/plugins/outputfilter.shorturls.php 0.762/modules/Xanthia/plugins/outputfilter.shorturls.php
--- 0.761/modules/Xanthia/plugins/outputfilter.shorturls.php	2005-09-25 10:07:40.000000000 -0500
+++ 0.762/modules/Xanthia/plugins/outputfilter.shorturls.php	2006-02-15 14:02:52.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: outputfilter.shorturls.php,v 1.5.2.7.2.1 2005/09/25 15:07:40 chestnut Exp $
+// $Id: outputfilter.shorturls.php,v 1.5.2.7.2.6 2006/02/15 20:02:52 jmvedrine Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -30,7 +30,7 @@
  *
  * @package      Xanthia_Templating_Environment
  * @subpackage   Xanthia
- * @version      $Id: outputfilter.shorturls.php,v 1.5.2.7.2.1 2005/09/25 15:07:40 chestnut Exp $
+ * @version      $Id: outputfilter.shorturls.php,v 1.5.2.7.2.6 2006/02/15 20:02:52 jmvedrine Exp $
  * @author       Craig R. Saunders (coldrolledsteel)
  * @author       Martin Anderson (msanderson)
  * @author       Luca Longinotti (CHTEKK)
@@ -58,7 +58,6 @@
  */
 function smarty_outputfilter_shorturls($source, &$smarty)
 {
-
   // Credits to / Crediti a:
   // ColdRolledSteel: for creating this file and the rewrite rules / per aver creato questo file e le regole di riscrittura
   // msandersen: for tweaking this file and the rewrite rules / per aver aggiornato questo file e le regole di riscrittura
@@ -277,93 +276,93 @@
   $prefix . 'modules.php\?op=modload&(?:amp;)?name=([\w\d\.\:\_\/]+)&(?:amp;)?file=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)[#]([\w\d]*)"|'
   );
 
+  //$base_url = '';
   $out = array(
-  '"changelang-$1.'.$extension.'"',
-  '"changetheme-$1.'.$extension.'"',
-  '"index.'.$extension.'"',
-  '"user.'.$extension.'"',
-  '"ppnews-index.'.$extension.'"',
-  '"ppnews-$1.'.$extension.'"',
-  '"MeG-$1.'.$extension.'"',
-  '"MeG-$1-$2-$3.'.$extension.'"',
-  '"MeG-$1-$2-$3-$4-$5.'.$extension.'"',
-  '"MeG-$1-$2-$3-$4-$5-$6-$7.'.$extension.'"',
-  '"User_Points.'.$extension.'"',
-  '"Link_To_Us.'.$extension.'"',
-  '"Poll-$2$1.'.$extension.'"',
-  '"Messages-outbox.'.$extension.'"',
-  '"Messages-inbox.'.$extension.'"',
-  '"Search-author-$1.'.$extension.'"',
-  '"Search-topics-$1.'.$extension.'"',
-  '"Search-author-$1-no.'.$extension.'"',
-  '"Search-topics-$1-no.'.$extension.'"',
-  '"daily_archive-$1.'.$extension.'"',
-  '"daily_archive-$1-$2.'.$extension.'"',
-  '"daily_archive-$1-$2-$3.'.$extension.'"',
-  '"daily_archive-$1-$2-$3-$4.'.$extension.'"',
-  '"News-hometopicmore-$1.'.$extension.'"',
-  '"News-topicmore-$1-$2.'.$extension.'"',
-  '"PostCalendar-$3-$2-$1-event-$4.'.$extension.'"',
-  '"PostCalendar-$3-$2-$1.'.$extension.'"',
-  '"PostCalendar-$5-$4-$3-$2-$1.'.$extension.'"',
-  '"PostCalendar-$4-$3-$2-$1.'.$extension.'"',
-  '"PostCalendar-$1.'.$extension.'"',
-  '"Article$1.'.$extension.'"',
-  '"SendArticle$1.'.$extension.'"',
-  '"Section-$1.'.$extension.'"',
-  '"Sections-article$1-p$2.'.$extension.'"',
-  '"PrintArticle$1.'.$extension.'"',
-  '"Category$1.'.$extension.'"',
-  '"Category$1-All.'.$extension.'"',
-  '"Topic$1$2.'.$extension.'"',
-  '"FAQ-Category$2-$3-Parent$4-myfaq-$1.'.$extension.'"',
-  '"PNphpBB2.'.$extension.'"',
-  '"PNphpBB2.'.$extension.'"',
-  '"PNphpBB2-$1.'.$extension.'"',
-  '"PNphpBB2-$1-$2-$3.'.$extension.'"',
-  '"PNphpBB2-$1-$2-$3-$4-$5.'.$extension.'"',
-  '"PNphpBB2-$1-$2-$3-$4-$5-$6-$7.'.$extension.'"',
-  '"PNphpBB2-$1-$2-$3-$4-$5-$6-$7-$8-$9.'.$extension.'"',
-  '"UserInfo-$1.'.$extension.'"',
-  '"UserReg.'.$extension.'"',
-  '"UserReg-CheckAge.'.$extension.'"',
-  '"User-Login.'.$extension.'"',
-  '"User-LostPassword.'.$extension.'"',
-  '"User-Logout.'.$extension.'"',
-  '"$1.'.$extension.'"',
-  '"$1.'.$extension.'"',
-  '"$1-$2.'.$extension.'"',
-  '"$1-$2-$3-$4.'.$extension.'"',
-  '"$1-$2-$3-$4-$5-$6.'.$extension.'"',
-  '"$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'"',
-  '"$1.'.$extension.'"',
-  '"$1-$2-$3.'.$extension.'"',
-  '"$1-$2-$3-$4-$5.'.$extension.'"',
-  '"$1-$2-$3-$4-$5-$6-$7.'.$extension.'"',
-  '"$1-$2-$3-$4-$5-$6-$7-$8-$9.'.$extension.'"',
-  '"module-$1.'.$extension.'"',
-  '"module-$1.'.$extension.'#$2"',
-  '"module-$1.'.$extension.'"',
-  '"module-$1.'.$extension.'#$2"',
-  '"module-$1-$2.'.$extension.'"',
-  '"module-$1-$2.'.$extension.'#$3"',
-  '"module-$1-$2-$3-$4.'.$extension.'"',
-  '"module-$1-$2-$3-$4.'.$extension.'#$5"',
-  '"module-$1-$2-$3-$4-$5-$6.'.$extension.'"',
-  '"module-$1-$2-$3-$4-$5-$6.'.$extension.'#$7"',
-  '"module-$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'"',
-  '"module-$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'#$9"',
-  '"module-$1-$2-$3-$4-$5-$6-$7-$8-$9-$10.'.$extension.'"',
-  '"$1+$2.'.$extension.'"',
-  '"$1.'.$extension.'"',
-  '"$1-$2.'.$extension.'"',
-  '"$1-$2.'.$extension.'#$3"',
-  '"$1-$2-$3-$4.'.$extension.'"',
-  '"$1-$2-$3-$4.'.$extension.'#$5"',
-  '"$1-$2-$3-$4-$5-$6.'.$extension.'"',
-  '"$1-$2-$3-$4-$5-$6.'.$extension.'#$7"',
-  '"$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'"',
-  '"$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'#$9"'
+  '"'.$base_url.'changelang-$1.'.$extension.'"',
+  '"'.$base_url.'changetheme-$1.'.$extension.'"',
+  '"'.$base_url.'index.'.$extension.'"',
+  '"'.$base_url.'user.'.$extension.'"',
+  '"'.$base_url.'ppnews-index.'.$extension.'"',
+  '"'.$base_url.'ppnews-$1.'.$extension.'"',
+  '"'.$base_url.'MeG-$1.'.$extension.'"',
+  '"'.$base_url.'MeG-$1-$2-$3.'.$extension.'"',
+  '"'.$base_url.'MeG-$1-$2-$3-$4-$5.'.$extension.'"',
+  '"'.$base_url.'MeG-$1-$2-$3-$4-$5-$6-$7.'.$extension.'"',
+  '"'.$base_url.'User_Points.'.$extension.'"',
+  '"'.$base_url.'Link_To_Us.'.$extension.'"',
+  '"'.$base_url.'Poll-$2$1.'.$extension.'"',
+  '"'.$base_url.'Messages-outbox.'.$extension.'"',
+  '"'.$base_url.'Messages-inbox.'.$extension.'"',
+  '"'.$base_url.'Search-author-$1.'.$extension.'"',
+  '"'.$base_url.'Search-topics-$1.'.$extension.'"',
+  '"'.$base_url.'Search-author-$1-no.'.$extension.'"',
+  '"'.$base_url.'Search-topics-$1-no.'.$extension.'"',
+  '"'.$base_url.'daily_archive-$1.'.$extension.'"',
+  '"'.$base_url.'daily_archive-$1-$2.'.$extension.'"',
+  '"'.$base_url.'daily_archive-$1-$2-$3.'.$extension.'"',
+  '"'.$base_url.'daily_archive-$1-$2-$3-$4.'.$extension.'"',
+  '"'.$base_url.'News-hometopicmore-$1.'.$extension.'"',
+  '"'.$base_url.'News-topicmore-$1-$2.'.$extension.'"',
+  '"'.$base_url.'PostCalendar-$3-$2-$1-event-$4.'.$extension.'"',
+  '"'.$base_url.'PostCalendar-$3-$2-$1.'.$extension.'"',
+  '"'.$base_url.'PostCalendar-$5-$4-$3-$2-$1.'.$extension.'"',
+  '"'.$base_url.'PostCalendar-$4-$3-$2-$1.'.$extension.'"',
+  '"'.$base_url.'PostCalendar-$1.'.$extension.'"',
+  '"'.$base_url.'Article$1.'.$extension.'"',
+  '"'.$base_url.'SendArticle$1.'.$extension.'"',
+  '"'.$base_url.'Section-$1.'.$extension.'"',
+  '"'.$base_url.'Sections-article$1-p$2.'.$extension.'"',
+  '"'.$base_url.'PrintArticle$1.'.$extension.'"',
+  '"'.$base_url.'Category$1.'.$extension.'"',
+  '"'.$base_url.'Category$1-All.'.$extension.'"',
+  '"'.$base_url.'Topic$1$2.'.$extension.'"',
+  '"'.$base_url.'FAQ-Category$2-$3-Parent$4-myfaq-$1.'.$extension.'"',
+  '"'.$base_url.'PNphpBB2.'.$extension.'"',
+  '"'.$base_url.'PNphpBB2.'.$extension.'"',
+  '"'.$base_url.'PNphpBB2-$1.'.$extension.'"',
+  '"'.$base_url.'PNphpBB2-$1-$2-$3.'.$extension.'"',
+  '"'.$base_url.'PNphpBB2-$1-$2-$3-$4-$5.'.$extension.'"',
+  '"'.$base_url.'PNphpBB2-$1-$2-$3-$4-$5-$6-$7.'.$extension.'"',
+  '"'.$base_url.'PNphpBB2-$1-$2-$3-$4-$5-$6-$7-$8-$9.'.$extension.'"',
+  '"'.$base_url.'UserInfo-$1.'.$extension.'"',
+  '"'.$base_url.'UserReg.'.$extension.'"',
+  '"'.$base_url.'UserReg-CheckAge.'.$extension.'"',
+  '"'.$base_url.'User-Login.'.$extension.'"',
+  '"'.$base_url.'User-LostPassword.'.$extension.'"',
+  '"'.$base_url.'User-Logout.'.$extension.'"',
+  '"'.$base_url.'$1.'.$extension.'"',
+  '"'.$base_url.'$1.'.$extension.'"',
+  '"'.$base_url.'$1-$2.'.$extension.'"',
+  '"'.$base_url.'$1-$2-$3-$4.'.$extension.'"',
+  '"'.$base_url.'$1-$2-$3-$4-$5-$6.'.$extension.'"',
+  '"'.$base_url.'$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'"',
+  '"'.$base_url.'$1.'.$extension.'"',
+  '"'.$base_url.'$1-$2-$3.'.$extension.'"',
+  '"'.$base_url.'$1-$2-$3-$4-$5.'.$extension.'"',
+  '"'.$base_url.'$1-$2-$3-$4-$5-$6-$7.'.$extension.'"',
+  '"'.$base_url.'$1-$2-$3-$4-$5-$6-$7-$8-$9.'.$extension.'"',
+  '"'.$base_url.'module-$1.'.$extension.'"',
+  '"'.$base_url.'module-$1.'.$extension.'#$2"',
+  '"'.$base_url.'module-$1.'.$extension.'"',
+  '"'.$base_url.'module-$1.'.$extension.'#$2"',
+  '"'.$base_url.'module-$1-$2.'.$extension.'"',
+  '"'.$base_url.'module-$1-$2.'.$extension.'#$3"',
+  '"'.$base_url.'module-$1-$2-$3-$4.'.$extension.'"',
+  '"'.$base_url.'module-$1-$2-$3-$4.'.$extension.'#$5"',
+  '"'.$base_url.'module-$1-$2-$3-$4-$5-$6.'.$extension.'"',
+  '"'.$base_url.'module-$1-$2-$3-$4-$5-$6.'.$extension.'#$7"',
+  '"'.$base_url.'module-$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'"',
+  '"'.$base_url.'module-$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'#$9"',
+  '"'.$base_url.'$1+$2.'.$extension.'"',
+  '"'.$base_url.'$1.'.$extension.'"',
+  '"'.$base_url.'$1-$2.'.$extension.'"',
+  '"'.$base_url.'$1-$2.'.$extension.'#$3"',
+  '"'.$base_url.'$1-$2-$3-$4.'.$extension.'"',
+  '"'.$base_url.'$1-$2-$3-$4.'.$extension.'#$5"',
+  '"'.$base_url.'$1-$2-$3-$4-$5-$6.'.$extension.'"',
+  '"'.$base_url.'$1-$2-$3-$4-$5-$6.'.$extension.'#$7"',
+  '"'.$base_url.'$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'"',
+  '"'.$base_url.'$1-$2-$3-$4-$5-$6-$7-$8.'.$extension.'#$9"'
   );
 
   $source = preg_replace($in, $out, $source);
diff -ruN 0.761/modules/Xanthia/pnadminapi.php 0.762/modules/Xanthia/pnadminapi.php
--- 0.761/modules/Xanthia/pnadminapi.php	2005-06-06 14:55:06.000000000 -0500
+++ 0.762/modules/Xanthia/pnadminapi.php	2006-01-11 05:49:49.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnadminapi.php,v 1.55.2.11 2005/06/06 19:55:06 markwest Exp $
+// $Id: pnadminapi.php,v 1.55.2.11.2.1 2006/01/11 11:49:49 markwest Exp $
 // Xanthia Theme Engine FOR PostNuke Content Management System
 // Copyright (C) 2003 By Larry E. Masters, Shorewood, Illinois.
 // nut@phpnut.com
@@ -1052,7 +1052,7 @@
 	}
 	
 	include_once $xaninit_path;
-	if (xanthia_skins_install(array('id' => $id))) {
+	if (function_exists('xanthia_skins_install') && xanthia_skins_install(array('id' => $id))) {
 		$cid = pnModAPIFunc('Xanthia','admin','insertThemeDB', array('id' => $id)); // sucessful install
 		if ($cid != false) {
 			//pnModAPIFunc('Xanthia','admin','setBcOnInstall', array('id' => $id));
diff -ruN 0.761/modules/Xanthia/pnclasses/Xanthia.php 0.762/modules/Xanthia/pnclasses/Xanthia.php
--- 0.761/modules/Xanthia/pnclasses/Xanthia.php	2005-08-21 10:32:57.000000000 -0500
+++ 0.762/modules/Xanthia/pnclasses/Xanthia.php	2005-11-16 15:42:45.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: Xanthia.php,v 1.83.2.19 2005/08/21 15:32:57 markwest Exp $
+// $Id: Xanthia.php,v 1.83.2.19.2.1 2005/11/16 21:42:45 markwest Exp $
 // Xanthia Theme Engine FOR PostNuke Content Management System
 // Copyright (C) 2003 By Larry E. Masters, Shorewood, Illinois.
 // nut@phpnut.com
@@ -687,7 +687,7 @@
 				$this->DTS->clear_cache(null, $modname);
 			}
 			// quick .7x hack - if the module is comments then clear the news cache too
-			if ($this->cmod == 'Comments') {
+			if ($this->cmod == 'Comments' || $this->cmod == 'AddStory') {
 				$this->DTS->clear_cache(null, 'News');
 			}
 		}
diff -ruN 0.761/modules/Xanthia/pntemplates/xanthiaadminmodzone.htm 0.762/modules/Xanthia/pntemplates/xanthiaadminmodzone.htm
--- 0.761/modules/Xanthia/pntemplates/xanthiaadminmodzone.htm	2004-12-11 05:54:45.000000000 -0600
+++ 0.762/modules/Xanthia/pntemplates/xanthiaadminmodzone.htm	2006-01-11 05:47:38.000000000 -0600
@@ -5,13 +5,13 @@
 <form action="<!--[pnmodurl modname="Xanthia" type="admin" func="updateZones"]-->" method="post" enctype="application/x-www-form-urlencoded" name="modifythemezone">		
 <div>
 <input type="hidden" name="authid" value="<!--[pnsecgenauthkey module="Xanthia"]-->" />
-<input type="hidden" name="skin" value="<!--[$skinid]-->" />	
-<input type="hidden" name="zone" id="zone" value="<!--[$zone]-->" />
-<input type="hidden" name="skintype" id="skintype" value="<!--[$skintype]-->" />
+<input type="hidden" name="skin" value="<!--[$skinid|pnvarprepfordisplay]-->" />	
+<input type="hidden" name="zone" id="zone" value="<!--[$zone|pnvarprepfordisplay]-->" />
+<input type="hidden" name="skintype" id="skintype" value="<!--[$skintype|pnvarprepfordisplay]-->" />
 <table>
 	<tr>
 		<td><!--[pnml name="_XA_ZONELABEL"]--></td>
-		<td><strong><!--[$zone]--></strong></td>
+		<td><strong><!--[$zone|pnvarprepfordisplay]--></strong></td>
 	</tr>
 	<tr>
 		<td><!--[pnml name="_XA_TEMPLATE"]--></td>
@@ -19,9 +19,9 @@
 			<select name="tpl" id="tpl" size="1" tabindex="3">
 			<!--[section name=allzones loop=$allzones]-->  
 			<!--[if  $defaultzone eq $allzones[allzones].id ]-->
-				<option value="<!--[$allzones[allzones].id]-->" selected="selected"><!--[$allzones[allzones].name]--></option>
+				<option value="<!--[$allzones[allzones].id|pnvarprepfordisplay]-->" selected="selected"><!--[$allzones[allzones].name|pnvarprepfordisplay]--></option>
 			<!--[else]-->
-				<option value="<!--[$allzones[allzones].id]-->"><!--[$allzones[allzones].name]--></option>
+				<option value="<!--[$allzones[allzones].id|pnvarprepfordisplay]-->"><!--[$allzones[allzones].name|pnvarprepfordisplay]--></option>
 			<!--[/if]-->
 			<!--[/section]-->
 			</select>
diff -ruN 0.761/modules/Xanthia/pnuserapi.php 0.762/modules/Xanthia/pnuserapi.php
--- 0.761/modules/Xanthia/pnuserapi.php	2005-08-21 10:40:47.000000000 -0500
+++ 0.762/modules/Xanthia/pnuserapi.php	2006-01-27 13:10:53.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pnuserapi.php,v 1.62.2.15 2005/08/21 15:40:47 markwest Exp $
+// $Id: pnuserapi.php,v 1.62.2.15.2.1 2006/01/27 19:10:53 markwest Exp $
 // Xanthia Theme Engine FOR PostNuke Content Management System
 // Copyright (C) 2003 By Larry E. Masters, Shorewood, Illinois.
 // nut@phpnut.com
@@ -593,7 +593,7 @@
 					$modinfo['name'] = 'Core';
 				}
 
-				$pippo=pnVarPrepForStore($row['title']);
+				$pippo=preg_quote(pnVarPrepForStore($row['title']));
 				if ($includi == 'true') {
 					if (preg_match("/:$pippo:/i", $nonmostra))  {
 						echo pnBlockShow($modinfo['name'], $row['bkey'], $row);
diff -ruN 0.761/modules/Your_Account/user/modules/changeinfo.php 0.762/modules/Your_Account/user/modules/changeinfo.php
--- 0.761/modules/Your_Account/user/modules/changeinfo.php	2005-07-28 14:48:12.000000000 -0500
+++ 0.762/modules/Your_Account/user/modules/changeinfo.php	2005-12-11 14:40:23.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: changeinfo.php,v 1.5 2005/07/28 19:48:12 dabase Exp $
+// $Id: changeinfo.php,v 1.6 2005/12/11 20:40:23 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -46,7 +46,7 @@
 
     include('header.php');
     OpenTable();
-    echo $htmltext;
+    echo '<h2>'.pnVarPrepForDisplay($htmltext).'</h2>';
     echo '<h2>' . _PERSONALINFO . '</h2>';
     CloseTable();
 
@@ -294,10 +294,10 @@
         $uname = pnUserGetVar('uname');
 
         if ((isset($pass)) && ("$pass" != "$vpass")) {
-            $htmltext = '<h2>' . _PASSDIFFERENT . '</h2>';
+            $htmltext = '' . _PASSDIFFERENT . '';
             edituser($htmltext);
         } elseif (($pass != '') && (strlen($pass) < $minpass)) {
-            $htmltext = '<h2>' . _YOURPASSMUSTBE . " $minpass " . _CHARLONG . '</h2>';
+            $htmltext = '' . _YOURPASSMUSTBE . " $minpass " . _CHARLONG . '';
             edituser($htmltext);
         } else {
             if ($bio) {
diff -ruN 0.761/pntables.php 0.762/pntables.php
--- 0.761/pntables.php	2005-02-04 00:30:16.000000000 -0600
+++ 0.762/pntables.php	2006-01-12 05:21:08.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: pntables.php,v 1.5 2005/02/04 06:30:16 jorg Exp $
+// File: $Id: pntables.php,v 1.6 2006/01/12 11:21:08 landseer Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -280,23 +280,6 @@
                                   'ttype'     => $hooks . '.pn_ttype',
                                   'tfunc'     => $hooks . '.pn_tfunc');
 
-$languages_constant = $prefix.'_languages_constant';
-$pntable['languages_constant']    = $languages_constant;
-$pntable['languages_constant_column'] = array ('constant' => $languages_constant . '.pn_constant',
-                                               'file'     => $languages_constant . '.pn_file');
-
-$languages_file = $prefix.'_languages_file';
-$pntable['languages_file']     = $languages_file;
-$pntable['languages_file_column'] = array ('target' => $languages_file . '.pn_target',
-                                           'source' => $languages_file . '.pn_source');
-                                               
-$languages_translation = $prefix.'_languages_translation';
-$pntable['languages_translation'] = $languages_translation;
-$pntable['languages_translation_column'] = array ('language'    => $languages_translation . '.pn_language',
-                                                  'constant'    => $languages_translation . '.pn_constant',
-                                                  'translation' => $languages_translation . '.pn_translation',
-                                                  'level'       => $languages_translation . '.pn_level');
-
 $links_categories = $prefix . '_links_categories';
 $pntable['links_categories'] = $links_categories;
 $pntable['links_categories_column'] = array ('cat_id'       => $links_categories . '.pn_cat_id',
diff -ruN 0.761/print.php 0.762/print.php
--- 0.761/print.php	2005-02-04 00:30:16.000000000 -0600
+++ 0.762/print.php	2006-01-13 02:47:46.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: print.php,v 1.22 2005/02/04 06:30:16 jorg Exp $
+// File: $Id: print.php,v 1.24 2006/01/13 08:47:46 larsneo Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -33,6 +33,19 @@
 // get story id from input
 $sid = pnVarCleanFromInput('sid');
 
-pnRedirect('index.php?name=News&file=article&sid='.$sid.'&theme=Printer');
+if(empty($sid)  || !is_numeric($sid) || !pnModAvailable('News')) {
+    header('HTTP/1.0 404 Not Found');
+    include 'header.php';
+    echo _MODARGSERROR;
+    include 'footer.php';
+    exit;
+}
 
+if (!pnLocalReferer() && pnConfigGetVar('refereronprint')) {
+    Header('HTTP/1.1 301 Moved Permanently'); 
+    pnRedirect("index.php?name=News&file=article&sid=$sid");
+    exit;
+} else  {
+    pnRedirect('index.php?name=News&file=article&sid='.$sid.'&theme=Printer');
+}
 ?>
\ No newline at end of file
diff -ruN 0.761/robots.txt 0.762/robots.txt
--- 0.761/robots.txt	2004-05-12 13:08:52.000000000 -0500
+++ 0.762/robots.txt	2005-11-27 05:46:06.000000000 -0600
@@ -4,11 +4,8 @@
 Disallow: header
 Disallow: footer
 Disallow: pntables
-Disallow: referer
 Disallow: /images
 Disallow: /includes
-Disallow: /modules/NS-
-Disallow: /pnadodb
 Disallow: /themes
 Disallow: /pnTemp
 Disallow: /docs
diff -ruN 0.761/themes/ExtraLite/theme.php 0.762/themes/ExtraLite/theme.php
--- 0.761/themes/ExtraLite/theme.php	2005-08-27 07:33:04.000000000 -0500
+++ 0.762/themes/ExtraLite/theme.php	2006-01-07 11:44:02.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// File: $Id: theme.php,v 1.28 2005/08/27 12:33:04 markwest Exp $
+// File: $Id: theme.php,v 1.29 2006/01/07 17:44:02 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2001 by the PostNuke Development Team.
@@ -124,8 +124,10 @@
          "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td style=\"background-color:$GLOBALS[bgcolor1]\">\n" .
          "<h2>$preformat[catandtitle]</h2>\n" .
          _POSTEDBY . ": $info[informant] " . _ON . " $info[longdatetime]\n";
-    echo "<br /><a href=\"$links[searchtopic]\">$info[topicname]</a>&nbsp;\n" .
-         "</td></tr>\n" .
+    if (!empty($links['searchtopic'])) {
+        echo "<br /><a href=\"$links[searchtopic]\">$info[topicname]</a>&nbsp;\n";
+    }
+    echo "</td></tr>\n" .
          "<tr><td style=\"background-color:$GLOBALS[bgcolor1]\">\n" .
          "$info[hometext]\n<br /><br />$preformat[notes]\n<br /><br />\n" .
          "</td></tr>\n" .
@@ -150,9 +152,10 @@
             echo " [ <a href=\"admin.php?module=AddStory&amp;op=RemoveStory&amp;sid=$info[sid]\">" . _DELETE . "</a> ]";
         }
     }
-    echo "\n
-          <a href=\"$links[searchtopic]\">$info[topicname]</a>&nbsp;\n
-    </td></tr>\n<tr><td style=\"background-color:$GLOBALS[bgcolor1]\">\n
+    if (!empty($links['searchtopic'])) {
+        echo "<br /><a href=\"$links[searchtopic]\">$info[topicname]</a>&nbsp;\n";
+    }
+    echo "</td></tr>\n<tr><td style=\"background-color:$GLOBALS[bgcolor1]\">\n
     $preformat[fulltext]\n
     </td></tr></table>\n</td></tr></table><br />\n";
 }
diff -ruN 0.761/themes/Printer/plugins/function.footnotes.php 0.762/themes/Printer/plugins/function.footnotes.php
--- 0.761/themes/Printer/plugins/function.footnotes.php	2004-04-22 07:22:40.000000000 -0500
+++ 0.762/themes/Printer/plugins/function.footnotes.php	2005-12-16 07:44:37.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: function.footnotes.php,v 1.2 2004/04/22 12:22:40 drak Exp $
+// $Id: function.footnotes.php,v 1.2.2.1 2005/12/16 13:44:37 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -31,7 +31,7 @@
  *
  * @package      Xanthia_Templating_Environment
  * @subpackage   Xanthia
- * @version      $Id: function.footnotes.php,v 1.2 2004/04/22 12:22:40 drak Exp $
+ * @version      $Id: function.footnotes.php,v 1.2.2.1 2005/12/16 13:44:37 markwest Exp $
  * @author       The PostNuke development team
  * @link         http://www.postnuke.com  The PostNuke Home Page
  * @copyright    Copyright (C) 2002 by the PostNuke Development Team
@@ -57,12 +57,20 @@
 
 	if (is_array($link_arr) && !empty($link_arr)) {
 		foreach ($link_arr as $key => $link) {
+            // check for an e-mail address
+			if (eregi("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $link)) {
+                $linktext = $link;
+                $link = 'mailto:' . $link;
 			// append base URL for local links (not web links)
-			if (!preg_match("/^http:\/\//i",$link))	{
-			   $link = pnGetBaseURL().$link;
-			}
+            } elseif (!preg_match("/^http:\/\//i",$link))	{
+                $link = pnGetBaseURL().$link;
+                $linktext = $link;
+			} else {
+                $linktext = $link;
+            }
+            list($linktext, $link) = pnVarPrepForDisplay($linktext, $link);
 			// output link
-			$text .= "&nbsp;&nbsp;[".($key+1)."] <a class=\"print-normal\" href=\"".$link."\">".$link."</a><br />";
+			$text .= '&nbsp;&nbsp;['.($key+1).'] <a class="print-normal" href="'.$link.'">'.$linktext.'</a><br />'."\n";
 		}
 	}
 	return $text;
diff -ruN 0.761/themes/Printer/plugins/modifier.footnotes.php 0.762/themes/Printer/plugins/modifier.footnotes.php
--- 0.761/themes/Printer/plugins/modifier.footnotes.php	2004-04-22 07:22:40.000000000 -0500
+++ 0.762/themes/Printer/plugins/modifier.footnotes.php	2005-12-16 07:44:37.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: modifier.footnotes.php,v 1.2 2004/04/22 12:22:40 drak Exp $
+// $Id: modifier.footnotes.php,v 1.2.2.1 2005/12/16 13:44:37 markwest Exp $
 // ----------------------------------------------------------------------
 // PostNuke Content Management System
 // Copyright (C) 2002 by the PostNuke Development Team.
@@ -30,7 +30,7 @@
  *
  * @package      Xanthia_Templating_Environment
  * @subpackage   Xanthia
- * @version      $Id: modifier.footnotes.php,v 1.2 2004/04/22 12:22:40 drak Exp $
+ * @version      $Id: modifier.footnotes.php,v 1.2.2.1 2005/12/16 13:44:37 markwest Exp $
  * @author       The PostNuke development team
  * @link         http://www.postnuke.com  The PostNuke Home Page
  * @license      http://www.gnu.org/copyleft/gpl.html GNU General Public License
@@ -58,7 +58,7 @@
 
 	$link_arr = array();
 	// replace the links
-    $text = preg_replace_callback("/<a [^>]*href\s*=\s*\"?([^>\"]*)\"?[^>]*>(.*?)<\/a.*?>/i","Link_Callback",$string);
+    $text = preg_replace_callback('/<a [^>]*href\s*=\s*\"?([^>\"]*)\"?[^>]*>(.*?)<\/a.*?>/i','Link_Callback',$string);
 
 	return $text;
 }
@@ -68,12 +68,13 @@
 {
 	// globalise the links array
 	global $link_arr;
-	
+
 	// remember the link
-	$link_arr[] = $arr[1];
+    // TODO - work out why some links need decoding twice (&amp;amp;....)
+	$link_arr[] = html_entity_decode(html_entity_decode($arr[1]));
 	
 	// return the replaced link
-	return "<strong><u>".$arr[2]."</u></strong> <small>[".count($link_arr)."]</small>";
+	return '<strong><u>'.$arr[2].'</u></strong> <small>['.count($link_arr).']</small>';
 }
 
 ?>
\ No newline at end of file
diff -ruN 0.761/themes/Printer/templates/master.htm 0.762/themes/Printer/templates/master.htm
--- 0.761/themes/Printer/templates/master.htm	2005-01-19 07:16:02.000000000 -0600
+++ 0.762/themes/Printer/templates/master.htm	2005-10-18 06:53:27.000000000 -0500
@@ -20,7 +20,7 @@
 <!--[additional_header]-->
 </head>
 <body>
-<div style="text-align:center"><img src="<!--[$imagepath]-->/logo.gif" /></div>
+<div style="text-align:center"><img src="<!--[$imagepath]-->/logo.gif" alt="" title="<!--[pnconfiggetvar name=sitename]-->" /></div>
 <!--[$maincontent|footnotes]-->
 <div><strong><!--[pnml name="_LINKS"]--></strong></div>
 <!--[footnotes]-->
