diff -ruN 2.2.3a-Final.src/admin.php 2.2.6.src/admin.php
--- 2.2.3a-Final.src/admin.php	2005-07-25 20:54:11.000000000 -0500
+++ 2.2.6.src/admin.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: admin.php,v 1.11.6.7 2005/07/26 02:54:11 phppp Exp $
+// $Id: admin.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/backend.php 2.2.6.src/backend.php
--- 2.2.3a-Final.src/backend.php	2004-12-26 13:11:47.000000000 -0600
+++ 2.2.6.src/backend.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: backend.php,v 1.13 2004/12/26 19:11:47 onokazu Exp $
+// $Id: backend.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/banners.php 2.2.6.src/banners.php
--- 2.2.3a-Final.src/banners.php	2005-03-31 11:39:24.000000000 -0600
+++ 2.2.6.src/banners.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: banners.php,v 1.14.4.4.2.2 2005/03/31 18:39:24 mithyt2 Exp $
+// $Id: banners.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -86,7 +86,7 @@
                 <td class='b_td'><b>Imp. Left</b></td>
                 <td class='b_td'><b>Clicks</b></td>
                 <td class='b_td'><b>% Clicks</b></td>
-                <td class='b_td'><b>Functions</b></td><tr>";
+                <td class='b_td'><b>Functions</b></td></tr>";
             $result = $xoopsDB->query("select bid, imptotal, impmade, clicks, date from ".$xoopsDB->prefix("banner")." where cid=$cid");
             while ( list($bid, $imptotal, $impmade, $clicks, $date) = $xoopsDB->fetchRow($result) ) {
                 if ( $impmade == 0 ) {
@@ -99,13 +99,13 @@
                 } else {
                     $left = $imptotal-$impmade;
                 }
-                echo "<td align='center'>$bid</td>
+                echo "<tr><td align='center'>$bid</td>
                 <td align='center'>$impmade</td>
                 <td align='center'>$imptotal</td>
                 <td align='center'>$left</td>
                 <td align='center'>$clicks</td>
                 <td align='center'>$percent%</td>
-                <td align='center'><a href='banners.php?op=EmailStats&amp;login=$login&amp;pass=$pass&amp;cid=$cid&amp;bid=$bid&amp;t=".$GLOBALS['xoopsSecurity']->createToken()."'>E-mail Stats</a></td><tr>";
+                <td align='center'><a href='banners.php?op=EmailStats&amp;login=$login&amp;pass=$pass&amp;cid=$cid&amp;bid=$bid&amp;t=".$GLOBALS['xoopsSecurity']->createToken()."'>E-mail Stats</a></td></tr>";
             }
             echo "</table><br /><br /><div>Following are your running Banners in ".$xoopsConfig['sitename']." </div><br /><br />";
             $result = $xoopsDB->query("select bid, imageurl, clickurl, htmlbanner, htmlcode from ".$xoopsDB->prefix("banner")." where cid=$cid");
diff -ruN 2.2.3a-Final.src/cache/profilefields.tmp 2.2.6.src/cache/profilefields.tmp
--- 2.2.3a-Final.src/cache/profilefields.tmp	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/cache/profilefields.tmp	2008-01-17 08:14:03.000000000 -0600
@@ -0,0 +1 @@
+a:25:{s:5:"umode";a:16:{i:0;s:1:"1";i:1;s:6:"select";i:2;s:1:"7";i:3;s:5:"umode";i:4;s:21:"Comments Display Mode";i:5;s:0:"";i:6;s:1:"0";i:7;s:1:"0";i:8;s:0:"";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"0";i:13;s:1:"0";i:14;a:3:{s:4:"nest";s:6:"Nested";s:4:"flat";s:4:"Flat";s:6:"thread";s:8:"Threaded";}i:15;s:1:"0";}s:6:"uorder";a:16:{i:0;s:1:"2";i:1;s:6:"select";i:2;s:1:"7";i:3;s:6:"uorder";i:4;s:19:"Comments Sort Order";i:5;s:0:"";i:6;s:1:"0";i:7;s:1:"0";i:8;s:0:"";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"0";i:13;s:1:"0";i:14;a:2:{i:0;s:12:"Oldest First";i:1;s:12:"Newest First";}i:15;s:1:"0";}s:13:"notify_method";a:16:{i:0;s:1:"3";i:1;s:6:"select";i:2;s:1:"7";i:3;s:13:"notify_method";i:4;s:19:"Notification Method";i:5;s:86:"When you monitor e.g. a forum, how would you like to receive notifications of updates?";i:6;s:1:"0";i:7;s:1:"0";i:8;s:0:"";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"0";i:13;s:1:"0";i:14;a:3:{i:0;s:19:"Temporarily Disable";i:1;s:15:"Private Message";i:2;s:33:"Email (use address in my profile)";}i:15;s:1:"0";}s:11:"notify_mode";a:16:{i:0;s:1:"4";i:1;s:6:"select";i:2;s:1:"7";i:3;s:11:"notify_mode";i:4;s:25:"Default Notification Mode";i:5;s:0:"";i:6;s:1:"0";i:7;s:1:"0";i:8;s:0:"";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"0";i:13;s:1:"0";i:14;a:3:{i:0;s:33:"Notify me of all selected updates";i:1;s:19:"Notify me only once";i:2;s:48:"Notify me once then disable until I log in again";}i:15;s:1:"0";}s:12:"user_regdate";a:16:{i:0;s:1:"5";i:1;s:4:"date";i:2;s:1:"3";i:3;s:12:"user_regdate";i:4;s:12:"Member Since";i:5;s:0:"";i:6;s:1:"0";i:7;s:2:"10";i:8;s:1:"0";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"0";i:12;s:1:"1";i:13;s:1:"0";i:14;a:0:{}i:15;s:1:"0";}s:5:"posts";a:16:{i:0;s:1:"6";i:1;s:7:"textbox";i:2;s:1:"3";i:3;s:5:"posts";i:4;s:5:"Posts";i:5;s:0:"";i:6;s:1:"0";i:7;s:2:"10";i:8;s:1:"0";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"0";i:12;s:1:"1";i:13;s:1:"0";i:14;a:0:{}i:15;s:1:"0";}s:9:"attachsig";a:16:{i:0;s:1:"7";i:1;s:5:"yesno";i:2;s:1:"3";i:3;s:9:"attachsig";i:4;s:26:"Always attach my signature";i:5;s:0:"";i:6;s:1:"0";i:7;s:1:"1";i:8;s:0:"";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"0";i:13;s:1:"0";i:14;a:0:{}i:15;s:1:"0";}s:15:"timezone_offset";a:16:{i:0;s:1:"8";i:1;s:8:"timezone";i:2;s:1:"1";i:3;s:15:"timezone_offset";i:4;s:9:"Time Zone";i:5;s:0:"";i:6;s:1:"0";i:7;s:3:"255";i:8;s:0:"";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"0";i:13;s:1:"0";i:14;a:0:{}i:15;s:1:"0";}s:11:"user_mailok";a:16:{i:0;s:1:"9";i:1;s:5:"yesno";i:2;s:1:"3";i:3;s:11:"user_mailok";i:4;s:33:"Receive occasional email notices?";i:5;s:102:"By enabling this, administrators and moderators are allowed to send you notices occasionally via email";i:6;s:1:"0";i:7;s:1:"1";i:8;s:1:"1";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"0";i:13;s:1:"0";i:14;a:0:{}i:15;s:1:"0";}s:5:"theme";a:16:{i:0;s:2:"10";i:1;s:5:"theme";i:2;s:1:"1";i:3;s:5:"theme";i:4;s:5:"Theme";i:5;s:0:"";i:6;s:1:"0";i:7;s:3:"255";i:8;s:1:"0";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"0";i:13;s:1:"0";i:14;a:0:{}i:15;s:1:"0";}s:6:"actkey";a:16:{i:0;s:2:"11";i:1;s:7:"textbox";i:2;s:1:"7";i:3;s:6:"actkey";i:4;s:19:"User activation key";i:5;s:0:"";i:6;s:1:"0";i:7;s:1:"0";i:8;s:0:"";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"0";i:12;s:1:"0";i:13;s:1:"0";i:14;a:0:{}i:15;s:1:"0";}s:10:"last_login";a:16:{i:0;s:2:"12";i:1;s:4:"date";i:2;s:1:"3";i:3;s:10:"last_login";i:4;s:10:"Last Login";i:5;s:0:"";i:6;s:1:"0";i:7;s:2:"10";i:8;s:0:"";i:9;s:1:"1";i:10;s:1:"1";i:11;s:1:"0";i:12;s:1:"1";i:13;s:1:"0";i:14;a:0:{}i:15;s:1:"0";}s:7:"pm_link";a:16:{i:0;s:2:"13";i:1;s:8:"autotext";i:2;s:1:"2";i:3;s:7:"pm_link";i:4;s:7:"PM Link";i:5;s:50:"Shows a link to send a private message to the user";i:6;s:1:"0";i:7;s:1:"0";i:8;s:240:"<a href="javascript:openWithSelfMain('{X_URL}/modules/pm/pmlite.php?send2=1&to_userid={X_UID}', 'pmlite', 550, 450);" title="Write a message to {X_UNAME}"><img src="{X_URL}/modules/pm/images/pm.gif" alt="Write a message to {X_UNAME}" /></a>";i:9;s:1:"2";i:10;s:1:"1";i:11;s:1:"0";i:12;s:1:"1";i:13;s:1:"0";i:14;a:0:{}i:15;s:1:"0";}s:8:"user_aim";a:16:{i:0;s:2:"14";i:1;s:7:"textbox";i:2;s:1:"1";i:3;s:8:"user_aim";i:4;s:3:"AIM";i:5;s:42:"America Online Instant Messenger Client ID";i:6;s:1:"0";i:7;s:3:"255";i:8;s:0:"";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;a:0:{}i:15;s:1:"0";}s:8:"user_icq";a:16:{i:0;s:2:"15";i:1;s:7:"textbox";i:2;s:1:"1";i:3;s:8:"user_icq";i:4;s:3:"ICQ";i:5;s:24:"ICQ Instant Messenger ID";i:6;s:1:"0";i:7;s:3:"255";i:8;s:0:"";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;a:0:{}i:15;s:1:"0";}s:9:"user_from";a:16:{i:0;s:2:"16";i:1;s:7:"textbox";i:2;s:1:"1";i:3;s:9:"user_from";i:4;s:8:"Location";i:5;s:0:"";i:6;s:1:"0";i:7;s:3:"255";i:8;s:0:"";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;a:0:{}i:15;s:1:"0";}s:8:"user_sig";a:16:{i:0;s:2:"17";i:1;s:5:"dhtml";i:2;s:1:"2";i:3;s:8:"user_sig";i:4;s:9:"Signature";i:5;s:88:"Here, you can write a signature that can be displayed in your forum posts, comments etc.";i:6;s:1:"0";i:7;s:1:"0";i:8;s:0:"";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;a:0:{}i:15;s:1:"0";}s:14:"user_viewemail";a:16:{i:0;s:2:"18";i:1;s:5:"yesno";i:2;s:1:"3";i:3;s:14:"user_viewemail";i:4;s:42:"Allow other users to view my email address";i:5;s:0:"";i:6;s:1:"0";i:7;s:1:"1";i:8;s:1:"0";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"0";i:13;s:1:"0";i:14;a:0:{}i:15;s:1:"0";}s:8:"user_yim";a:16:{i:0;s:2:"19";i:1;s:7:"textbox";i:2;s:1:"1";i:3;s:8:"user_yim";i:4;s:3:"YIM";i:5;s:27:"Yahoo! Instant Messenger ID";i:6;s:1:"0";i:7;s:3:"255";i:8;s:0:"";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;a:0:{}i:15;s:1:"0";}s:9:"user_msnm";a:16:{i:0;s:2:"20";i:1;s:7:"textbox";i:2;s:1:"1";i:3;s:9:"user_msnm";i:4;s:3:"MSN";i:5;s:22:"Microsoft Messenger ID";i:6;s:1:"0";i:7;s:3:"255";i:8;s:0:"";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;a:0:{}i:15;s:1:"0";}s:3:"bio";a:16:{i:0;s:2:"21";i:1;s:8:"textarea";i:2;s:1:"2";i:3;s:3:"bio";i:4;s:10:"Extra Info";i:5;s:0:"";i:6;s:1:"0";i:7;s:1:"0";i:8;s:0:"";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;a:0:{}i:15;s:1:"0";}s:12:"user_intrest";a:16:{i:0;s:2:"22";i:1;s:7:"textbox";i:2;s:1:"1";i:3;s:12:"user_intrest";i:4;s:9:"Interests";i:5;s:0:"";i:6;s:1:"0";i:7;s:3:"150";i:8;s:0:"";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;a:0:{}i:15;s:1:"0";}s:8:"user_occ";a:16:{i:0;s:2:"23";i:1;s:7:"textbox";i:2;s:1:"1";i:3;s:8:"user_occ";i:4;s:10:"Occupation";i:5;s:0:"";i:6;s:1:"0";i:7;s:3:"100";i:8;s:0:"";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;a:0:{}i:15;s:1:"0";}s:3:"url";a:16:{i:0;s:2:"24";i:1;s:7:"textbox";i:2;s:1:"4";i:3;s:3:"url";i:4;s:7:"Website";i:5;s:0:"";i:6;s:1:"0";i:7;s:3:"100";i:8;s:0:"";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"1";i:12;s:1:"1";i:13;s:1:"1";i:14;a:0:{}i:15;s:1:"0";}s:8:"newemail";a:16:{i:0;s:2:"25";i:1;s:7:"textbox";i:2;s:1:"5";i:3;s:8:"newemail";i:4;s:9:"New Email";i:5;s:142:"Variable for storing a proposed new email address until confirmation comes from a mail sent to the old one. See modules/profile/changemail.php";i:6;s:1:"0";i:7;s:3:"100";i:8;s:0:"";i:9;s:1:"3";i:10;s:1:"1";i:11;s:1:"0";i:12;s:1:"0";i:13;s:1:"0";i:14;a:0:{}i:15;s:1:"0";}}
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/changelog.txt 2.2.6.src/changelog.txt
--- 2.2.3a-Final.src/changelog.txt	2005-10-29 02:11:34.000000000 -0500
+++ 2.2.6.src/changelog.txt	1969-12-31 18:00:00.000000000 -0600
@@ -1,586 +0,0 @@
-============================
-2005/10/30: Version 2.2.3 Final
-============================
-- SECURITY: Fix to prevent mail headers injection (Skalpa/XOOPS Cube)
-- SECURITY: Fix to prevent endless loop in PHPMailer (Skalpa/Minahito)
-- SECURITY: Fix to prevent XSS in the textsanitizer (Skalpa/XOOPS Cube)
-- SECURITY: Fix to prevent XSS in newbb and the comments system (Skalpa/Keigo Yamazaki of Little eArth Corporation Co., Ltd.)
-- SECURITY: Vaporfix to prevent uploading of invalid images (Skalpa/XOOPS Cube)
-
-- Added fallback in Authfactory to use XOOPS auth in case of the selected method's class file is inaccessible (phppp)
-- Changed quoteString() to put ' on all non-integers instead of just all strings (Mithrandir)
-- Changed XTheme::display() to use caching correctly and set page title and module header from $xoopsOption (phppp)
-- Fixed typo in XTheme::addCSS where <script> was used instead of <style> (phppp)
-- Added explanatory comments in XTheme::loadTheme and fixed $xoopsRequestUri to the correct $_SERVER['REQUEST_URI'] (phppp)
-- Added missing global declaration of $xoopsLogger in XTheme::checkCache() (phppp)
-- Fixed typos in class/xml/xmlatomparser.php and modules/profile/search.php (phppp/ymbo @ Xoops China)
-- Added patch #1267386 - Group perm form improvement (phppp/zollou)
-- Added {LOGINNAME} to mailer string-replace routine (Mithrandir)
-- Fixed bug #1285967 - bug with http://IP:PORT/ configured sites, XoopsSecurity::checkReferer now takes the port into consideration (phppp)
-- Added global declaration of $xoopsTpl in footer.php (phppp)
-- Changed include/checklogin.php to disallow everyone with a level below 1 instead of equalling zero (disabled users have level -1) (Mithrandir)
-- Cosmetic changes in xoops_confirm() function in include/functions.php (phppp)
-- Fixed bug/typo in include/functions.php function xoops_array_diff_assoc() (phppp)
-- Fixed bug in system installation where login, main menu and user menu blocks were not created correctly (Mithrandir)
-- Added pre-selected modules for the step of module selection and language files for the step of module installation (phppp)
-- Block bid assignment added so both block and instance has the right value for bid in XoopsBlockInstanceHandler::getLinkedObjects() (phppp)
-- Modified kernel/module.php regexp for page detection in getCurrentPage() (phppp)
-- Changed order of error messages in module installation (phppp)
-- Fixed bug in kernel/module.php where config unused options would not be removed if a config has no options any more (phppp)
-- Fixed bug in kernel/object.php where whereclause is wrongly generated for multiple keyname (phppp)
-- Fixed missing language definition for profile edit by adding multi-languge processing for profile fields in kernel/profilefield.php (phppp)
-- Added missing process for forcing update profile data in kernel/profilefield.php "function loadFields" (phppp)
-- Changed custom time computation in XoopsLocal class language/english/local.php (phppp)
-- Fixed lostpass.php to properly set new password when clicking on e-mailed link (Mithrandir)
-- Fixed bug #1276917 - 2.2.3: Edit User won't save Group change
-- Fixed bug #1262813 - Add User, some fields are reset when error occur (Mithrandir/marook)
-- Added password length check in modules/profile/register.php (phppp/Aries)
-- Modified error message rendering in modules/profile/register.php (phppp)
-- Fixed bug #1250347 - search in profiles doesnt work properly (Mithrandir/irmtfan)
-- Fixed bug #1247398 - Error in modules/profile/search.php (Mithrandir/edomch)
-- Added button to change password in user profile (phppp)
-- Fixed bug in system/admin/banners/main.php where it was impossible to edit banner clients (Mithrandir/Peekay)
-- Fixed bug #1253289 - Can't make blocks invisible (Mithrandir/barrycooper)
-- Added safety in blocks administration for blocks that come from modules that no longer exist (database inconsistency) (Mithrandir)
-- Added safety in template administration for templates that come from modules that no longer exist (database inconsistency) (Mithrandir)
-- XHTML Fix in XMT theme (phppp)
-- Added overflow treatment for xoopsCode/xoopsQuote (phppp)
-- Added update procedure to System module update, where blocks and templates without corresponding modules will be removed (Mithrandir)
-- Fixed deprecated variable ("name" => "uname") in system/blocks/system_blocks.php function b_system_info_show() (phppp)
-- Added Patch #1281295 - wrong error_reporting in smilies administration (phppp/birdseed)
-- Fixed bug in system/admin/modulesadmin/modulesadmin.php where configuration categories were not removed on module uninstallation (Mithrandir)
-- Fixed bug in system/admin/modulesadmin/modulesadmin.php where block templates could remain in the database after module uninstall (Mithrandir)
-- Interface improvements in module installation (phppp)
-- Changed XoopsFormSelectUser constructor signature to follow convention from XOOPS 2.0.x (Mithrandir)
-- Moved hidden fields from bottom of <form> tag to the top in XoopsThemeForm::render() for backwards compatibility and XHTML compliance (Mithrandir)
-- Changed XOOPS_URL detection and checking during installation to require an absolute URI and not a relative one (Mithrandir)
-- Fixed the mysql class quoteString() so it unconditionnally quotes the parameter again (back to 2.0.x behavior) (Skalpa)
-- Fixed handling of array vars in XPOH insert and insertAll (Skalpa)
-- Fixed bad references use in XoopsObject and XOPH classes (Skalpa)
-- Fixed bad references use in sanitizer (Skalpa)
-- Fixed bad references use in installer sanitizer (Skalpa)
-- Fixed user search in Extended Profile module, when searching for values in select and radio type fields (Mithrandir/miscellone)
-- Fixed Bug #1294569 - Magic Quote Issue when registering users, additional slashes were added (Mithrandir/Monique)
-- Fixed bug where profiles would not be deleted on user deletion (Mithrandir)
-- Added routine to System Module update to set default values for comments, timezone and theme fields to system values (phppp)
-- Fixed Bug #1298674 - Block caching isn't running (Mithrandir/mcleines)
-- Fixed Bug #1303864 - Delete user account frontside(Mithrandir/MarcoFr)
-- Fixed Bug #1303810 - Main admin account deletion control 2.2.3RC2 (Mithrandir/MarcoFr)
-- Fixed Bug #1262806 - 2.2.x: Default TZ is not used in Add User (Mithrandir/Marook)
-- Fixed Bug #1306176 - 2.2.3RC2 - User update fails (Mithrandir/rlinfoot)
-- Changed module installation and update routine so it now halts, when xoops_module_pre_xxx function fails (Mithrandir)
-- Fixed security problem in Koivi editor (phppp/Marijuana)
-
-============================
-2005/08/12: Version 2.2.2
-============================
-- SECURITY: Fixed several path disclosure issues (Mithrandir/ajaxbr+Dave_l)
-- Fixed bug #1253433 - Outbox to-link wrong (Mithrandir/Dave_l)
-- Fixed bug #1256352 - insertConfigCategories (Mithrandir/Pnooka)
-- Fixed bug #1255004 - malformed uri in class/theme.php (Mithrandir/Frankblack)
-- Fixed bug #1252898 - SMTP, SMTPAuth Fsockopen error (Mithrandir/fatalsaint)
-- Fixed wrong call to loginUser() with uname instead of loginname (Mithrandir/ef11cornell)
-- Fixed bug #1249880 - Change Email function can't be disabled (Mithrandir/Dave_l)
-- Added "font styles" to language files in xoopseditor/koivi (phppp)
-- Added empty $text check for encoding conversion in languages/english/local.php  (phppp)
-- Removed language files other than English (phppp)
-
-============================
-2005/08/08: Version 2.2.1
-============================
-- Manually applied the PHPMailer 1.73 SMTP fix to prevent potential issues (skalpa)
-- Fixed a bug in the installer that could prevent mainfile.php to be created correctly on PHP5 (skalpa)
-- Moved module-admin item to the top of the admin menu (phppp)
-- Fixed a typo for constant variable check in error.php (phppp)
-- Commented out the "showrblock" from functions.php (phppp)
-- Added error message for user not found in auth service (phppp)
-- Corrected Header set Charset in installer (phppp)
-- Moved auth language defination to its right place (phppp)
-- Fixed typo in XoopsLogger->addblock (phppp)
-- Minor fix on reference usage in textsanitizer (phppp)
-- Changed default config for use-realname to false (phppp)
-- Fixed loginUserMd5() typo in member handler (phppp)
-- Changed reference to make it work when calling another module's install on a module's update  (phppp)
-- Rolled back system-info block (phppp)
-- Dix for icon url in comment block (phppp)
-- Add new PM prompt to user-menu block (phppp)
-- Changed user name (which is not always available and not much infomative) to user uname in userselect (phppp)
-- Added install function for inserting PM link to existing users' profile (phppp)
-- Ensure to use username and not real name in PM composer (phppp)
-- PM module: Bugfix for setting message as "read" (phppp)
-- PM module: Bugfix for icon url (phppp)
-- Fix to display profile items with value only in userinfo page (phppp)
-- Fix where language file was not included in profile activation page (phppp)
-- Fix for error message in changemail (phppp)
-- Fixed problems with Admin right in edituser.php (phppp)
-- Added possibility for admin to change users email (phppp)
-
-============================
-2005/07/27: Version 2.2
-============================
-
-???
-
-============================
-2005/07/21: Version 2.2 RC2
-============================
-- Fixed registration issues with dynamic user profile fields (Mithrandir)
-- Added login name property for a user, so login name and displayed username is now (potentially) differerent (Mithrandir)
-- Refinements in PM module (phppp)
-- Refinements in Profile module (Mithrandir)
-- Refinements in XoopsForm classes (phppp)
-- Fixed bug where comments would not show if the user had no settings for mode and order (Mithrandir/Rowdie)
-- Fixed bug in LDAP authentication where configuration values were not fetched correctly (Mithrandir)
-
-Language constant changes:
-- _PROFILE_MA_REALNAME added to modules/profile/language/english/main.php
-- _PM_RUSUREEMPTY and _PM_RUSUREDELETE added to modules/pm/language/english/main.php
-- _INSTALL_L37 and _INSTALL_L167 added to install/language/english/install.php
-- {X_UNAME} changed to {LOGINNAME} in language/english/mail_template/lostpass2.tpl
-============================
-2005/07/14: Version 2.2 RC
-============================
-- Fixed security hole in XML-RPC for both magic_quotes_gpc on and off (Mithrandir/James@Gulftech, Onokazu)
-- Fixed sanitation in Criteria class for both magic_quotes_gpc on and off (Mithrandir/Onokazu)
-- Fixed sanitation bug in include/checklogin.php (Mithrandir)
-- Fixed bug in comments, where editing a comment would post a new one
-- Removed PHP parsing in Saxparser's handleProcessingInstruction() method (Thanks to GIJOE)
-- Fixed parse error in modules/newbb/post.php
-- Fixed sanitation bug in include/comment_form.php and include/comment_post.php (Mithrandir/James@Gulftech)
-- Fixed sanitation bug in class/xml/rpc/xmlrpcapi.php and class/criteria.php (Mithrandir/James@Gulftech/XOOPS JP)
-- Changed admin.php to fetch news from xoops.org via Snoopy (Mithrandir/XOOPS JP)
-- Fixed possible XSS hole in redirect_header (Mithrandir/XOOPS JP)
-- Security fixes in pda.php and misc.php (Mithrandir/XOOPS JP)
-- Fixed typos in kernel/object.php (Mithrandir/brandycoke)
-- Fixed bug where lostpass.php would not accept emails and send new password (Ackbarr)
-- Fixed bug where search result links would be wrong if the item was in another module than the searched one (Ackbarr)
-- Fixed bug in groups admin where it was impossible to add users to a group if the site had 200+ users (Ackbarr)
-- Fixed bug with uploading smilies (Ackbarr)
-
-Other Additions:
-- PM Module functionality expanded (phppp)
-
-============================
-2005/05/21: Version 2.1.1
-============================
-- Fixed bug #970474 - class/zipdownloader.php (Mithrandir/AC-Ibu)
-- Fixed bug #1087786 - Can't assign to $this in PHP5 (Mithrandir)
-- Fixed bug #1156510 - Typo Fixes in XoopsObject (Mithrandir/NS Tai, Brandycoke)
-- Fixed bug #962025 - Word Censoring Options (Mithrandir/Tom Hayakawa)
-- Fixed bug #1168850 - activateUser method is not used in admin panel (Mithrandir/Andrey)
-- Fixed bug #1167596 - Hardcoded texts in XoopsObject (Mithrandir/hthouzard)
-- Fixed bug #1166354 - image.php - undefined constant (Mithrandir/dave_l)
-- Fixed bug #1164226 - improvement in function xoops_refcheck (Mithrandir/sudhaker)
-- Fixed bug #1163599 - Big sessions error (Mithrandir)
-- Fixed bug #1162290 - The xoops_config (config_id field) reaches its max (Mithrandir)
-- Fixed bug #1151930 - index.php - use "require" instead of "include" (Mithrandir/dave_l)
-- Fixed bug #1144690 - XoopsFormHidden does not conform HTML rule (Mithrandir/suin)
-- Fixed bug #1122854 - cannot be set up version 2.05 of module (Mithrandir/ohwada)
-- Fixed bug #1122253 - show notice message when post comment (Mithrandir/ohwada)
-- Fixed bug #1120729 - xoops_footer not in default theme (Mithrandir/dave_l)
-- Fixed bug #1118908 - 1 html-bug in xoopscodes.php (Mithrandir/frankblack)
-- Fixed bug #1098445 - problem with clickable links (dave_l/hthouzard)
-- Fixed bug #1083928 - XoopsErrorHandler_HandleError - regex usage (Mithrandir/dave_l)
-- Fixed bug #1082042 - Error in parsing date in calendar.js (Mithrandir/puff_daweed)
-- Fixed bug #1059216 - gzip compression & php debugging Conflict  (Mithrandir/Liquid, WF)
-- Fixed bug #1054221 - xoops_module_header can not be cached (Mithrandir/phppp)
-- Fixed bug #1020494 - Uninformative error message if admin passwords differ (Mithrandir)
-- Fixed bug #1014438 - Admin popup menu when mouse over (Mithrandir)
-- Fixed bug #1014408 - XoopsGroupPermForm forms req. sys admin rights to use (Mithrandir/jegelstaff)
-- Fixed bug #1011296 - include/checklogin.php calculates a wrong url (Mithrandir/puntoexe)
-- Fixed bug #980100 - Variable substitution in db password  (dave_l/dcinege)
-- Fixed bug #973918 - showImgSelected - Proposed change (Mithrandir)
-- Fixed bug #972552 - stopping install without error message (PHP without mysql) (Mithrandir/snagai)
-- Fixed bug #894799 - [fix] No JS validation of required fields in PM (Mithrandir/masi)
-- Fixed bug - Don't show preferences link to users without permission (Mithrandir)
-- Fixed bug #1174230 - wrong formatTimestamp() syntax in formtextdateselect.php (Mithrandir/ZPC)
-- Fixed bug #967076 - xoops_version and templates! (Mithrandir/w4z004)
-- Fixed bug #1174626 - phpkaox style sheet (Mithrandir/wardick)
-- Fixed bug #1196034 - getSmileys (Mithrandir/phppp)
-
-- Added patch #1162913 - xoops_getLinkedUnameFromId (Mithrandir/hthouzard)
-- Added patch #1124749 - Module cache and one-column full-screen display (Mithrandir/phppp)
-- Added patch #1105492 - CSS for backend.php (system_rss.html) (Mithrandir/ajaksu2)
-- Added patch #1099086 - who's online popup (Mithrandir/banned)
-- Added patch #1096514 - Activation of new user (Mithrandir/gibaphp)
-- Added patch #1090132 - functions.php, redirect_header (Mithrandir/banned)
-- Added patch #1065669 - Slight enhancement to XoopsPageNav::renderImageNav() (Mithrandir)
-- Added patch #1052866 - language detection in install.php (Mithrandir/phppp)
-- Added patch #989376 - Use REQUEST_URI instead of PHP_SELF generally (Mithrandir/mrmx)
-- Added patch #944710 - Extra Cookie for the newbb (Mithrandir/Predator)
-- Added patch #912823 - Saving one query per request (Mithrandir/sudhaker)
-- Added patch #963071 - Random password generator (Mithrandir/dave_l)
-- Added patch #1056514 - SQL Generation Time (Mithrandir/bd_csms)
-- Added patch #920059 - XOOPS reports why people can't login (Mithrandir/Herko)
-- Added patch #1181607 - Update jsCalendar to 1.0 (Mithrandir/reddshack)
-- Added patch #1181328 - Getting rid of negative information on search results page (Mithrandir/frankblack)
-- Added patch #1077123 - Make YYYY-mm-dd default for dateboxes when no date passed (Mithrandir/jegelstaff)
-- Added patch #1194690 - Show all required fields in every forms (Mithrandir/hthouzard)
-- Added patch #919353 - Permanent selectable theme (Mithrandir/frankblack)
-- Added patch #1019464 - Extended renderldap function in class criteria (Mithrandir/pemen)
-
-Other fixes:
-- Search block now defaults to searching in current module (Mithrandir)
-- XoopsPersistableObjectHandler added, making it much easier making database access classes (Mithrandir)
-- Fixed rare case, where search results that gave full path would have XOOPS_URL."/modules/dirname" prepended - Only relevant for modules that search other modules (Mithrandir)
-
-Additions:
-- Dynamic User Profiles (Mithrandir/Ackbarr)
-- Administration area themeable + new theme (Ralf57)
-- Error page when referer is blocked and the user attempts to change content in the database (Mithrandir)
-- Configuration categories - modules can now categorise their configuration items (Mithrandir/Malanciault)
-- XoopsUser::uname is now used solely for login purposes, real name is used for display on screen (Mithrandir)
-- PM functionality moved into a module instead of in the core (Mithrandir/Wanikoo)
-
-
-============================
-2005/04/23: Version 2.0.10
-============================
-- Fixed typo in newbb/post.php
-
-============================
-2005/04/03: Version 2.0.10 RC
-============================
-- Implemented new token system for validating form origination and increased protection against CSRF (Mithrandir/Onokazu)
-- Security fix to avoid the usage of fopen and unlink when previewing (Onokazu)
-- Fixed bug - Missing </a> in news/templates/blocks/news_block_bigstory.html (Mithrandir/blacKurd)
-- Fixed bug in header.php  assign $xoops_lblocks (Mithrandir/phppp)
-- Fixed bug #1087786 Can"t assign to $this in PHP5 (Mithrandir)
-- Included 2.0.9.3 fixes in 2.0.10 patch for easy upgrade from 2.0.9.2 (Mithrandir/rowd)
-- Fixed bug #1157029 - Bug in include/checklogin.php (Onokazu/sudhaker)
-- Fixed bug #1060061 - renderValidationJS showing htmlentities instead of intended characters (Onokazu/theCat)
-
-2005/03/20: Version 2.0.9.3
-===============================
-- Security fix to prevent uploading of executable files (pokleyzz, GIJOE and the JP XOOPS community)
-
-2004/12/30: Version 2.0.9.2
-===============================
-- Security fix to prevent session hijacking (thanks goes to GIJOE and the JP XOOPS community)
-- Fixed duplicated blocks bug on module update
-- phpmailer back to the version included in 2.0.7.3, as it is more stable (onokazu)
-
-
-2004/12/25: Version 2.0.9
-===============================
-- Security fix in the newbb module for PHP version < 4.3.10 (GIJOE & onokazu)
-- Security fix in the newbb module to prevent XSS attacks (minahito)
-- Fixed various problems related to XoopsUser::isAdmin() and $xoops_isadmin patch in 2.0.7.1 (bugs #1014203/#1014403) (onokazu)
-- Fixed incorrect parameters being passed to CriteriaCompo in modulesadmin.php (onokazu)
-- Fixed incorrect parameters being passed to XoopsXmlRpcStruct::add() in BloggerApi::getUserInfo() (onokazu)
-- Fixed Bug #1023022 - XoopsFormDhtmlTextArea and array_push() error (Mithrandir)
-- Fixed Bug #1013989 - Inbox title shoud be plural "Private Messages" (Mithrandir)
-- Fixed Bug #1004998 - readpmsg.php typo:</th> html tag of subject is nothing (Mithrandir)
-- Fixed Bug #1035707 - Enable array type options in blocks (Mithrandir)
-- Fixed a typo in include/comment_form.php, patch #1041993 (Dave_l)
-- Fixed Bug #1044957 - xoopsmultimailer.php Username typo when SMTP-Auth (Mithrandir)
-- Fixed RFE #900348 - Sort user list alphabetically in System -> Groups. Also changed the way it fetches the users in the group so it fetches all of them with 2 queries instead of 1 + (1 per user in the group) (Mithrandir
-)
-- Added patch #1048384 - mysql_field_name and others, added (Mithrandir)
-- Fixed bug #1049017 - Blocks sharing a template are cached wrong (Mithrandir)
-- Added patch #1048382 - Module onUpdate function (Mithrandir)
-- Fixed bug #989462 - Handler object caching not working (Mithrandir)
-- Added RFE #900345 - View/Edit group membership in Admin -> System -> Edit User (Mithrandir)
-- Fixed Bug #1055901 - group.php(IN phrase is used ,query) (Mithrandir)
-- Fixed bug #1052403 - block update in module update (Mithrandir)
-- More fixes for register_globals off in the top 10 page of mylinks/mydownloads modules
-- Fixed a typo in modules/xoopsheadline/admin/index.php (onokazu)
-- Fixed bug where 2 headline forms were using the same form name/id, causing JS error (onokazu)
-- Fixed some html problems in mylinks/mydownloads admin page (onokazu)
-- Secured mainfile.dist.php from disclosing paths (Mithrandir)
-- Fixed bug #1073029 (onokazu)
-- Fixed bug #1073532 (onokazu)
-- Fixed bug #1080791 (onokazu)
-- Fixed lang phrase _NOT_ACTIVENOTIFICATIONS not being assing to template (onokazu)
-- Some PHP5 fixes (Mithrandir)
-- Updated Smarty to version 2.6.5
-- Updated PHPMailer to version 1.72
-
-
-2004/09/11: Version 2.0.7.3
-===============================
-!! SECURITY FIX !! fixed more bugs that allowed session hijacking under a certain circumstance (onokazu)
-
-
-2004/09/10: Version 2.0.7.2
-===============================
-!! SECURITY FIX !! fixed bugs that allowed session hijacking under a certain circumstance (onokazu)
-
-
-2004/08/21: Version 2.0.7.1
-===============================
-Fixed bug #1006511 about $xoops_isadmin misuse (skalpa/the jp.xoops.org community):
-- Changed XoopsUser::isAdmin() behavior to prevent problems with modules that misuse this function
-- Fixed permission checking in user profile page, to only show admin links to people who are supposed to see them
-- Fixed permission checking in the comments system, to only show admin links to people who are supposed to see them
-Fixed incorrect escaping of configuration values in 2.0.7 (skalpa)
-Changed db proxy class error message from "Action not allowed" to "Database update not allowed during a GET request" (skalpa)
-Fixed bug #964084: if comment title is long multi-byte character.last byte loss (Mithrandir/domifara)
-Fixed bug #977360: Wrong icon in comment bloc (Mithrandir/zoullou)
-Fixed bug #976534: modules incompatibilities in 2.0.7 (Mithrandir/gijoe_peak)
-Fixed bug #975803: Typo in class/pagenav.php (Mithrandir/Dave_l)
-Fixed bug #974655: slogan variable with Xoops 2.0.7 (Mithrandir/brashquido)
-Fixed bug #987171: typo in edituser.php (Mithrandir)
-Applied patch #928503: Search results for modules with granted permissions optimised (Mithrandir/malanciault)
-Applied patch #988715: cp_header.php language (Mithrandir/phppp)
-Fixed MyTextSanitizer PHP notices (Mithrandir)
-Fixed XoopsForm PHP Notices about an unset _extra property (Mithrandir)
-
-
-2004/06/14: Version 2.0.7
-===============================
-!! SECURITY FIX !! preventing code injection in media uploader (skalpa)
-!! SECURITY FIX !! preventing execution of external scripts in shared environments (skalpa/ackbarr)
-
-Fixed bug #963937: Typo in modules/system/admin/findusers/main.php (mithrandir/tom_g3x)
-Fixed typo in x2t theme css colteaser class definition (w4z004)
-Set formButton class to Xoops popups buttons (w4z004)
-Fixed bug #960970: Incorrect display of the graphical pagenav (w4z004)
-Modified the Word Censoring fix (#962025) for MySQL 4.x compat (skalpa + quick thx 2 hervet 4 help)
-Ensured page title and slogan are escaped for HTML (onokazu)
-Fixed bug #961565: Search form keywords not checked by JS (mithrandir/tom_g3x)
-Fixed bug #961118 in XoopsFormElementTray::getElements() (mithrandir/luckec)
-Fixed bug #961311: Incorrect definition of headers var in XoopsMailer class (mithrandir/tom_g3x)
-XoopsForm::assign() now indexes elements by name if possible (mithrandir/kerkness)
-Fixed bug #963197: xoopsHiddenText is hardcoded in formdhtmlarea (mithrandir/tom_g3x)
-Fixed bug #963301: XoopsMediaUploader checkMaxHeight() doesn't work (skalpa/onokazu)
-Fixed bug #963327: XoopsImageHandler delete() keeps rows in imagebody table (skalpa/tom_g3x)
-Fixed bug #962025: Word censoring can mess db config options up (skalpa/tom_g3x)
-Fixed bug #961313: XoopsMailer custom headers are duplicated (skalpa/tom_g3x)
-Fixed bug #960683: [code] wrong translation (skalpa/ryuji+gi_joe)
-Fixed snoopy bug due to language specific characters (onokazu)
-Fixed a bug preventing deletion of users from the admin user search results (onokazu)
-Fixed a bug preventing deletion of admin users (onokazu)
-Fixed bug #915976: module onInstall feature doesn't display module messages correctly (skalpa/feugy+dave_l)
-Fixed bug #898776: Xoops module resolution for www.host.com and host.com (wulff_dk)
-Fixed bug #906282: XoopsGroupPermForm::render() - throws Undefined variable (mithrandir)
-Fixed bug #946621: Comments system extra_param not working with register_globals off (mithrandir/gstarrett)
-Fixed bug #932200: Admin > Edit user shows wrong username :-(mithrandir)
-Fixed bug #936753: $xoops_module_header not in all themes (w4z004)
-Fixed bug #921930: SQL queries with leading whitespace don't work (mithrandir)
-Fixed bug #920480: xoops_substr always adds three dots (skalpa)
-Fixed bug #921448: Undefined variable in xoopscodes.php (skalpa/dave_l)
-Applied patch #953063: js Calendar first popup date bug fix (mithrandir/venezia)
-Applied patch #953060: xoopstree.php selbox - subcategories not ordered (mithrandir/venezia)
-Applied patch #928503: Only show search results for modules with granted permissions (mithrandir/malanciault)
-Fixed bug #922152 preventing notifications to work with some Windows configurations (skalpa/robekras)
-Fixed bug #930351 preventing XoopsThemeForm::insertBreak() to work
-Corrected the content of $xoopsRequestUri on IIS fixing bug #895984 (skalpa)
-
-
-2/6/2004: Version 2.0.6
-===============================
-- Removed calls to XoopsHandlerRegistry class (onokazu)
-- Fixed loop problem after retrieving a lost password (onokazu)
-- Changed all include() calls to include_once() for xoopscodes.php (onokazu)
-- Added routines to remove users from the online member list when a user is deleted (onokazu)
-- Added parameters to the Critreria class constructor to allow the use of DB functions in SQL criteria (skalpa)
-- Added fetchBoth() method to the XoopsDatabase class (skalpa)
-- Fixed typos in class/smarty/plugins/resource.db.php (skalpa)
-- Refactoring in /class/xoopsform/form.php (skalpa)
-- Added some methods to /class/xoopsform/formelement.php to allow the use of accesskey and class attributes in form element tags (skalpa)
-- Fixed extra HTML tags not being displayed when using the XoopsThemeForm::insertBreak() method (Catzwolf)
-- Changed the default HTTP method of the search form to GET (onokazu)
-- Fixed notification constants not being included during installation (onokazu)
-- Fixed session data not being properly escaped before inserting to the database (onokazu)
-- Some useful changes to the group permission form (onokazu)
-- Fixed the block cachetime selection being reset after preview (onokazu)
-- Fixed invalid regex patterns used for username filtering, also added fix to allow the safe use of multi-byte characters in username (contributed by GIJOE)
-- Fixed bug where some blocks were not being displayed in block admin page on certain occasions (onokazu)
-- Fixed the problem of system admin icon disappearing on certain occasions (onokazu)
-- Fixed the errorhandler class to check the current error_reporting level before handleing errors (onokazu)
-- Re-activated the errorhandler class (onokazu)
-- Updated class/Snoopy.php to the latest version, v1.01 (onokazu)
-- Fixed a typo in kernel/online.php (onokazu)
-- Added some useful functions to include/xoops.js (skalpa)
-- Fix for Opera in include/xoops.js (onokazu)
-- Fixed user bio and signature values causing corruption in the edit profile form on certain occasions (onokazu)
-- Fixed the module name being reset to the default value after module update (onokazu)
-- Fixed invalid regex patterns in xoopslists.php (onokazu)
-- Fixed a few issues with register_globals setting
-- Fix for the auto-login feature (not activated)
-- Fixed image categories not being displayed in the order set by admin (onokazu)- Fixed a typo in kernel/config.php (onokazu)
-- Fixed comments not being displayed in the order as requested (onokazu)
-- Fixed the mailer class not setting some header values (onokazu)
-- Fixed chmod problem in class/uploader.php
-- Fixed magic_quotes related problems in class/uploader.php
-- Fixed notification routines causing a fatal error while trying to notify non-existent users (onokazu)
-- Added fix to convert &amp; to & within mail messages (onokazu)
-- Fixed html special characters causing problem when submitting a new module name (onokazu)
-- Fixed javascript error in mailuser form (onokazu)
-- Fixed javascript error in calendar date select form
-- Added a new Smarty function <{xoops_link}> (skalpa)
-- Added check to prevent webmaster user/group from being removed completely (contributed by Ryuji)
-
-newbb
-- Security fix in modules/newbb/viewtopic.php (onokazu)
-- Security fix in modules/newbb/viewforum.php (onokazu)
-- Added register_globals related fix to topicmanager.php (onokazu)
-- Fixed topic moderation icons not being displayed for moderators in templates/newbb_thread.html (onokazu)
-- Fixed topic time not being displayed in recent posts block on certain occasions in blocks/newbb_new.php (onokazu)
-- Added fix to correctly navigate to the requested post even when the post is not on the first page of flat view (contrib by GIJOE in class/forumpost.php, viewtopic.php, viewforum.php)
-
-sections
-- Added missing global variable declarations to index.php (onokazu)
-
-mydownloads
-- Added register_globals related fix to modfile.php (onokazu)
-
-news
-- Added fix to always display published date in each article (onokazu)
-- Added missing ?> at the end of file in xoops_version.php (onokazu)
-- Some fixes in admin/index.php
-
-xoopspolls
-- Fixed color bar selections not working when creating/editing a new poll (onokazu)
-
-xoopsmembers
-- Fixed 'more than X posts' not working when set to 0 (onokazu)
-- Added a new language constant to language/english/main.php (Catzwolf)
-- Removed invalid HTML tags in templates/xoopsmembers_searchresults.html (Catzwolf)
-
-
-1/5/2004: Version 2.0.5.2
-===============================
-- Security fix in modules/mylinks/myheader.php
-- Security fix in modules/mylinks/visit.php
-- Security fix in modules/mylinks/admin/index.php
-
-
-11/22/2003: Version 2.0.5.1
-===============================
-- Added $option parameter to xoops_gethandler function (skalpa)
-- Security fix in banners.php (onokazu)
-- Security fix in modules/newss/include/forumform.inc.php (onokazu)
-- Security fix in include/common.php (onokazu)
-- Temporarily disabled XoopsErrorHandler class (onokazu)
-- Security fix in include/functions.php (onokazu)
-- Removed XoopsHandlerRegistry class (onokazu)
-- Added fix for preventing users entering infinite loop when recovering a lost password (onokazu)
-
-
-10/8/2003: Version 2.0.5
-===============================
-- Fixed template files not being updated even when the 'allow update from themes directory' option was enabled in preferences
-- Fixed RSS channel title being cutoff at special characters
-- Minor bug fix in pagenav.php
-- Fixed blocks disappearing from the block admin page on certain occasion
-- Additional fixes to work with register_globals off
-- Fixed problem with XoopsCode Img button not working on certain occasion
-- Added missing SQL query in kernel/avatar.php
-- Fixed problem with the newbb module where users could post without a thread title on certain occasion
-- Fixed problem in banner admin page where banner edit form not being displayed on certain occasion
-- Fixed group selection option in the blocks admin page not being selected on certain occasion
-- Fixed poll option textbox forms not displaying the correct values
-- Fixed show all link in user profile page not working in 2.0.5RC
-- Additional phrases in language/english/global.php(_NOTITLE), language/english/search.php(_SR_IGNOREDWORDS), install/language/english/install.php(_INSTALL_L128, _INSTALL_L200)
-- Added check in install/index.php to read $HTTP_ACCEPT_LANGUAGE on initial load
-
-
-9/30/2003: Version 2.0.5 RC
-===============================
-- Fixed email checking bug mentioned in http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=12288&forum=2 (mvandam)
-- Fixed a number of bugs in blocks admin page (onokazu)
-- More usability fix in blocks admin page (onokazu)
-- Fixed forum topic links to correctly use the # feature in url (onokazu)
-- Fixed password checking bug mentioned in http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=12301&post_id=49369&order=0&viewmode=flat&pid=49203&forum=21#forumpost49369
-- Fixed database connection error when creating database during install (onokazu)
-- Fixed mb_output_handler causing problems in backend.php/image.php/downloader (onokazu)
-- Fixed search feature to use GET requests for prev/next/showall links (onokazu)
-- Register_globals related fix in /include/comment_post.php (contrib by gstarrett)
-- Added $xoopsUserIsAdmin global variable (onokazu)
-- Added xoops_getLinkedUnameById function to /include/functions.php (Catzwolf)
-- Fixed invalid Smarty tags in /modules/system/templates/system_siteclosed.html, /modules/system/templates/system_redirect.html, /modules/system/templates/system_imagemanager2.html (onokazu)
-
-
-9/19/2003: Version 2.0.4
-===============================
-- XOOPS_CACHE_PATH, XOOPS_UPLOAD_PATH, XOOPS_THEME_PATH", XOOPS_COMPILE_PATH, XOOPS_THEME_URL, XOOPS_UPLOAD_URL are now set in include/common.php (onokazu)
-- Added [siteurl][/siteurl] tag to XoopsCode (mvandam)
-- Fixed a typo in class/uploader.php (onokazu)
-- Fixed some redirect problems after login (onokazu)
-- registre_globals fix in include/comment_view.php (onokazu)
-- Xoops.org news is disabled by default in the admin section (onokazu)
-- Added a new error handler class (class/errorhandler.php) (mvandam)
-- Fixed XoopsGroupPermHandler returning duplicate permissions (onokazu)
-- Fixed block-disappearing problem in blocks admin (onokazu)
-- Fixed typo in kernel/notification.php (mvandam)
-- Added XoopsGuestUser class in kernel/user.php (onokazu)
-- Fixed newbb module to correctly use the # feature in URL (onokazu)
-- Improved usability in blocks admin section
-- Reduced number of users to display in group/edituser page to max 200 users (onokazu)
-- Fixed bug where admins could add users with a existing username (onokazu)
-- Added files for module developers to easily add group permisson feature (modules/system/groupperm.php, class/xoopsform/groupperm.php) (onokazu)
-- Fixed typo in register.php (onokazu)
-
-
-6/17/2003: Version 2.0.3
-===============================
-- fixed CSS related bug in global search page
-- register_globals bug fix in comments
-- Smarty updated to 2.5.0
-- fixed typo in kernel/object.php
-- fixed group permission bug
-- fixed bug where image categories were deleted after group permission update
-- fixed bug where user votes could not be deleted in the mylinks module
-- fixed some language typos
-- changed XoopsGroupPermHandler::getItemIds to accept an array fot the second parameter (gperm_groupid), which was required in certain places..
-- removed avatar image files
-
-
-4/25/2003: Version 2.0.2
-===============================
-- security fix to prevent malicious cross site scripting attacks (onokazu)
-- fixed character encoding problem for some languages when using the mailer class (onokazu)
-- fixed some major bugs in the xoopsheadline module (onokazu)
-- fixed some cookie related problems in the forums module (mvandam)
-
-
-4/18/2003: Version 2.0.1
-===============================
-- fixed bug where notification feature could not be turned on
-- fixed character encoding problem for some languages when using the mailer class (onokazu)
-- fixed the theme selection block to work again
-- fixed typo in kernel/module.php
-- fixed incorrect table name in xoops_version.php of the new headline module
-- changed max limit size of some columns in the configoption table
-- fixed image manager bug when using db store method
-- xoops.org can now be disabled by adding nonews=1
-
-
-4/16/2003: Version 2.0.0
-===============================
-- xoopsheadlines module replaced with xoopsheadline module to fix character encoding problems
-- numerous bug fixes
-
-
-3/19/2003: Version 2.0.0 RC3
-===============================
-- a major change in the handling of theme files, the detail of which you can read in this [url=http://www.xoops.org/modules/news/article.php?storyid=677]article[/url] (onokazu)
-- a new global notification feature that can easily be incorporated into modules (that use Smarty) by only modifying xoops_version.php and template files (mvandam)
-- SMTP support using phpMailer (bunny)
-- group permission tables merged into one table (onokazu)
-- code refactoring
-
-
-2/9/2003: Version 2.0.0 RC2
-===============================
-A bug fix release..
-- avatar upload bug
-- themeset image upload bug
-- register_globals fix
-- recommend us block error
-- error message displayed upon submit of news article
-- page navigation bug in some modules
-- blank page bug on some servers
-- SQL displayed in blocks admin
-
-
-1/31/2003: Version 2.0.0 RC1
-===============================
-The first public release of 2.0 series.
-For new features that have been added from 1.3.x, please refer to
-the articles listed below:
-http://www.xoops.org/modules/news/article.php?storyid=486
-http://www.xoops.org/modules/news/article.php?storyid=549
-http://www.xoops.org/modules/xoopsdocs/index.php?cat_id=6
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/class/auth/auth_ldap.php 2.2.6.src/class/auth/auth_ldap.php
--- 2.2.3a-Final.src/class/auth/auth_ldap.php	2005-08-12 12:07:28.000000000 -0500
+++ 2.2.6.src/class/auth/auth_ldap.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: auth_ldap.php,v 1.1.2.5 2005/08/12 18:07:28 mithyt2 Exp $
+// $Id: auth_ldap.php 184 2006-01-22 22:34:51Z skalpa $
 // auth_ldap.php - LDAP authentification class
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
diff -ruN 2.2.3a-Final.src/class/auth/auth.php 2.2.6.src/class/auth/auth.php
--- 2.2.3a-Final.src/class/auth/auth.php	2005-08-12 12:07:28.000000000 -0500
+++ 2.2.6.src/class/auth/auth.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: auth.php,v 1.1.2.4 2005/08/12 18:07:28 mithyt2 Exp $
+// $Id: auth.php 184 2006-01-22 22:34:51Z skalpa $
 // auth.php - defines abstract authentification wrapper class 
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
diff -ruN 2.2.3a-Final.src/class/auth/auth_xoops.php 2.2.6.src/class/auth/auth_xoops.php
--- 2.2.3a-Final.src/class/auth/auth_xoops.php	2005-08-12 12:07:28.000000000 -0500
+++ 2.2.6.src/class/auth/auth_xoops.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: auth_xoops.php,v 1.1.2.4 2005/08/12 18:07:28 mithyt2 Exp $
+// $Id: auth_xoops.php 184 2006-01-22 22:34:51Z skalpa $
 // auth_xoops.php - XOOPS authentification class 
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
diff -ruN 2.2.3a-Final.src/class/calendar/doc/html/reference.html 2.2.6.src/class/calendar/doc/html/reference.html
--- 2.2.3a-Final.src/class/calendar/doc/html/reference.html	2005-04-19 08:35:24.000000000 -0500
+++ 2.2.6.src/class/calendar/doc/html/reference.html	2006-01-22 16:34:51.000000000 -0600
@@ -55,7 +55,7 @@
 </div>
 <p></p>
 <p>
-<span class=small><code class=verbatim>$Id: reference.html,v 1.1.2.1 2005/04/19 14:35:24 mithyt2 Exp $</code></span>
+<span class=small><code class=verbatim>$Id: reference.html 184 2006-01-22 22:34:51Z skalpa $</code></span>
 </p>
 <span class=small><blockquote>
 <div align=right><table><tr><td>
diff -ruN 2.2.3a-Final.src/class/calendar/index.html 2.2.6.src/class/calendar/index.html
--- 2.2.3a-Final.src/class/calendar/index.html	2005-04-19 08:35:24.000000000 -0500
+++ 2.2.6.src/class/calendar/index.html	2006-01-22 16:34:51.000000000 -0600
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
-<!-- $Id: index.html,v 1.1.2.1 2005/04/19 14:35:24 mithyt2 Exp $ -->
+<!-- $Id: index.html 184 2006-01-22 22:34:51Z skalpa $ -->
 
 <head>
 <meta http-equiv="content-type" content="text/xml; charset=utf-8" />
diff -ruN 2.2.3a-Final.src/class/class.tar.php 2.2.6.src/class/class.tar.php
--- 2.2.3a-Final.src/class/class.tar.php	2003-02-17 10:24:27.000000000 -0600
+++ 2.2.6.src/class/class.tar.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: class.tar.php,v 1.6 2003/02/17 16:24:27 buennagel Exp $
+// $Id: class.tar.php 184 2006-01-22 22:34:51Z skalpa $
 /*
 	package::i.tools
 
diff -ruN 2.2.3a-Final.src/class/class.zipfile.php 2.2.6.src/class/class.zipfile.php
--- 2.2.3a-Final.src/class/class.zipfile.php	2003-02-17 10:24:28.000000000 -0600
+++ 2.2.6.src/class/class.zipfile.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: class.zipfile.php,v 1.7 2003/02/17 16:24:28 buennagel Exp $
+// $Id: class.zipfile.php 184 2006-01-22 22:34:51Z skalpa $
 /*
 	package::i.tools
 
diff -ruN 2.2.3a-Final.src/class/commentrenderer.php 2.2.6.src/class/commentrenderer.php
--- 2.2.3a-Final.src/class/commentrenderer.php	2005-10-27 19:42:20.000000000 -0500
+++ 2.2.6.src/class/commentrenderer.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: commentrenderer.php,v 1.11.22.2.2.1 2005/10/28 01:42:20 skalpa Exp $
+// $Id: commentrenderer.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/criteria.php 2.2.6.src/class/criteria.php
--- 2.2.3a-Final.src/class/criteria.php	2005-07-26 01:11:46.000000000 -0500
+++ 2.2.6.src/class/criteria.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: criteria.php,v 1.12.24.5 2005/07/26 07:11:46 mithyt2 Exp $
+// $Id: criteria.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/database/database.php 2.2.6.src/class/database/database.php
--- 2.2.3a-Final.src/class/database/database.php	2003-11-20 13:03:30.000000000 -0600
+++ 2.2.6.src/class/database/database.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: database.php,v 1.16 2003/11/20 19:03:30 okazu Exp $
+// $Id: database.php 184 2006-01-22 22:34:51Z skalpa $
 // database.php - defines abstract database wrapper class 
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
diff -ruN 2.2.3a-Final.src/class/database/mysqldatabase.php 2.2.6.src/class/database/mysqldatabase.php
--- 2.2.3a-Final.src/class/database/mysqldatabase.php	2005-09-18 18:29:34.000000000 -0500
+++ 2.2.6.src/class/database/mysqldatabase.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: mysqldatabase.php,v 1.11.6.9.2.2 2005/09/19 00:29:34 skalpa Exp $
+// $Id: mysqldatabase.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/database/sqlutility.php 2.2.6.src/class/database/sqlutility.php
--- 2.2.3a-Final.src/class/database/sqlutility.php	2005-07-26 01:11:48.000000000 -0500
+++ 2.2.6.src/class/database/sqlutility.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: sqlutility.php,v 1.1.22.1 2005/07/26 07:11:48 mithyt2 Exp $
+// $Id: sqlutility.php 184 2006-01-22 22:34:51Z skalpa $
 // sqlutility.php - defines utility class for MySQL database
 /**
  * @package     kernel
diff -ruN 2.2.3a-Final.src/class/downloader.php 2.2.6.src/class/downloader.php
--- 2.2.3a-Final.src/class/downloader.php	2004-12-26 13:11:48.000000000 -0600
+++ 2.2.6.src/class/downloader.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: downloader.php,v 1.9 2004/12/26 19:11:48 onokazu Exp $
+// $Id: downloader.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/errorhandler.php 2.2.6.src/class/errorhandler.php
--- 2.2.3a-Final.src/class/errorhandler.php	2005-07-26 01:11:46.000000000 -0500
+++ 2.2.6.src/class/errorhandler.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: errorhandler.php,v 1.2.24.4 2005/07/26 07:11:46 mithyt2 Exp $
+// $Id: errorhandler.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -104,14 +104,15 @@
 	 */
 	function handleError($error)
 	{
+		if ($error['errno'] == E_USER_ERROR) {
+			$this->_isFatal = true;
+			$this->_errors[] = $error;
+			exit;
+		}
 		if (($error['errno'] & error_reporting()) != $error['errno']) {
 			return;
 		}
 		$this->_errors[] = $error;
-		if ($error['errno'] == E_USER_ERROR) {
-			$this->_isFatal = true;
-			exit();
-		}
 	}
 	
 	/**
diff -ruN 2.2.3a-Final.src/class/logger.php 2.2.6.src/class/logger.php
--- 2.2.3a-Final.src/class/logger.php	2005-06-24 12:52:40.000000000 -0500
+++ 2.2.6.src/class/logger.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: logger.php,v 1.6.22.6 2005/06/24 18:52:40 mithyt2 Exp $
+// $Id: logger.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/mail/phpmailer/ChangeLog.txt 2.2.6.src/class/mail/phpmailer/ChangeLog.txt
--- 2.2.3a-Final.src/class/mail/phpmailer/ChangeLog.txt	2004-12-30 06:56:27.000000000 -0600
+++ 2.2.6.src/class/mail/phpmailer/ChangeLog.txt	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,35 @@
 ChangeLog
 
+Version 1.73 (Sun, Jun 10 2005)
+* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf
+* Now has a total of 20 translations
+* Fixed alt attachments bug: http://tinyurl.com/98u9k
+
+Version 1.72 (Wed, May 25 2004)
+* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations.
+* Received: Removed this method because spam filter programs like 
+SpamAssassin reject this header.
+* Fixed error count bug.
+* SetLanguage default is now "language/".
+* Fixed magic_quotes_runtime bug.
+
+Version 1.71 (Tue, Jul 28 2003)
+* Made several speed enhancements
+* Added German and Italian translation files
+* Fixed HELO/AUTH bugs on keep-alive connects
+* Now provides an error message if language file does not load
+* Fixed attachment EOL bug
+* Updated some unclear documentation
+* Added additional tests and improved others
+
+Version 1.70 (Mon, Jun 20 2003)
+* Added SMTP keep-alive support
+* Added IsError method for error detection
+* Added error message translation support (SetLanguage)
+* Refactored many methods to increase library performance
+* Hello now sends the newer EHLO message before HELO as per RFC 2821
+* Removed the boundary class and replaced it with GetBoundary
+* Removed queue support methods
 * New $Hostname variable
 * New Message-ID header
 * Received header reformat
@@ -10,6 +40,7 @@
 * quoted-encoding should now encode NULs \000
 * Fixed encoding of body/AltBody (#553370)
 * Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC)
+* Multiple bug fixes
 
 Version 1.65 (Fri, Aug 09 2002)
 * Fixed non-visible attachment bug (#585097) for Outlook
diff -ruN 2.2.3a-Final.src/class/mail/phpmailer/class.phpmailer.php 2.2.6.src/class/mail/phpmailer/class.phpmailer.php
--- 2.2.3a-Final.src/class/mail/phpmailer/class.phpmailer.php	2004-12-30 06:56:27.000000000 -0600
+++ 2.2.6.src/class/mail/phpmailer/class.phpmailer.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,1779 +1,1499 @@
-<?php
-////////////////////////////////////////////////////
-// phpmailer - PHP email class
-//
-// Version 1.65, Created 08/09/2002
-//
-// Class for sending email using either
-// sendmail, PHP mail(), or SMTP.  Methods are
-// based upon the standard AspEmail(tm) classes.
-//
-// Author: Brent R. Matzelle <bmatzelle@yahoo.com>
-//
-// License: LGPL, see LICENSE
-////////////////////////////////////////////////////
-
-/**
- * phpmailer - PHP email transport class
- * @author Brent R. Matzelle
- */
-class phpmailer
-{
-    /////////////////////////////////////////////////
-    // PUBLIC VARIABLES
-    /////////////////////////////////////////////////
-
-    /**
-     * Email priority (1 = High, 3 = Normal, 5 = low).
-     * @access public
-     * @var int
-     */
-    var $Priority          = 3;
-
-    /**
-     * Sets the CharSet of the message.
-     * @access public
-     * @var string
-     */
-    var $CharSet           = "iso-8859-1";
-
-    /**
-     * Sets the Content-type of the message.
-     * @access public
-     * @var string
-     */
-    var $ContentType        = "text/plain";
-
-    /**
-     * Sets the Encoding of the message. Options for this are "8bit",
-     * "7bit", "binary", "base64", and "quoted-printable".
-     * @access public
-     * @var string
-     */
-    var $Encoding          = "8bit";
-
-    /**
-     * Holds the most recent mailer error message.
-     * @access public
-     * @var string
-     */
-    var $ErrorInfo         = "";
-
-    /**
-     * Sets the From email address for the message.
-     * @access public
-     * @var string
-     */
-    var $From               = "root@localhost";
-
-    /**
-     * Sets the From name of the message.
-     * @access public
-     * @var string
-     */
-    var $FromName           = "Root User";
-
-    /**
-     * Sets the Sender email of the message. If not empty, will be sent via -f to sendmail
-     * or as 'MAIL FROM' in smtp mode.
-     * @access public
-     * @var string
-     */
-    var $Sender            = "";
-
-    /**
-     * Sets the Subject of the message.
-     * @access public
-     * @var string
-     */
-    var $Subject           = "";
-
-    /**
-     * Sets the Body of the message.  This can be either an HTML or text body.
-     * If HTML then run IsHTML(true).
-     * @access public
-     * @var string
-     */
-    var $Body               = "";
-
-    /**
-     * Sets the text-only body of the message.  This automatically sets the
-     * email to multipart/alternative.  This body can be read by mail
-     * clients that do not have HTML email capability such as mutt. Clients
-     * that can read HTML will view the normal Body.
-     * @access public
-     * @var string
-     */
-    var $AltBody           = "";
-
-    /**
-     * Sets word wrapping on the body of the message to a given number of 
-     * characters.
-     * @access public
-     * @var int
-     */
-    var $WordWrap          = 0;
-
-    /**
-     * Method to send mail: ("mail", "sendmail", or "smtp").
-     * @access public
-     * @var string
-     */
-    var $Mailer            = "mail";
-
-    /**
-     * Sets the path of the sendmail program.
-     * @access public
-     * @var string
-     */
-    var $Sendmail          = "/usr/sbin/sendmail";
-
-    /**
-     *  Turns Microsoft mail client headers on and off.  Useful mostly
-     *  for older clients.
-     *  @access public
-     *  @var bool
-     */
-    var $UseMSMailHeaders = false;
-    
-    /**
-     * Path to phpmailer plugins.  This is now only useful if the SMTP class 
-     * is in a different directory than the PHP include path.  
-     * @access public
-     * @var string
-     */
-    var $PluginDir         = "";
-
-    /**
-     *  Holds phpmailer version.
-     *  @access public
-     *  @var string
-     */
-    var $Version           = "1.65";
-
-    /**
-     * Sets the email address that a reading confirmation will be sent.
-     * @access public
-     * @var string
-     */
-    var $ConfirmReadingTo  = "";
-
-    /**
-     *  Sets the line endings of the message.
-     *  @access public
-     *  @var string
-     */
-    var $LE           = "\n";
-
-    /**
-     *  Sets the hostname to use in Message-Id and Received headers
-     *  and as default HELO string. If empty, the value returned
-     *  by SERVER_NAME is used or 'localhost.localdomain'.
-     *  @access public
-     *  @var string
-     */
-    var $Hostname          = "";
-
-
-    /////////////////////////////////////////////////
-    // SMTP VARIABLES
-    /////////////////////////////////////////////////
-
-    /**
-     *  Sets the SMTP hosts.  All hosts must be separated by a
-     *  semicolon.  You can also specify a different port
-     *  for each host by using this format: [hostname:port]
-     *  (e.g. "smtp1.example.com:25;smtp2.example.com").
-     *  Hosts will be tried in order.
-     *  @access public
-     *  @var string
-     */
-    var $Host        = "localhost";
-
-    /**
-     *  Sets the default SMTP server port.
-     *  @access public
-     *  @var int
-     */
-    var $Port        = 25;
-
-    /**
-     *  Sets the SMTP HELO of the message (Default is $Hostname).
-     *  @access public
-     *  @var string
-     */
-    var $Helo        = "";
-
-    /**
-     *  Sets SMTP authentication. Utilizes the Username and Password variables.
-     *  @access public
-     *  @var bool
-     */
-    var $SMTPAuth     = false;
-
-    /**
-     *  Sets SMTP username.
-     *  @access public
-     *  @var string
-     */
-    var $Username     = "";
-
-    /**
-     *  Sets SMTP password.
-     *  @access public
-     *  @var string
-     */
-    var $Password     = "";
-
-    /**
-     *  Sets the SMTP server timeout in seconds. This function will not 
-     *  work with the win32 version.
-     *  @access public
-     *  @var int
-     */
-    var $Timeout      = 10;
-
-    /**
-     *  Sets SMTP class debugging on or off.
-     *  @access public
-     *  @var bool
-     */
-    var $SMTPDebug    = false;
-
-
-    /////////////////////////////////////////////////
-    // PRIVATE VARIABLES
-    /////////////////////////////////////////////////
-
-    /**
-     *  Holds all "To" addresses.
-     *  @access private
-     *  @var array
-     */
-    var $to              = array();
-
-    /**
-     *  Holds all "CC" addresses.
-     *  @access private
-     *  @var array
-     */
-    var $cc              = array();
-
-    /**
-     *  Holds all "BCC" addresses.
-     *  @access private
-     *  @var array
-     */
-    var $bcc             = array();
-
-    /**
-     *  Holds all "Reply-To" addresses.
-     *  @var array
-     */
-    var $ReplyTo         = array();
-
-    /**
-     *  Holds all string and binary attachments.
-     *  @access private
-     *  @var array
-     */
-    var $attachment      = array();
-
-    /**
-     *  Holds all custom headers.
-     *  @var array
-     */
-    var $CustomHeader    = array();
-
-    /**
-     *  Holds the type of the message.
-     *  @var string
-     */
-    var $message_type    = "";
-
-    /**
-     *  Holds the message boundaries.
-     *  @access private
-     *  @var string array
-     */
-    var $boundary        = array();
-
-    /////////////////////////////////////////////////
-    // VARIABLE METHODS
-    /////////////////////////////////////////////////
-
-    /**
-     * Sets message type to HTML.  Returns void.
-     * @access public
-     * @return void
-     */
-    function IsHTML($bool) {
-        if($bool == true)
-            $this->ContentType = "text/html";
-        else
-            $this->ContentType = "text/plain";
-    }
-
-    /**
-     * Sets Mailer to send message using SMTP.
-     * Returns void.
-     * @access public
-     * @return void
-     */
-    function IsSMTP() {
-        $this->Mailer = "smtp";
-    }
-
-    /**
-     * Sets Mailer to send message using PHP mail() function.
-     * Returns void.
-     * @access public
-     * @return void
-     */
-    function IsMail() {
-        $this->Mailer = "mail";
-    }
-
-    /**
-     * Sets Mailer to send message using the $Sendmail program.
-     * Returns void.
-     * @access public
-     * @return void
-     */
-    function IsSendmail() {
-        $this->Mailer = "sendmail";
-    }
-
-    /**
-     * Sets Mailer to send message using the qmail MTA.  Returns void.
-     * @access public
-     * @return void
-     */
-    function IsQmail() {
-        //$this->Sendmail = "/var/qmail/bin/qmail-inject";
-        $this->Sendmail = "/var/qmail/bin/sendmail";
-        $this->Mailer = "sendmail";
-    }
-
-
-    /////////////////////////////////////////////////
-    // RECIPIENT METHODS
-    /////////////////////////////////////////////////
-
-    /**
-     * Adds a "To" address.  Returns void.
-     * @access public
-     * @return void
-     */
-    function AddAddress($address, $name = "") {
-        $cur = count($this->to);
-        $this->to[$cur][0] = trim($address);
-        $this->to[$cur][1] = $name;
-    }
-
-    /**
-     * Adds a "Cc" address. Note: this function works
-     * with the SMTP mailer on win32, not with the "mail"
-     * mailer.  This is a PHP bug that has been submitted
-     * on http://bugs.php.net. The *NIX version of PHP
-     * functions correctly. Returns void.
-     * @access public
-     * @return void
-    */
-    function AddCC($address, $name = "") {
-        $cur = count($this->cc);
-        $this->cc[$cur][0] = trim($address);
-        $this->cc[$cur][1] = $name;
-    }
-
-    /**
-     * Adds a "Bcc" address. Note: this function works
-     * with the SMTP mailer on win32, not with the "mail"
-     * mailer.  This is a PHP bug that has been submitted
-     * on http://bugs.php.net. The *NIX version of PHP
-     * functions correctly.
-     * Returns void.
-     * @access public
-     * @return void
-     */
-    function AddBCC($address, $name = "") {
-        $cur = count($this->bcc);
-        $this->bcc[$cur][0] = trim($address);
-        $this->bcc[$cur][1] = $name;
-    }
-
-    /**
-     * Adds a "Reply-to" address.  Returns void.
-     * @access public
-     * @return void
-     */
-    function AddReplyTo($address, $name = "") {
-        $cur = count($this->ReplyTo);
-        $this->ReplyTo[$cur][0] = trim($address);
-        $this->ReplyTo[$cur][1] = $name;
-    }
-
-
-    /////////////////////////////////////////////////
-    // MAIL SENDING METHODS
-    /////////////////////////////////////////////////
-
-    /**
-     * Creates message and assigns Mailer. If the message is
-     * not sent successfully then it returns false.  Use the ErrorInfo
-     * variable to view description of the error.  Returns bool.
-     * @access public
-     * @return bool
-     */
-    function Send() {
-        $header = "";
-        $body = "";
-
-        if((count($this->to) + count($this->cc) + count($this->bcc)) < 1)
-        {
-            $this->error_handler("You must provide at least one recipient email address");
-            return false;
-        }
-
-        // Set whether the message is multipart/alternative
-        if(!empty($this->AltBody))
-            $this->ContentType = "multipart/alternative";
-
-        // Attach sender information & date
-        $header = $this->received();
-        $header .= sprintf("Date: %s%s", $this->rfc_date(), $this->LE);
-        $header .= $this->create_header();
-
-        if(!$body = $this->create_body())
-            return false;
-
-        //echo "<pre>".$header . $body . "</pre>"; // debugging
-
-        // Choose the mailer
-        if($this->Mailer == "sendmail")
-        {
-          if(!$this->sendmail_send($header, $body))
-              return false;
-        }
-        elseif($this->Mailer == "mail")
-        {
-          if(!$this->mail_send($header, $body))
-              return false;
-        }
-        elseif($this->Mailer == "smtp")
-        {
-          if(!$this->smtp_send($header, $body))
-              return false;
-        }
-        else
-        {
-            $this->error_handler(sprintf("%s mailer is not supported", $this->Mailer));
-            return false;
-        }
-
-        return true;
-    }
-    
-    /**
-     * Sends mail message to an assigned queue directory.  Has an optional 
-     * sendTime argument.  This is used when the user wants the 
-     * message to be sent from the queue at a predetermined time. 
-     * The data must be a valid timestamp like that returned from 
-     * the time() or strtotime() functions.  Returns false on failure 
-     * or the message file name if success.
-     * @access public
-     * @return string
-     */
-    function SendToQueue($queue_path, $send_time = 0) {
-        $message = array();
-        $header = "";
-        $body = "";
-        
-        // If invalid or empty just set to the current time
-        if($send_time == 0)
-            $send_time = time();
-        
-        if(!is_dir($queue_path))
-        {
-            $this->error_handler("The supplied queue directory does not exist");
-            return false;
-        }
-
-        if((count($this->to) + count($this->cc) + count($this->bcc)) < 1)
-        {
-            $this->error_handler("You must provide at least one recipient email address");
-            return false;
-        }
-
-        // Set whether the message is multipart/alternative
-        if(!empty($this->AltBody))
-            $this->ContentType = "multipart/alternative";
-
-        $header = $this->create_header();
-        if(!$body = $this->create_body())
-            return false;
-
-        // Seed randomizer
-        mt_srand(time());
-        $msg_id = md5(uniqid(mt_rand()));
-        
-        $fp = @fopen($queue_path . $msg_id . ".pqm", "wb");
-        if(!$fp)
-        {
-            $this->error_handler(sprintf("Could not write to %s directory", $queue_path));
-            return false;
-        }
-       
-        $message[] = sprintf("----START PQM HEADER----%s", $this->LE);
-        $message[] = sprintf("SendTime: %s%s", $send_time, $this->LE);
-        $message[] = sprintf("Mailer: %s%s", $this->Mailer, $this->LE);
-
-        // Choose the mailer
-        if($this->Mailer == "sendmail")
-        {
-            $message[] = sprintf("Sendmail: %s%s", $this->Sendmail, $this->LE);
-            $message[] = sprintf("Sender: %s%s", $this->Sender, $this->LE);
-        }
-        elseif($this->Mailer == "mail")
-        {
-            $message[] = sprintf("Sender: %s%s", $this->Sender, $this->LE);
-            $message[] = sprintf("Subject: %s%s", $this->Subject, $this->LE);
-            $message[] = sprintf("to: %s%s", $this->addr_list($this->to), $this->LE);
-        }
-        elseif($this->Mailer == "smtp")
-        {
-            $message[] = sprintf("Host: %s%s", $this->Host, $this->LE);
-            $message[] = sprintf("Port: %d%s", $this->Port, $this->LE);
-            $message[] = sprintf("Helo: %s%s", $this->Helo, $this->LE);
-            $message[] = sprintf("Timeout: %d%s", $this->Timeout, $this->LE);
-            
-            if($this->SMTPAuth)
-                $auth_no = 1;
-            else
-                $auth_no = 0;
-            $message[] = sprintf("SMTPAuth: %d%s", $auth_no, $this->LE);
-            $message[] = sprintf("Username: %s%s", $this->Username, $this->LE);
-            $message[] = sprintf("Password: %s%s", $this->Password, $this->LE);
-            $message[] = sprintf("From: %s%s", $this->From, $this->LE);
-
-            $message[] = sprintf("to: %s%s", $this->addr_list($this->to), $this->LE);
-            $message[] = sprintf("cc: %s%s", $this->addr_list($this->cc), $this->LE);
-            $message[] = sprintf("bcc: %s%s", $this->addr_list($this->bcc), $this->LE);
-        }
-        else
-        {
-            $this->error_handler(sprintf("%s mailer is not supported", $this->Mailer));
-            return false;
-        }
-
-        $message[] = sprintf("----END PQM HEADER----%s", $this->LE); // end of pqm header        
-        $message[] = $header;
-        $message[] = $body;
-       
-        if(fwrite($fp, join("", $message)) == -1)
-        {
-            $this->error_handler("Write to file failed");
-            return false;
-        }
-        fclose($fp);
-
-        return ($msg_id . ".pqm");
-    }
-
-    /**
-     * Sends mail using the $Sendmail program.  Returns bool.
-     * @access private
-     * @return bool
-     */
-    function sendmail_send($header, $body) {
-        if ($this->Sender != "")
-            $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender);
-        else
-            $sendmail = sprintf("%s -oi -t", $this->Sendmail);
-
-        if(!@$mail = popen($sendmail, "w"))
-        {
-            $this->error_handler(sprintf("Could not execute %s", $this->Sendmail));
-            return false;
-        }
-
-        fputs($mail, $header);
-        fputs($mail, $body);
-        
-        $result = pclose($mail) >> 8 & 0xFF;
-        if($result != 0)
-        {
-            $this->error_handler(sprintf("Could not execute %s", $this->Sendmail));
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Sends mail using the PHP mail() function.  Returns bool.
-     * @access private
-     * @return bool
-     */
-    function mail_send($header, $body) {
-        //$to = substr($this->addr_append("To", $this->to), 4, -2);
-
-        // Cannot add Bcc's to the $to
-        $to = $this->to[0][0]; // no extra comma
-        for($i = 1; $i < count($this->to); $i++)
-            $to .= sprintf(",%s", $this->to[$i][0]);
-
-        if ($this->Sender != "" && PHP_VERSION >= "4.0")
-        {
-            $old_from = ini_get("sendmail_from");
-            ini_set("sendmail_from", $this->Sender);
-        }
-
-        if ($this->Sender != "" && PHP_VERSION >= "4.0.5")
-        {
-            // The fifth parameter to mail is only available in PHP >= 4.0.5
-            $params = sprintf("-oi -f %s", $this->Sender);
-            $rt = @mail($to, $this->encode_header($this->Subject), $body, $header, $params);
-        }
-        else
-        {
-            $rt = @mail($to, $this->encode_header($this->Subject), $body, $header);
-        }
-
-        if (isset($old_from))
-            ini_set("sendmail_from", $old_from);
-
-        if(!$rt)
-        {
-            $this->error_handler("Could not instantiate mail()");
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Sends mail via SMTP using PhpSMTP (Author:
-     * Chris Ryan).  Returns bool.  Returns false if there is a
-     * bad MAIL FROM, RCPT, or DATA input.
-     * @access private
-     * @return bool
-     */
-    function smtp_send($header, $body) {
-        // Include SMTP class code, but not twice
-        include_once($this->PluginDir . "class.smtp.php");
-
-        $smtp = new SMTP;
-
-        $smtp->do_debug = $this->SMTPDebug;
-
-        // Try to connect to all SMTP servers
-        $hosts = explode(";", $this->Host);
-        $index = 0;
-        $connection = false;
-        $smtp_from = "";
-        $bad_rcpt = array();
-        $e = "";
-
-        // Retry while there is no connection
-        while($index < count($hosts) && $connection == false)
-        {
-            if(strstr($hosts[$index], ":"))
-                list($host, $port) = explode(":", $hosts[$index]);
-            else
-            {
-                $host = $hosts[$index];
-                $port = $this->Port;
-            }
-
-            if($smtp->Connect($host, $port, $this->Timeout))
-                $connection = true;
-            //printf("%s host could not connect<br>", $hosts[$index]); //debug only
-            $index++;
-        }
-        if(!$connection)
-        {
-            $this->error_handler("SMTP Error: could not connect to SMTP host server(s)");
-            return false;
-        }
-
-        // Must perform HELO before authentication
-	if ($this->Helo != '')
-            $smtp->Hello($this->Helo);
-        else
-            $smtp->Hello($this->get_server_hostname());
-
-        // If user requests SMTP authentication
-        if($this->SMTPAuth)
-        {
-            if(!$smtp->Authenticate($this->Username, $this->Password))
-            {
-                $this->error_handler("SMTP Error: Could not authenticate");
-                return false;
-            }
-        }
-
-        if ($this->Sender == "")
-            $smtp_from = $this->From;
-        else
-            $smtp_from = $this->Sender;
-
-        if(!$smtp->Mail(sprintf("<%s>", $smtp_from)))
-        {
-            $e = sprintf("SMTP Error: From address [%s] failed", $smtp_from);
-            $this->error_handler($e);
-            return false;
-        }
-
-        // Attempt to send attach all recipients
-        for($i = 0; $i < count($this->to); $i++)
-        {
-            if(!$smtp->Recipient(sprintf("<%s>", $this->to[$i][0])))
-                $bad_rcpt[] = $this->to[$i][0];
-        }
-        for($i = 0; $i < count($this->cc); $i++)
-        {
-            if(!$smtp->Recipient(sprintf("<%s>", $this->cc[$i][0])))
-                $bad_rcpt[] = $this->cc[$i][0];
-        }
-        for($i = 0; $i < count($this->bcc); $i++)
-        {
-            if(!$smtp->Recipient(sprintf("<%s>", $this->bcc[$i][0])))
-                $bad_rcpt[] = $this->bcc[$i][0];
-        }
-
-        // Create error message
-        if(count($bad_rcpt) > 0)
-        {
-            for($i = 0; $i < count($bad_rcpt); $i++)
-            {
-                if($i != 0)
-                    $e .= ", ";
-                $e .= $bad_rcpt[$i];
-            }
-            $e = sprintf("SMTP Error: The following recipients failed [%s]", $e);
-            $this->error_handler($e);
-
-            return false;
-        }
-
-
-        if(!$smtp->Data(sprintf("%s%s", $header, $body)))
-        {
-            $this->error_handler("SMTP Error: Data not accepted");
-            return false;
-        }
-        $smtp->Quit();
-        $smtp->Close();
-
-        return true;
-    }
-
-
-    /////////////////////////////////////////////////
-    // MESSAGE CREATION METHODS
-    /////////////////////////////////////////////////
-
-    /**
-     * Creates recipient headers.  Returns string.
-     * @access private
-     * @return string
-     */
-    function addr_append($type, $addr) {
-        $addr_str = $type . ": ";
-        $addr_str .= $this->addr_format($addr[0]);
-        if(count($addr) > 1)
-        {
-            for($i = 1; $i < count($addr); $i++)
-            {
-                $addr_str .= sprintf(", %s", $this->addr_format($addr[$i]));
-            }
-            $addr_str .= $this->LE;
-        }
-        else
-            $addr_str .= $this->LE;
-
-        return($addr_str);
-    }
-    
-    /**
-     * Creates a semicolon delimited list for use in pqm files.
-     * @access private
-     * @return string
-     */
-    function addr_list($list_array) {
-        $addr_list = "";
-        for($i = 0; $i < count($list_array); $i++)
-        {
-            if($i > 0)
-                $addr_list .= ";";
-            $addr_list .= $list_array[$i][0];
-        }
-        
-        return $addr_list;
-    }
-    
-    /**
-     * Formats an address correctly. 
-     * @access private
-     * @return string
-     */
-    function addr_format($addr) {
-        if(empty($addr[1]))
-            $formatted = $addr[0];
-        else
-            $formatted = sprintf('%s <%s>', $this->encode_header($addr[1], 'phrase'), $addr[0]);
-
-        return $formatted;
-    }
-
-    /**
-     * Wraps message for use with mailers that do not
-     * automatically perform wrapping and for quoted-printable.
-     * Original written by philippe.  Returns string.
-     * @access private
-     * @return string
-     */
-    function word_wrap($message, $length, $qp_mode = false) {
-        if ($qp_mode)
-        $soft_break = sprintf(" =%s", $this->LE);
-        else
-        $soft_break = $this->LE;
-
-        $message = $this->fix_eol($message);
-        if (substr($message, -1) == $this->LE)
-        $message = substr($message, 0, -1);
-
-        $line = explode($this->LE, $message);
-        $message = "";
-        for ($i=0 ;$i < count($line); $i++)
-        {
-          $line_part = explode(" ", $line[$i]);
-          $buf = "";
-          for ($e = 0; $e<count($line_part); $e++)
-          {
-              $word = $line_part[$e];
-              if ($qp_mode and (strlen($word) > $length))
-              {
-                $space_left = $length - strlen($buf) - 1;
-                if ($e != 0)
-                {
-                    if ($space_left > 20)
-                    {
-                        $len = $space_left;
-                        if (substr($word, $len - 1, 1) == "=")
-                          $len--;
-                        elseif (substr($word, $len - 2, 1) == "=")
-                          $len -= 2;
-                        $part = substr($word, 0, $len);
-                        $word = substr($word, $len);
-                        $buf .= " " . $part;
-                        $message .= $buf . sprintf("=%s", $this->LE);
-                    }
-                    else
-                    {
-                        $message .= $buf . $soft_break;
-                    }
-                    $buf = "";
-                }
-                while (strlen($word) > 0)
-                {
-                    $len = $length;
-                    if (substr($word, $len - 1, 1) == "=")
-                        $len--;
-                    elseif (substr($word, $len - 2, 1) == "=")
-                        $len -= 2;
-                    $part = substr($word, 0, $len);
-                    $word = substr($word, $len);
-
-                    if (strlen($word) > 0)
-                        $message .= $part . sprintf("=%s", $this->LE);
-                    else
-                        $buf = $part;
-                }
-              }
-              else
-              {
-                $buf_o = $buf;
-                if ($e == 0)
-                    $buf .= $word;
-                else
-                    $buf .= " " . $word;
-                if (strlen($buf) > $length and $buf_o != "")
-                {
-                    $message .= $buf_o . $soft_break;
-                    $buf = $word;
-                }
-              }
-          }
-          $message .= $buf . $this->LE;
-        }
-
-        return ($message);
-    }
-    
-    /**
-     * Set the body wrapping.
-     * @access private
-     * @return void
-     */
-    function SetWordWrap() {
-        if($this->WordWrap < 1)
-            return;
-            
-        switch($this->message_type)
-        {
-           case "alt":
-           case "alt_attachment":
-              $this->AltBody = $this->word_wrap($this->AltBody, $this->WordWrap);
-              break;
-           default:
-              $this->Body = $this->word_wrap($this->Body, $this->WordWrap);
-              break;
-        }
-    }
-
-    /**
-     * Assembles message header.  Returns a string if successful
-     * or false if unsuccessful.
-     * @access private
-     * @return string
-     */
-    function create_header() {
-        $header = array();
-        
-        // Set the boundaries
-        $uniq_id = md5(uniqid(time()));
-        $this->boundary[1] = "b1_" . $uniq_id;
-        $this->boundary[2] = "b2_" . $uniq_id;
-
-        // To be created automatically by mail()
-        if($this->Mailer != "mail")
-        {
-            if(count($this->to) > 0)
-                $header[] = $this->addr_append("To", $this->to);
-            else if (count($this->cc) == 0)
-                $header[] = "To: undisclosed-recipients:;".$this->LE;
-        }
-
-        $from = array();
-        $from[0][0] = trim($this->From);
-        $from[0][1] = $this->FromName;
-        $header[] = $this->addr_append("From", $from); 
-
-        if(count($this->cc) > 0)
-            $header[] = $this->addr_append("Cc", $this->cc);
-
-        // sendmail and mail() extract Bcc from the header before sending
-        if((($this->Mailer == "sendmail") || ($this->Mailer == "mail")) && (count($this->bcc) > 0))
-            $header[] = $this->addr_append("Bcc", $this->bcc);
-
-        if(count($this->ReplyTo) > 0)
-            $header[] = $this->addr_append("Reply-to", $this->ReplyTo);
-
-        // mail() sets the subject itself
-        if($this->Mailer != "mail")
-            $header[] = sprintf("Subject: %s%s", $this->encode_header(trim($this->Subject)), $this->LE);
-
-        $header[] = sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->get_server_hostname(), $this->LE);
-        $header[] = sprintf("X-Priority: %d%s", $this->Priority, $this->LE);
-        $header[] = sprintf("X-Mailer: phpmailer [version %s]%s", $this->Version, $this->LE);
-        if($this->Sender == "")
-            $header[] = sprintf("Return-Path: %s%s", trim($this->From), $this->LE);
-        else
-            $header[] = sprintf("Return-Path: %s%s", trim($this->Sender), $this->LE);
-        
-        if($this->ConfirmReadingTo != "")
-            $header[] = sprintf("Disposition-Notification-To: <%s>%s", 
-                            trim($this->ConfirmReadingTo), $this->LE);
-
-        // Add custom headers
-        for($index = 0; $index < count($this->CustomHeader); $index++)
-            $header[] = sprintf("%s: %s%s", trim($this->CustomHeader[$index][0]), $this->encode_header(trim($this->CustomHeader[$index][1])), $this->LE);
-
-        if($this->UseMSMailHeaders)
-            $header[] = $this->AddMSMailHeaders();
-
-        $header[] = sprintf("MIME-Version: 1.0%s", $this->LE);
-
-        // Determine what type of message this is        
-        if(count($this->attachment) < 1 && strlen($this->AltBody) < 1)
-            $this->message_type = "plain";
-        else
-        {
-            if(count($this->attachment) > 0)
-                $this->message_type = "attachments";
-            if(strlen($this->AltBody) > 0 && count($this->attachment) < 1)
-                $this->message_type = "alt";
-            if(strlen($this->AltBody) > 0 && count($this->attachment) > 0)
-                $this->message_type = "alt_attachments";
-        }
-        
-        switch($this->message_type)
-        {
-            case "plain":
-                $header[] = sprintf("Content-Transfer-Encoding: %s%s", 
-                                    $this->Encoding, $this->LE);
-                $header[] = sprintf("Content-Type: %s; charset=\"%s\"",
-                                    $this->ContentType, $this->CharSet);
-                break;
-            case "attachments":
-            case "alt_attachments":
-                if($this->EmbeddedImageCount() > 0)
-                {
-                    $header[] = sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 
-                                    "multipart/related", $this->LE, $this->LE, 
-                                    $this->boundary[1], $this->LE);
-                }
-                else
-                {
-                    $header[] = sprintf("Content-Type: %s;%s",
-                                    "multipart/mixed", $this->LE);
-                    $header[] = sprintf("\tboundary=\"%s\"%s", $this->boundary[1], $this->LE);
-                }
-                break;
-            case "alt":
-                $header[] = sprintf("Content-Type: %s;%s",
-                                    "multipart/alternative", $this->LE);
-                $header[] = sprintf("\tboundary=\"%s\"%s", $this->boundary[1], $this->LE);
-                break;
-        }
-
-        // No additional lines when using mail() function
-        if($this->Mailer != "mail")
-            $header[] = $this->LE.$this->LE;
-
-        return(join("", $header));
-    }
-
-    /**
-     * Assembles the message body.  Returns a string if successful
-     * or false if unsuccessful.
-     * @access private
-     * @return string
-     */
-    function create_body() {
-        $body = array();
-
-        $this->SetWordWrap();
-
-        switch($this->message_type)
-        {
-            case "alt":
-                // Return text of body
-                $bndry = new Boundary($this->boundary[1]);
-                $bndry->CharSet = $this->CharSet;
-                $bndry->Encoding = $this->Encoding;
-                $body[] = $bndry->GetSource();
-    
-                $body[] = $this->encode_string($this->AltBody, $this->Encoding);
-                $body[] = $this->LE.$this->LE;
-    
-                $bndry = new Boundary($this->boundary[1]);
-                $bndry->CharSet = $this->CharSet;
-                $bndry->ContentType = "text/html";
-                $bndry->Encoding = $this->Encoding;
-                $body[] = $bndry->GetSource();
-                
-                $body[] = $this->encode_string($this->Body, $this->Encoding);
-                $body[] = $this->LE.$this->LE;
-    
-                // End the boundary
-                $body[] = sprintf("%s--%s--%s", $this->LE, 
-                                  $this->boundary[1], $this->LE.$this->LE);
-                break;
-            case "plain":
-                $body[] = $this->encode_string($this->Body, $this->Encoding);
-                break;
-            case "attachments":
-                $bndry = new Boundary($this->boundary[1]);
-                $bndry->CharSet = $this->CharSet;
-                $bndry->ContentType = $this->ContentType;
-                $bndry->Encoding = $this->Encoding;
-                $body[] = $bndry->GetSource(false) . $this->LE;
-                $body[] = $this->encode_string($this->Body, $this->Encoding);
-                $body[] = $this->LE;
-     
-                if(!$body[] = $this->attach_all())
-                    return false;
-                break;
-            case "alt_attachments":
-                $body[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
-                $body[] = sprintf("Content-Type: %s;%s" .
-                                  "\tboundary=\"%s\"%s",
-                                   "multipart/alternative", $this->LE, 
-                                   $this->boundary[2], $this->LE.$this->LE);
-    
-                // Create text body
-                $bndry = new Boundary($this->boundary[2]);
-                $bndry->CharSet = $this->CharSet;
-                $bndry->ContentType = "text/plain";
-                $bndry->Encoding = $this->Encoding;
-                $body[] = $bndry->GetSource() . $this->LE;
-    
-                $body[] = $this->encode_string($this->AltBody, $this->Encoding);
-                $body[] = $this->LE.$this->LE;
-    
-                // Create the HTML body
-                $bndry = new Boundary($this->boundary[2]);
-                $bndry->CharSet = $this->CharSet;
-                $bndry->ContentType = "text/html";
-                $bndry->Encoding = $this->Encoding;
-                $body[] = $bndry->GetSource() . $this->LE;
-    
-                $body[] = $this->encode_string($this->Body, $this->Encoding);
-                $body[] = $this->LE.$this->LE;
-
-                $body[] = sprintf("%s--%s--%s", $this->LE, 
-                                  $this->boundary[2], $this->LE.$this->LE);
-                
-                if(!$body[] = $this->attach_all())
-                    return false;
-                break;
-        }
-        $sBody = join("", $body);
-
-        return $sBody;
-    }
-
-
-    /////////////////////////////////////////////////
-    // ATTACHMENT METHODS
-    /////////////////////////////////////////////////
-
-    /**
-     * Adds an attachment from a path on the filesystem.
-     * Checks if attachment is valid and then adds
-     * the attachment to the list.
-     * Returns false if the file could not be found
-     * or accessed.
-     * @access public
-     * @return bool
-     */
-    function AddAttachment($path, $name = "", $encoding = "base64", $type = "application/octet-stream") {
-        if(!@is_file($path))
-        {
-            $this->error_handler(sprintf("Could not access [%s] file", $path));
-            return false;
-        }
-
-        $filename = basename($path);
-        if($name == "")
-            $name = $filename;
-
-        // Append to $attachment array
-        $cur = count($this->attachment);
-        $this->attachment[$cur][0] = $path;
-        $this->attachment[$cur][1] = $filename;
-        $this->attachment[$cur][2] = $name;
-        $this->attachment[$cur][3] = $encoding;
-        $this->attachment[$cur][4] = $type;
-        $this->attachment[$cur][5] = false; // isStringAttachment
-        $this->attachment[$cur][6] = "attachment";
-        $this->attachment[$cur][7] = 0;
-
-        return true;
-    }
-
-    /**
-     * Attaches all fs, string, and binary attachments to the message.
-     * Returns a string if successful or false if unsuccessful.
-     * @access private
-     * @return string
-     */
-    function attach_all() {
-        // Return text of body
-        $mime = array();
-
-        // Add all attachments
-        for($i = 0; $i < count($this->attachment); $i++)
-        {
-            // Check for string attachment
-            $bString = $this->attachment[$i][5];
-            if ($bString)
-            {
-                $string = $this->attachment[$i][0];
-            }
-            else
-            {
-                $path = $this->attachment[$i][0];
-            }
-            $filename    = $this->attachment[$i][1];
-            $name        = $this->attachment[$i][2];
-            $encoding    = $this->attachment[$i][3];
-            $type        = $this->attachment[$i][4];
-            $disposition = $this->attachment[$i][6];
-            $cid         = $this->attachment[$i][7];
-            
-            $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
-            $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE);
-            $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
-
-            if($disposition == "inline")
-                $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
-
-            $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", 
-                              $disposition, $name, $this->LE.$this->LE);
-
-            // Encode as string attachment
-            if($bString)
-            {
-                if(!$mime[] = $this->encode_string($string, $encoding))                
-                    return false;
-                $mime[] = $this->LE.$this->LE;
-            }
-            else
-            {
-                if(!$mime[] = $this->encode_file($path, $encoding))                
-                    return false;
-                $mime[] = $this->LE.$this->LE;
-            }
-        }
-
-        $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
-
-        return(join("", $mime));
-    }
-    
-    /**
-     * Encodes attachment in requested format.  Returns a
-     * string if successful or false if unsuccessful.
-     * @access private
-     * @return string
-     */
-    function encode_file ($path, $encoding = "base64") {
-        if(!@$fd = fopen($path, "rb"))
-        {
-            $this->error_handler(sprintf("File Error: Could not open file %s", $path));
-            return false;
-        }
-        $file_buffer = fread($fd, filesize($path));
-        $file_buffer = $this->encode_string($file_buffer, $encoding);
-        fclose($fd);
-
-        return $file_buffer;
-    }
-
-    /**
-     * Encodes string to requested format. Returns a
-     * string if successful or false if unsuccessful.
-     * @access private
-     * @return string
-     */
-    function encode_string ($str, $encoding = "base64") {
-        switch(strtolower($encoding)) {
-          case "base64":
-              // chunk_split is found in PHP >= 3.0.6
-              $encoded = chunk_split(base64_encode($str));
-              break;
-
-          case "7bit":
-          case "8bit":
-              $encoded = $this->fix_eol($str);
-              if (substr($encoded, -2) != $this->LE)
-                $encoded .= $this->LE;
-              break;
-
-          case "binary":
-              $encoded = $str;
-              break;
-
-          case "quoted-printable":
-              $encoded = $this->encode_qp($str);
-              break;
-
-          default:
-              $this->error_handler(sprintf("Unknown encoding: %s", $encoding));
-              return false;
-        }
-        return($encoded);
-    }
-
-    /**
-     * Encode a header string to best of Q, B, quoted or none.  Returns a string.
-     * @access private
-     * @return string
-     */
-    function encode_header ($str, $position = 'text') {
-      $x = 0;
-      
-      switch (strtolower($position)) {
-        case 'phrase':
-          if (preg_match_all('/[\200-\377]/', $str, $matches) == 0) {
-            // Can't use addslashes as we don't know what value has magic_quotes_sybase.
-            $encoded = addcslashes($str, '\000-\037\177');
-            $encoded = preg_replace('/([\"])/', '\\"', $encoded);
-
-            if (($str == $encoded) && (preg_match_all('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str, $matches) == 0))
-              return ($encoded);
-            else
-              return ("\"$encoded\"");
-          }
-          $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
-          break;
-        case 'comment':
-          $x = preg_match_all('/[()"]/', $str, $matches);
-          // Fall-through
-        case 'text':
-        default:
-          $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
-          break;
-      }
-
-      if ($x == 0)
-        return ($str);
-
-      $maxlen = 75 - 7 - strlen($this->CharSet);
-      // Try to select the encoding which should produce the shortest output
-//     if (strlen($str)/3 < $x) {
-        $encoding = 'B';
-        $encoded = base64_encode($str);
-        $maxlen -= $maxlen % 4;
-        $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
-//      } else {
-//        $encoding = 'Q';
-//        $encoded = $this->encode_q($str, $position);
-//        $encoded = $this->word_wrap($encoded, $maxlen, true);
-//        $encoded = str_replace("=".$this->LE, "\n", trim($encoded));
-//      }
-
-      $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
-      $encoded = trim(str_replace("\n", $this->LE, $encoded));
-      
-      return($encoded);
-    }
-    
-    /**
-     * Encode string to quoted-printable.  Returns a string.
-     * @access private
-     * @return string
-     */
-    function encode_qp ($str) {
-        $encoded = $this->fix_eol($str);
-        if (substr($encoded, -2) != $this->LE)
-            $encoded .= $this->LE;
-
-        // Replace every high ascii, control and = characters
-        $encoded = preg_replace('/([\000-\010\013\014\016-\037\075\177-\377])/e',
-                  "'='.sprintf('%02X', ord('\\1'))", $encoded);
-        // Replace every spaces and tabs when it's the last character on a line
-        $encoded = preg_replace("/([\011\040])".$this->LE."/e",
-                  "'='.sprintf('%02X', ord('\\1')).'".$this->LE."'", $encoded);
-
-        // Maximum line length of 76 characters before CRLF (74 + space + '=')
-        $encoded = $this->word_wrap($encoded, 74, true);
-
-        return $encoded;
-    }
-
-    /**
-     * Encode string to q encoding.  Returns a string.
-     * @access private
-     * @return string
-     */
-    function encode_q ($str, $position = 'text') {
-        // There should not be any EOL in the string
-        $encoded = preg_replace("[\r\n]", "", $str);
-
-        switch (strtolower($position)) {
-          case 'phrase':
-            $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
-            break;
-          case 'comment':
-            $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
-            // Fall-through
-          case 'text':
-          default:
-            // Replace every high ascii, control =, ? and _ characters
-            $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
-                  "'='.sprintf('%02X', ord('\\1'))", $encoded);
-            break;
-        }
-        
-        // Replace every spaces to _ (more readable than =20)
-        $encoded = str_replace(" ", "_", $encoded);
-
-        return $encoded;
-    }
-
-    /**
-     * Adds a string or binary attachment (non-filesystem) to the list.
-     * This method can be used to attach ascii or binary data,
-     * such as a BLOB record from a database.
-     * @access public
-     * @return void
-     */
-    function AddStringAttachment($string, $filename, $encoding = "base64", $type = "application/octet-stream") {
-        // Append to $attachment array
-        $cur = count($this->attachment);
-        $this->attachment[$cur][0] = $string;
-        $this->attachment[$cur][1] = $filename;
-        $this->attachment[$cur][2] = $filename;
-        $this->attachment[$cur][3] = $encoding;
-        $this->attachment[$cur][4] = $type;
-        $this->attachment[$cur][5] = true; // isString
-        $this->attachment[$cur][6] = "attachment";
-        $this->attachment[$cur][7] = 0;
-    }
-    
-    /**
-     * Adds an embedded attachment.  This can include images, sounds, and 
-     * just about any other document.  
-     * @param cid this is the Content Id of the attachment.  Use this to identify
-     *        the Id for accessing the image in an HTML form.
-     * @access public
-     * @return bool
-     */
-    function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", $type = "application/octet-stream") {
-    
-        if(!@is_file($path))
-        {
-            $this->error_handler(sprintf("Could not access [%s] file", $path));
-            return false;
-        }
-
-        $filename = basename($path);
-        if($name == "")
-            $name = $filename;
-
-        // Append to $attachment array
-        $cur = count($this->attachment);
-        $this->attachment[$cur][0] = $path;
-        $this->attachment[$cur][1] = $filename;
-        $this->attachment[$cur][2] = $name;
-        $this->attachment[$cur][3] = $encoding;
-        $this->attachment[$cur][4] = $type;
-        $this->attachment[$cur][5] = false; // isStringAttachment
-        $this->attachment[$cur][6] = "inline";
-        $this->attachment[$cur][7] = $cid;
-    
-        return true;
-    }
-    
-    /**
-     * Returns the number of embedded images in an email.
-     * @access private
-     * @return int
-     */
-    function EmbeddedImageCount() {
-        $ret = 0;
-        for($i = 0; $i < count($this->attachment); $i++)
-        {
-            if($this->attachment[$i][6] == "inline")
-                $ret++;
-        }
-        
-        return $ret;
-    }
-
-    /////////////////////////////////////////////////
-    // MESSAGE RESET METHODS
-    /////////////////////////////////////////////////
-
-    /**
-     * Clears all recipients assigned in the TO array.  Returns void.
-     * @access public
-     * @return void
-     */
-    function ClearAddresses() {
-        $this->to = array();
-    }
-
-    /**
-     * Clears all recipients assigned in the CC array.  Returns void.
-     * @access public
-     * @return void
-     */
-    function ClearCCs() {
-        $this->cc = array();
-    }
-
-    /**
-     * Clears all recipients assigned in the BCC array.  Returns void.
-     * @access public
-     * @return void
-     */
-    function ClearBCCs() {
-        $this->bcc = array();
-    }
-
-    /**
-     * Clears all recipients assigned in the ReplyTo array.  Returns void.
-     * @access public
-     * @return void
-     */
-    function ClearReplyTos() {
-        $this->ReplyTo = array();
-    }
-
-    /**
-     * Clears all recipients assigned in the TO, CC and BCC
-     * array.  Returns void.
-     * @access public
-     * @return void
-     */
-    function ClearAllRecipients() {
-        $this->to = array();
-        $this->cc = array();
-        $this->bcc = array();
-    }
-
-    /**
-     * Clears all previously set filesystem, string, and binary
-     * attachments.  Returns void.
-     * @access public
-     * @return void
-     */
-    function ClearAttachments() {
-        $this->attachment = array();
-    }
-
-    /**
-     * Clears all custom headers.  Returns void.
-     * @access public
-     * @return void
-     */
-    function ClearCustomHeaders() {
-        $this->CustomHeader = array();
-    }
-
-
-    /////////////////////////////////////////////////
-    // MISCELLANEOUS METHODS
-    /////////////////////////////////////////////////
-
-    /**
-     * Adds the error message to the error container.
-     * Returns void.
-     * @access private
-     * @return void
-     */
-    function error_handler($msg) {
-        $this->ErrorInfo = $msg;
-    }
-
-    /**
-     * Returns the proper RFC 822 formatted date. Returns string.
-     * @access private
-     * @return string
-     */
-    function rfc_date() {
-        $tz = date("Z");
-        $tzs = ($tz < 0) ? "-" : "+";
-        $tz = abs($tz);
-        $tz = ($tz/3600)*100 + ($tz%3600)/60;
-        $date = sprintf("%s %s%04d", date("D, j M Y H:i:s"), $tzs, $tz);
-        return $date;
-    }
-
-    /**
-     * Returns received header for message tracing. Returns string.
-     * @access private
-     * @return string
-     */
-    function received() {
-        // Check for vars because they might not exist.  Possibly
-        // write a small retrieval function (that mailer can use too!)
-
-        if ($this->get_server_var('SERVER_NAME') != '')
-	{
-            $protocol = ($this->get_server_var('HTTPS') == 'on') ? 'HTTPS' : 'HTTP';
-	    $remote = $this->get_server_var('REMOTE_HOST');
-	    if ($remote == '')
-	        $remote = 'phpmailer';
-	    $remote .= ' (['.$this->get_server_var('REMOTE_ADDR').'])';
-	}
-        else
-	{
-            $protocol = 'local';
-	    $remote = $this->get_server_var('USER');
-	    if ($remote == '')
-	        $remote = 'phpmailer';
-	}
-
-        $str = sprintf("Received: from %s %s\tby %s " .
-               "with %s (phpmailer);%s\t%s%s",
-	       $remote,
-	       $this->LE,
-               $this->get_server_hostname(),
-	       $protocol,
-               $this->LE,
-               $this->rfc_date(),
-               $this->LE);
-
-        return $str;
-    }
-    
-    /**
-     * Returns the appropriate server variable.  Should work with both 
-     * PHP 4.1.0+ as well as older versions.  Returns an empty string 
-     * if nothing is found.
-     * @access private
-     * @return mixed
-     */
-    function get_server_var($varName) {
-        global $HTTP_SERVER_VARS;
-        global $HTTP_ENV_VARS;
-
-        if(!isset($_SERVER))
-        {
-            $_SERVER = $HTTP_SERVER_VARS;
-            if(!isset($_SERVER["REMOTE_ADDR"]))
-                $_SERVER = $HTTP_ENV_VARS; // must be Apache
-        }
-        
-        if(isset($_SERVER[$varName]))
-            return $_SERVER[$varName];
-        else
-            return "";
-    }
-
-    /**
-     * Returns the server hostname or 'localhost.localdomain' if unknown.
-     * @access private
-     * @return string
-     */
-    function get_server_hostname() {
-        if ($this->Hostname != '')
-	    return $this->Hostname;
-	elseif ($this->get_server_var('SERVER_NAME') != '')
-	    return $this->get_server_var('SERVER_NAME');
-	else
-	    return 'localhost.localdomain';
-    }
-
-    /**
-     * Changes every end of line from CR or LF to CRLF.  Returns string.
-     * @access private
-     * @return string
-     */
-    function fix_eol($str) {
-        $str = str_replace("\r\n", "\n", $str);
-        $str = str_replace("\r", "\n", $str);
-        $str = str_replace("\n", $this->LE, $str);
-        return $str;
-    }
-
-    /**
-     * Adds a custom header.  Returns void.
-     * @access public
-     * @return void
-     */
-    function AddCustomHeader($custom_header) {
-        // Append to $custom_header array
-        $this->CustomHeader[] = explode(":", $custom_header, 2);
-    }
-
-    /**
-     * Adds all the Microsoft message headers.  Returns string.
-     * @access private
-     * @return string
-     */
-    function AddMSMailHeaders() {
-        $MSHeader = "";
-        if($this->Priority == 1)
-            $MSPriority = "High";
-        elseif($this->Priority == 5)
-            $MSPriority = "Low";
-        else
-            $MSPriority = "Medium";
-
-        $MSHeader .= sprintf("X-MSMail-Priority: %s%s", $MSPriority, $this->LE);
-        $MSHeader .= sprintf("Importance: %s%s", $MSPriority, $this->LE);
-
-        return($MSHeader);
-    }
-
-}
-
-
-/**
- * Boundary - MIME message boundary class
- * @author Brent R. Matzelle
- */
-class Boundary
-{
-    /**
-     * Sets the boundary ID.
-     * @access private
-     * @var string
-     */
-    var $ID = 0;
-
-    /**
-     * Sets the boundary Content Type.
-     * @access public
-     * @var string
-     */
-    var $ContentType = "text/plain";
-
-    /**
-     * Sets the Encoding.
-     * @access public
-     * @var string
-     */
-    var $Encoding = "";
-
-    /**
-     * Sets an attachment disposition.
-     * @access public
-     * @var string
-     */
-    var $Disposition = "";
-
-    /**
-     * Sets an attachment file name.
-     * @access public
-     * @var string
-     */
-    var $FileName = "";
-    
-    /**
-     * Sets the Char set.
-     * @access public
-     * @var string
-     */
-    var $CharSet = "";
-    
-    /**
-     *  Sets the line endings of the message.  Default is "\n";
-     *  @access public
-     *  @var string
-     */
-    var $LE           = "\n";
-    
-    /**
-     * Main constructor.
-     */
-    function Boundary($boundary_id) {
-        $this->ID = $boundary_id;
-    }
-    
-    /**
-     * Returns the source of the boundary.
-     * @access public
-     * @return string
-     */
-    function GetSource($bLineEnding = true) {
-        $mime = array();
-        $mime[] = sprintf("--%s%s", $this->ID, $this->LE);
-        $mime[] = sprintf("Content-Type: %s; charset = \"%s\"%s", 
-                          $this->ContentType, $this->CharSet, $this->LE);
-        $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $this->Encoding, 
-                          $this->LE);
-        
-        if(strlen($this->Disposition) > 0)
-        {
-            $mime[] = sprintf("Content-Disposition: %s;");
-            if(strlen($this->FileName) > 0)
-                $mime[] = sprinf("filename=\"%s\"", $this->FileName);
-        }
-        
-        if($bLineEnding)
-            $mime[] = $this->LE;
-
-        return join("", $mime);
-    }
-}
-
-?>
+<?php
+////////////////////////////////////////////////////
+// PHPMailer - PHP email class
+//
+// Class for sending email using either
+// sendmail, PHP mail(), or SMTP.  Methods are
+// based upon the standard AspEmail(tm) classes.
+//
+// Copyright (C) 2001 - 2003  Brent R. Matzelle
+//
+// License: LGPL, see LICENSE
+////////////////////////////////////////////////////
+
+/**
+ * PHPMailer - PHP email transport class
+ * @package PHPMailer
+ * @author Brent R. Matzelle
+ * @copyright 2001 - 2003 Brent R. Matzelle
+ */
+class PHPMailer
+{
+    /////////////////////////////////////////////////
+    // PUBLIC VARIABLES
+    /////////////////////////////////////////////////
+
+    /**
+     * Email priority (1 = High, 3 = Normal, 5 = low).
+     * @var int
+     */
+    var $Priority          = 3;
+
+    /**
+     * Sets the CharSet of the message.
+     * @var string
+     */
+    var $CharSet           = "iso-8859-1";
+
+    /**
+     * Sets the Content-type of the message.
+     * @var string
+     */
+    var $ContentType        = "text/plain";
+
+    /**
+     * Sets the Encoding of the message. Options for this are "8bit",
+     * "7bit", "binary", "base64", and "quoted-printable".
+     * @var string
+     */
+    var $Encoding          = "8bit";
+
+    /**
+     * Holds the most recent mailer error message.
+     * @var string
+     */
+    var $ErrorInfo         = "";
+
+    /**
+     * Sets the From email address for the message.
+     * @var string
+     */
+    var $From               = "root@localhost";
+
+    /**
+     * Sets the From name of the message.
+     * @var string
+     */
+    var $FromName           = "Root User";
+
+    /**
+     * Sets the Sender email (Return-Path) of the message.  If not empty,
+     * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
+     * @var string
+     */
+    var $Sender            = "";
+
+    /**
+     * Sets the Subject of the message.
+     * @var string
+     */
+    var $Subject           = "";
+
+    /**
+     * Sets the Body of the message.  This can be either an HTML or text body.
+     * If HTML then run IsHTML(true).
+     * @var string
+     */
+    var $Body               = "";
+
+    /**
+     * Sets the text-only body of the message.  This automatically sets the
+     * email to multipart/alternative.  This body can be read by mail
+     * clients that do not have HTML email capability such as mutt. Clients
+     * that can read HTML will view the normal Body.
+     * @var string
+     */
+    var $AltBody           = "";
+
+    /**
+     * Sets word wrapping on the body of the message to a given number of 
+     * characters.
+     * @var int
+     */
+    var $WordWrap          = 0;
+
+    /**
+     * Method to send mail: ("mail", "sendmail", or "smtp").
+     * @var string
+     */
+    var $Mailer            = "mail";
+
+    /**
+     * Sets the path of the sendmail program.
+     * @var string
+     */
+    var $Sendmail          = "/usr/sbin/sendmail";
+    
+    /**
+     * Path to PHPMailer plugins.  This is now only useful if the SMTP class 
+     * is in a different directory than the PHP include path.  
+     * @var string
+     */
+    var $PluginDir         = "";
+
+    /**
+     *  Holds PHPMailer version.
+     *  @var string
+     */
+    var $Version           = "1.73";
+
+    /**
+     * Sets the email address that a reading confirmation will be sent.
+     * @var string
+     */
+    var $ConfirmReadingTo  = "";
+
+    /**
+     *  Sets the hostname to use in Message-Id and Received headers
+     *  and as default HELO string. If empty, the value returned
+     *  by SERVER_NAME is used or 'localhost.localdomain'.
+     *  @var string
+     */
+    var $Hostname          = "";
+
+    /////////////////////////////////////////////////
+    // SMTP VARIABLES
+    /////////////////////////////////////////////////
+
+    /**
+     *  Sets the SMTP hosts.  All hosts must be separated by a
+     *  semicolon.  You can also specify a different port
+     *  for each host by using this format: [hostname:port]
+     *  (e.g. "smtp1.example.com:25;smtp2.example.com").
+     *  Hosts will be tried in order.
+     *  @var string
+     */
+    var $Host        = "localhost";
+
+    /**
+     *  Sets the default SMTP server port.
+     *  @var int
+     */
+    var $Port        = 25;
+
+    /**
+     *  Sets the SMTP HELO of the message (Default is $Hostname).
+     *  @var string
+     */
+    var $Helo        = "";
+
+    /**
+     *  Sets SMTP authentication. Utilizes the Username and Password variables.
+     *  @var bool
+     */
+    var $SMTPAuth     = false;
+
+    /**
+     *  Sets SMTP username.
+     *  @var string
+     */
+    var $Username     = "";
+
+    /**
+     *  Sets SMTP password.
+     *  @var string
+     */
+    var $Password     = "";
+
+    /**
+     *  Sets the SMTP server timeout in seconds. This function will not 
+     *  work with the win32 version.
+     *  @var int
+     */
+    var $Timeout      = 10;
+
+    /**
+     *  Sets SMTP class debugging on or off.
+     *  @var bool
+     */
+    var $SMTPDebug    = false;
+
+    /**
+     * Prevents the SMTP connection from being closed after each mail 
+     * sending.  If this is set to true then to close the connection 
+     * requires an explicit call to SmtpClose(). 
+     * @var bool
+     */
+    var $SMTPKeepAlive = false;
+
+    /**#@+
+     * @access private
+     */
+    var $smtp            = NULL;
+    var $to              = array();
+    var $cc              = array();
+    var $bcc             = array();
+    var $ReplyTo         = array();
+    var $attachment      = array();
+    var $CustomHeader    = array();
+    var $message_type    = "";
+    var $boundary        = array();
+    var $language        = array();
+    var $error_count     = 0;
+    var $LE              = "\n";
+    /**#@-*/
+    
+    /////////////////////////////////////////////////
+    // VARIABLE METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Sets message type to HTML.  
+     * @param bool $bool
+     * @return void
+     */
+    function IsHTML($bool) {
+        if($bool == true)
+            $this->ContentType = "text/html";
+        else
+            $this->ContentType = "text/plain";
+    }
+
+    /**
+     * Sets Mailer to send message using SMTP.
+     * @return void
+     */
+    function IsSMTP() {
+        $this->Mailer = "smtp";
+    }
+
+    /**
+     * Sets Mailer to send message using PHP mail() function.
+     * @return void
+     */
+    function IsMail() {
+        $this->Mailer = "mail";
+    }
+
+    /**
+     * Sets Mailer to send message using the $Sendmail program.
+     * @return void
+     */
+    function IsSendmail() {
+        $this->Mailer = "sendmail";
+    }
+
+    /**
+     * Sets Mailer to send message using the qmail MTA. 
+     * @return void
+     */
+    function IsQmail() {
+        $this->Sendmail = "/var/qmail/bin/sendmail";
+        $this->Mailer = "sendmail";
+    }
+
+
+    /////////////////////////////////////////////////
+    // RECIPIENT METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Adds a "To" address.  
+     * @param string $address
+     * @param string $name
+     * @return void
+     */
+    function AddAddress($address, $name = "") {
+        $cur = count($this->to);
+        $this->to[$cur][0] = trim($address);
+        $this->to[$cur][1] = $name;
+    }
+
+    /**
+     * Adds a "Cc" address. Note: this function works
+     * with the SMTP mailer on win32, not with the "mail"
+     * mailer.  
+     * @param string $address
+     * @param string $name
+     * @return void
+    */
+    function AddCC($address, $name = "") {
+        $cur = count($this->cc);
+        $this->cc[$cur][0] = trim($address);
+        $this->cc[$cur][1] = $name;
+    }
+
+    /**
+     * Adds a "Bcc" address. Note: this function works
+     * with the SMTP mailer on win32, not with the "mail"
+     * mailer.  
+     * @param string $address
+     * @param string $name
+     * @return void
+     */
+    function AddBCC($address, $name = "") {
+        $cur = count($this->bcc);
+        $this->bcc[$cur][0] = trim($address);
+        $this->bcc[$cur][1] = $name;
+    }
+
+    /**
+     * Adds a "Reply-to" address.  
+     * @param string $address
+     * @param string $name
+     * @return void
+     */
+    function AddReplyTo($address, $name = "") {
+        $cur = count($this->ReplyTo);
+        $this->ReplyTo[$cur][0] = trim($address);
+        $this->ReplyTo[$cur][1] = $name;
+    }
+
+
+    /////////////////////////////////////////////////
+    // MAIL SENDING METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Creates message and assigns Mailer. If the message is
+     * not sent successfully then it returns false.  Use the ErrorInfo
+     * variable to view description of the error.  
+     * @return bool
+     */
+    function Send() {
+        $header = "";
+        $body = "";
+        $result = true;
+
+        if((count($this->to) + count($this->cc) + count($this->bcc)) < 1)
+        {
+            $this->SetError($this->Lang("provide_address"));
+            return false;
+        }
+
+        // Set whether the message is multipart/alternative
+        if(!empty($this->AltBody))
+            $this->ContentType = "multipart/alternative";
+
+        $this->error_count = 0; // reset errors
+        $this->SetMessageType();
+        $header .= $this->CreateHeader();
+        $body = $this->CreateBody();
+
+        if($body == "") { return false; }
+
+        // Choose the mailer
+        switch($this->Mailer)
+        {
+            case "sendmail":
+                $result = $this->SendmailSend($header, $body);
+                break;
+            case "mail":
+                $result = $this->MailSend($header, $body);
+                break;
+            case "smtp":
+                $result = $this->SmtpSend($header, $body);
+                break;
+            default:
+            $this->SetError($this->Mailer . $this->Lang("mailer_not_supported"));
+                $result = false;
+                break;
+        }
+
+        return $result;
+    }
+    
+    /**
+     * Sends mail using the $Sendmail program.  
+     * @access private
+     * @return bool
+     */
+    function SendmailSend($header, $body) {
+        if ($this->Sender != "")
+            $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
+        else
+            $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail));
+
+        if(!@$mail = popen($sendmail, "w"))
+        {
+            $this->SetError($this->Lang("execute") . $this->Sendmail);
+            return false;
+        }
+
+        fputs($mail, $header);
+        fputs($mail, $body);
+        
+        $result = pclose($mail) >> 8 & 0xFF;
+        if($result != 0)
+        {
+            $this->SetError($this->Lang("execute") . $this->Sendmail);
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Sends mail using the PHP mail() function.  
+     * @access private
+     * @return bool
+     */
+    function MailSend($header, $body) {
+        $to = "";
+        for($i = 0; $i < count($this->to); $i++)
+        {
+            if($i != 0) { $to .= ", "; }
+            $to .= $this->to[$i][0];
+        }
+
+        if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1)
+        {
+            $old_from = ini_get("sendmail_from");
+            ini_set("sendmail_from", $this->Sender);
+            $params = sprintf("-oi -f %s", $this->Sender);
+            $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, 
+                        $header, $params);
+        }
+        else
+            $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);
+
+        if (isset($old_from))
+            ini_set("sendmail_from", $old_from);
+
+        if(!$rt)
+        {
+            $this->SetError($this->Lang("instantiate"));
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Sends mail via SMTP using PhpSMTP (Author:
+     * Chris Ryan).  Returns bool.  Returns false if there is a
+     * bad MAIL FROM, RCPT, or DATA input.
+     * @access private
+     * @return bool
+     */
+    function SmtpSend($header, $body) {
+        include_once($this->PluginDir . "class.smtp.php");
+        $error = "";
+        $bad_rcpt = array();
+
+        if(!$this->SmtpConnect())
+            return false;
+
+        $smtp_from = ($this->Sender == "") ? $this->From : $this->Sender;
+        if(!$this->smtp->Mail($smtp_from))
+        {
+            $error = $this->Lang("from_failed") . $smtp_from;
+            $this->SetError($error);
+            $this->smtp->Reset();
+            return false;
+        }
+
+        // Attempt to send attach all recipients
+        for($i = 0; $i < count($this->to); $i++)
+        {
+            if(!$this->smtp->Recipient($this->to[$i][0]))
+                $bad_rcpt[] = $this->to[$i][0];
+        }
+        for($i = 0; $i < count($this->cc); $i++)
+        {
+            if(!$this->smtp->Recipient($this->cc[$i][0]))
+                $bad_rcpt[] = $this->cc[$i][0];
+        }
+        for($i = 0; $i < count($this->bcc); $i++)
+        {
+            if(!$this->smtp->Recipient($this->bcc[$i][0]))
+                $bad_rcpt[] = $this->bcc[$i][0];
+        }
+
+        if(count($bad_rcpt) > 0) // Create error message
+        {
+            for($i = 0; $i < count($bad_rcpt); $i++)
+            {
+                if($i != 0) { $error .= ", "; }
+                $error .= $bad_rcpt[$i];
+            }
+            $error = $this->Lang("recipients_failed") . $error;
+            $this->SetError($error);
+            $this->smtp->Reset();
+            return false;
+        }
+
+        if(!$this->smtp->Data($header . $body))
+        {
+            $this->SetError($this->Lang("data_not_accepted"));
+            $this->smtp->Reset();
+            return false;
+        }
+        if($this->SMTPKeepAlive == true)
+            $this->smtp->Reset();
+        else
+            $this->SmtpClose();
+
+        return true;
+    }
+
+    /**
+     * Initiates a connection to an SMTP server.  Returns false if the 
+     * operation failed.
+     * @access private
+     * @return bool
+     */
+    function SmtpConnect() {
+        if($this->smtp == NULL) { $this->smtp = new SMTP(); }
+
+        $this->smtp->do_debug = $this->SMTPDebug;
+        $hosts = explode(";", $this->Host);
+        $index = 0;
+        $connection = ($this->smtp->Connected()); 
+
+        // Retry while there is no connection
+        while($index < count($hosts) && $connection == false)
+        {
+            if(strstr($hosts[$index], ":"))
+                list($host, $port) = explode(":", $hosts[$index]);
+            else
+            {
+                $host = $hosts[$index];
+                $port = $this->Port;
+            }
+
+            if($this->smtp->Connect($host, $port, $this->Timeout))
+            {
+                if ($this->Helo != '')
+                    $this->smtp->Hello($this->Helo);
+                else
+                    $this->smtp->Hello($this->ServerHostname());
+        
+                if($this->SMTPAuth)
+                {
+                    if(!$this->smtp->Authenticate($this->Username, 
+                                                  $this->Password))
+                    {
+                        $this->SetError($this->Lang("authenticate"));
+                        $this->smtp->Reset();
+                        $connection = false;
+                    }
+                }
+                $connection = true;
+            }
+            $index++;
+        }
+        if(!$connection)
+            $this->SetError($this->Lang("connect_host"));
+
+        return $connection;
+    }
+
+    /**
+     * Closes the active SMTP session if one exists.
+     * @return void
+     */
+    function SmtpClose() {
+        if($this->smtp != NULL)
+        {
+            if($this->smtp->Connected())
+            {
+                $this->smtp->Quit();
+                $this->smtp->Close();
+            }
+        }
+    }
+
+    /**
+     * Sets the language for all class error messages.  Returns false 
+     * if it cannot load the language file.  The default language type
+     * is English.
+     * @param string $lang_type Type of language (e.g. Portuguese: "br")
+     * @param string $lang_path Path to the language file directory
+     * @access public
+     * @return bool
+     */
+    function SetLanguage($lang_type, $lang_path = "language/") {
+        if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php'))
+            include($lang_path.'phpmailer.lang-'.$lang_type.'.php');
+        else if(file_exists($lang_path.'phpmailer.lang-en.php'))
+            include($lang_path.'phpmailer.lang-en.php');
+        else
+        {
+            $this->SetError("Could not load language file");
+            return false;
+        }
+        $this->language = $PHPMAILER_LANG;
+    
+        return true;
+    }
+
+    /////////////////////////////////////////////////
+    // MESSAGE CREATION METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Creates recipient headers.  
+     * @access private
+     * @return string
+     */
+    function AddrAppend($type, $addr) {
+        $addr_str = $type . ": ";
+        $addr_str .= $this->AddrFormat($addr[0]);
+        if(count($addr) > 1)
+        {
+            for($i = 1; $i < count($addr); $i++)
+                $addr_str .= ", " . $this->AddrFormat($addr[$i]);
+        }
+        $addr_str .= $this->LE;
+
+        return $addr_str;
+    }
+    
+    /**
+     * Formats an address correctly. 
+     * @access private
+     * @return string
+     */
+    function AddrFormat($addr) {
+        if(empty($addr[1]))
+            $formatted = $addr[0];
+        else
+        {
+            $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" . 
+                         $addr[0] . ">";
+        }
+
+        return $formatted;
+    }
+
+    /**
+     * Wraps message for use with mailers that do not
+     * automatically perform wrapping and for quoted-printable.
+     * Original written by philippe.  
+     * @access private
+     * @return string
+     */
+    function WrapText($message, $length, $qp_mode = false) {
+        $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
+
+        $message = $this->FixEOL($message);
+        if (substr($message, -1) == $this->LE)
+            $message = substr($message, 0, -1);
+
+        $line = explode($this->LE, $message);
+        $message = "";
+        for ($i=0 ;$i < count($line); $i++)
+        {
+          $line_part = explode(" ", $line[$i]);
+          $buf = "";
+          for ($e = 0; $e<count($line_part); $e++)
+          {
+              $word = $line_part[$e];
+              if ($qp_mode and (strlen($word) > $length))
+              {
+                $space_left = $length - strlen($buf) - 1;
+                if ($e != 0)
+                {
+                    if ($space_left > 20)
+                    {
+                        $len = $space_left;
+                        if (substr($word, $len - 1, 1) == "=")
+                          $len--;
+                        elseif (substr($word, $len - 2, 1) == "=")
+                          $len -= 2;
+                        $part = substr($word, 0, $len);
+                        $word = substr($word, $len);
+                        $buf .= " " . $part;
+                        $message .= $buf . sprintf("=%s", $this->LE);
+                    }
+                    else
+                    {
+                        $message .= $buf . $soft_break;
+                    }
+                    $buf = "";
+                }
+                while (strlen($word) > 0)
+                {
+                    $len = $length;
+                    if (substr($word, $len - 1, 1) == "=")
+                        $len--;
+                    elseif (substr($word, $len - 2, 1) == "=")
+                        $len -= 2;
+                    $part = substr($word, 0, $len);
+                    $word = substr($word, $len);
+
+                    if (strlen($word) > 0)
+                        $message .= $part . sprintf("=%s", $this->LE);
+                    else
+                        $buf = $part;
+                }
+              }
+              else
+              {
+                $buf_o = $buf;
+                $buf .= ($e == 0) ? $word : (" " . $word); 
+
+                if (strlen($buf) > $length and $buf_o != "")
+                {
+                    $message .= $buf_o . $soft_break;
+                    $buf = $word;
+                }
+              }
+          }
+          $message .= $buf . $this->LE;
+        }
+
+        return $message;
+    }
+    
+    /**
+     * Set the body wrapping.
+     * @access private
+     * @return void
+     */
+    function SetWordWrap() {
+        if($this->WordWrap < 1)
+            return;
+            
+        switch($this->message_type)
+        {
+           case "alt":
+              // fall through
+           case "alt_attachments":
+              $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap);
+              break;
+           default:
+              $this->Body = $this->WrapText($this->Body, $this->WordWrap);
+              break;
+        }
+    }
+
+    /**
+     * Assembles message header.  
+     * @access private
+     * @return string
+     */
+    function CreateHeader() {
+        $result = "";
+        
+        // Set the boundaries
+        $uniq_id = md5(uniqid(time()));
+        $this->boundary[1] = "b1_" . $uniq_id;
+        $this->boundary[2] = "b2_" . $uniq_id;
+
+        $result .= $this->HeaderLine("Date", $this->RFCDate());
+        if($this->Sender == "")
+            $result .= $this->HeaderLine("Return-Path", trim($this->From));
+        else
+            $result .= $this->HeaderLine("Return-Path", trim($this->Sender));
+        
+        // To be created automatically by mail()
+        if($this->Mailer != "mail")
+        {
+            if(count($this->to) > 0)
+                $result .= $this->AddrAppend("To", $this->to);
+            else if (count($this->cc) == 0)
+                $result .= $this->HeaderLine("To", "undisclosed-recipients:;");
+            if(count($this->cc) > 0)
+                $result .= $this->AddrAppend("Cc", $this->cc);
+        }
+
+        $from = array();
+        $from[0][0] = trim($this->From);
+        $from[0][1] = $this->FromName;
+        $result .= $this->AddrAppend("From", $from); 
+
+        // sendmail and mail() extract Bcc from the header before sending
+        if((($this->Mailer == "sendmail") || ($this->Mailer == "mail")) && (count($this->bcc) > 0))
+            $result .= $this->AddrAppend("Bcc", $this->bcc);
+
+        if(count($this->ReplyTo) > 0)
+            $result .= $this->AddrAppend("Reply-to", $this->ReplyTo);
+
+        // mail() sets the subject itself
+        if($this->Mailer != "mail")
+            $result .= $this->HeaderLine("Subject", $this->EncodeHeader(trim($this->Subject)));
+
+        $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
+        $result .= $this->HeaderLine("X-Priority", $this->Priority);
+        $result .= $this->HeaderLine("X-Mailer", "PHPMailer [version " . $this->Version . "]");
+        
+        if($this->ConfirmReadingTo != "")
+        {
+            $result .= $this->HeaderLine("Disposition-Notification-To", 
+                       "<" . trim($this->ConfirmReadingTo) . ">");
+        }
+
+        // Add custom headers
+        for($index = 0; $index < count($this->CustomHeader); $index++)
+        {
+            $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), 
+                       $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
+        }
+        $result .= $this->HeaderLine("MIME-Version", "1.0");
+
+        switch($this->message_type)
+        {
+            case "plain":
+                $result .= $this->HeaderLine("Content-Transfer-Encoding", $this->Encoding);
+                $result .= sprintf("Content-Type: %s; charset=\"%s\"",
+                                    $this->ContentType, $this->CharSet);
+                break;
+            case "attachments":
+                // fall through
+            case "alt_attachments":
+                if($this->InlineImageExists())
+                {
+                    $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 
+                                    "multipart/related", $this->LE, $this->LE, 
+                                    $this->boundary[1], $this->LE);
+                }
+                else
+                {
+                    $result .= $this->HeaderLine("Content-Type", "multipart/mixed;");
+                    $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
+                }
+                break;
+            case "alt":
+                $result .= $this->HeaderLine("Content-Type", "multipart/alternative;");
+                $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
+                break;
+        }
+
+        if($this->Mailer != "mail")
+            $result .= $this->LE.$this->LE;
+
+        return $result;
+    }
+
+    /**
+     * Assembles the message body.  Returns an empty string on failure.
+     * @access private
+     * @return string
+     */
+    function CreateBody() {
+        $result = "";
+
+        $this->SetWordWrap();
+
+        switch($this->message_type)
+        {
+            case "alt":
+                $result .= $this->GetBoundary($this->boundary[1], "", 
+                                              "text/plain", "");
+                $result .= $this->EncodeString($this->AltBody, $this->Encoding);
+                $result .= $this->LE.$this->LE;
+                $result .= $this->GetBoundary($this->boundary[1], "", 
+                                              "text/html", "");
+                
+                $result .= $this->EncodeString($this->Body, $this->Encoding);
+                $result .= $this->LE.$this->LE;
+    
+                $result .= $this->EndBoundary($this->boundary[1]);
+                break;
+            case "plain":
+                $result .= $this->EncodeString($this->Body, $this->Encoding);
+                break;
+            case "attachments":
+                $result .= $this->GetBoundary($this->boundary[1], "", "", "");
+                $result .= $this->EncodeString($this->Body, $this->Encoding);
+                $result .= $this->LE;
+     
+                $result .= $this->AttachAll();
+                break;
+            case "alt_attachments":
+                $result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
+                $result .= sprintf("Content-Type: %s;%s" .
+                                   "\tboundary=\"%s\"%s",
+                                   "multipart/alternative", $this->LE, 
+                                   $this->boundary[2], $this->LE.$this->LE);
+    
+                // Create text body
+                $result .= $this->GetBoundary($this->boundary[2], "", 
+                                              "text/plain", "") . $this->LE;
+
+                $result .= $this->EncodeString($this->AltBody, $this->Encoding);
+                $result .= $this->LE.$this->LE;
+    
+                // Create the HTML body
+                $result .= $this->GetBoundary($this->boundary[2], "", 
+                                              "text/html", "") . $this->LE;
+    
+                $result .= $this->EncodeString($this->Body, $this->Encoding);
+                $result .= $this->LE.$this->LE;
+
+                $result .= $this->EndBoundary($this->boundary[2]);
+                
+                $result .= $this->AttachAll();
+                break;
+        }
+        if($this->IsError())
+            $result = "";
+
+        return $result;
+    }
+
+    /**
+     * Returns the start of a message boundary.
+     * @access private
+     */
+    function GetBoundary($boundary, $charSet, $contentType, $encoding) {
+        $result = "";
+        if($charSet == "") { $charSet = $this->CharSet; }
+        if($contentType == "") { $contentType = $this->ContentType; }
+        if($encoding == "") { $encoding = $this->Encoding; }
+
+        $result .= $this->TextLine("--" . $boundary);
+        $result .= sprintf("Content-Type: %s; charset = \"%s\"", 
+                            $contentType, $charSet);
+        $result .= $this->LE;
+        $result .= $this->HeaderLine("Content-Transfer-Encoding", $encoding);
+        $result .= $this->LE;
+       
+        return $result;
+    }
+    
+    /**
+     * Returns the end of a message boundary.
+     * @access private
+     */
+    function EndBoundary($boundary) {
+        return $this->LE . "--" . $boundary . "--" . $this->LE; 
+    }
+    
+    /**
+     * Sets the message type.
+     * @access private
+     * @return void
+     */
+    function SetMessageType() {
+        if(count($this->attachment) < 1 && strlen($this->AltBody) < 1)
+            $this->message_type = "plain";
+        else
+        {
+            if(count($this->attachment) > 0)
+                $this->message_type = "attachments";
+            if(strlen($this->AltBody) > 0 && count($this->attachment) < 1)
+                $this->message_type = "alt";
+            if(strlen($this->AltBody) > 0 && count($this->attachment) > 0)
+                $this->message_type = "alt_attachments";
+        }
+    }
+
+    /**
+     * Returns a formatted header line.
+     * @access private
+     * @return string
+     */
+    function HeaderLine($name, $value) {
+        return $name . ": " . $value . $this->LE;
+    }
+
+    /**
+     * Returns a formatted mail line.
+     * @access private
+     * @return string
+     */
+    function TextLine($value) {
+        return $value . $this->LE;
+    }
+
+    /////////////////////////////////////////////////
+    // ATTACHMENT METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Adds an attachment from a path on the filesystem.
+     * Returns false if the file could not be found
+     * or accessed.
+     * @param string $path Path to the attachment.
+     * @param string $name Overrides the attachment name.
+     * @param string $encoding File encoding (see $Encoding).
+     * @param string $type File extension (MIME) type.
+     * @return bool
+     */
+    function AddAttachment($path, $name = "", $encoding = "base64", 
+                           $type = "application/octet-stream") {
+        if(!@is_file($path))
+        {
+            $this->SetError($this->Lang("file_access") . $path);
+            return false;
+        }
+
+        $filename = basename($path);
+        if($name == "")
+            $name = $filename;
+
+        $cur = count($this->attachment);
+        $this->attachment[$cur][0] = $path;
+        $this->attachment[$cur][1] = $filename;
+        $this->attachment[$cur][2] = $name;
+        $this->attachment[$cur][3] = $encoding;
+        $this->attachment[$cur][4] = $type;
+        $this->attachment[$cur][5] = false; // isStringAttachment
+        $this->attachment[$cur][6] = "attachment";
+        $this->attachment[$cur][7] = 0;
+
+        return true;
+    }
+
+    /**
+     * Attaches all fs, string, and binary attachments to the message.
+     * Returns an empty string on failure.
+     * @access private
+     * @return string
+     */
+    function AttachAll() {
+        // Return text of body
+        $mime = array();
+
+        // Add all attachments
+        for($i = 0; $i < count($this->attachment); $i++)
+        {
+            // Check for string attachment
+            $bString = $this->attachment[$i][5];
+            if ($bString)
+                $string = $this->attachment[$i][0];
+            else
+                $path = $this->attachment[$i][0];
+
+            $filename    = $this->attachment[$i][1];
+            $name        = $this->attachment[$i][2];
+            $encoding    = $this->attachment[$i][3];
+            $type        = $this->attachment[$i][4];
+            $disposition = $this->attachment[$i][6];
+            $cid         = $this->attachment[$i][7];
+            
+            $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
+            $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE);
+            $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
+
+            if($disposition == "inline")
+                $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
+
+            $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", 
+                              $disposition, $name, $this->LE.$this->LE);
+
+            // Encode as string attachment
+            if($bString)
+            {
+                $mime[] = $this->EncodeString($string, $encoding);
+                if($this->IsError()) { return ""; }
+                $mime[] = $this->LE.$this->LE;
+            }
+            else
+            {
+                $mime[] = $this->EncodeFile($path, $encoding);                
+                if($this->IsError()) { return ""; }
+                $mime[] = $this->LE.$this->LE;
+            }
+        }
+
+        $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
+
+        return join("", $mime);
+    }
+    
+    /**
+     * Encodes attachment in requested format.  Returns an
+     * empty string on failure.
+     * @access private
+     * @return string
+     */
+    function EncodeFile ($path, $encoding = "base64") {
+        if(!@$fd = fopen($path, "rb"))
+        {
+            $this->SetError($this->Lang("file_open") . $path);
+            return "";
+        }
+        $magic_quotes = get_magic_quotes_runtime();
+        set_magic_quotes_runtime(0);
+        $file_buffer = fread($fd, filesize($path));
+        $file_buffer = $this->EncodeString($file_buffer, $encoding);
+        fclose($fd);
+        set_magic_quotes_runtime($magic_quotes);
+
+        return $file_buffer;
+    }
+
+    /**
+     * Encodes string to requested format. Returns an
+     * empty string on failure.
+     * @access private
+     * @return string
+     */
+    function EncodeString ($str, $encoding = "base64") {
+        $encoded = "";
+        switch(strtolower($encoding)) {
+          case "base64":
+              // chunk_split is found in PHP >= 3.0.6
+              $encoded = chunk_split(base64_encode($str), 76, $this->LE);
+              break;
+          case "7bit":
+          case "8bit":
+              $encoded = $this->FixEOL($str);
+              if (substr($encoded, -(strlen($this->LE))) != $this->LE)
+                $encoded .= $this->LE;
+              break;
+          case "binary":
+              $encoded = $str;
+              break;
+          case "quoted-printable":
+              $encoded = $this->EncodeQP($str);
+              break;
+          default:
+              $this->SetError($this->Lang("encoding") . $encoding);
+              break;
+        }
+        return $encoded;
+    }
+
+    /**
+     * Encode a header string to best of Q, B, quoted or none.  
+     * @access private
+     * @return string
+     */
+    function EncodeHeader ($str, $position = 'text') {
+      $x = 0;
+      
+      switch (strtolower($position)) {
+        case 'phrase':
+          if (!preg_match('/[\200-\377]/', $str)) {
+            // Can't use addslashes as we don't know what value has magic_quotes_sybase.
+            $encoded = addcslashes($str, "\0..\37\177\\\"");
+
+            if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str))
+              return ($encoded);
+            else
+              return ("\"$encoded\"");
+          }
+          $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
+          break;
+        case 'comment':
+          $x = preg_match_all('/[()"]/', $str, $matches);
+          // Fall-through
+        case 'text':
+        default:
+          $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
+          break;
+      }
+
+      if ($x == 0)
+        return ($str);
+
+      $maxlen = 75 - 7 - strlen($this->CharSet);
+      // Try to select the encoding which should produce the shortest output
+      if (strlen($str)/3 < $x) {
+        $encoding = 'B';
+        $encoded = base64_encode($str);
+        $maxlen -= $maxlen % 4;
+        $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
+      } else {
+        $encoding = 'Q';
+        $encoded = $this->EncodeQ($str, $position);
+        $encoded = $this->WrapText($encoded, $maxlen, true);
+        $encoded = str_replace("=".$this->LE, "\n", trim($encoded));
+      }
+
+      $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
+      $encoded = trim(str_replace("\n", $this->LE, $encoded));
+      
+      return $encoded;
+    }
+    
+    /**
+     * Encode string to quoted-printable.  
+     * @access private
+     * @return string
+     */
+    function EncodeQP ($str) {
+        $encoded = $this->FixEOL($str);
+        if (substr($encoded, -(strlen($this->LE))) != $this->LE)
+            $encoded .= $this->LE;
+
+        // Replace every high ascii, control and = characters
+        $encoded = preg_replace('/([\000-\010\013\014\016-\037\075\177-\377])/e',
+                  "'='.sprintf('%02X', ord('\\1'))", $encoded);
+        // Replace every spaces and tabs when it's the last character on a line
+        $encoded = preg_replace("/([\011\040])".$this->LE."/e",
+                  "'='.sprintf('%02X', ord('\\1')).'".$this->LE."'", $encoded);
+
+        // Maximum line length of 76 characters before CRLF (74 + space + '=')
+        $encoded = $this->WrapText($encoded, 74, true);
+
+        return $encoded;
+    }
+
+    /**
+     * Encode string to q encoding.  
+     * @access private
+     * @return string
+     */
+    function EncodeQ ($str, $position = "text") {
+        // There should not be any EOL in the string
+        $encoded = preg_replace("[\r\n]", "", $str);
+
+        switch (strtolower($position)) {
+          case "phrase":
+            $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+            break;
+          case "comment":
+            $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+          case "text":
+          default:
+            // Replace every high ascii, control =, ? and _ characters
+            $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
+                  "'='.sprintf('%02X', ord('\\1'))", $encoded);
+            break;
+        }
+        
+        // Replace every spaces to _ (more readable than =20)
+        $encoded = str_replace(" ", "_", $encoded);
+
+        return $encoded;
+    }
+
+    /**
+     * Adds a string or binary attachment (non-filesystem) to the list.
+     * This method can be used to attach ascii or binary data,
+     * such as a BLOB record from a database.
+     * @param string $string String attachment data.
+     * @param string $filename Name of the attachment.
+     * @param string $encoding File encoding (see $Encoding).
+     * @param string $type File extension (MIME) type.
+     * @return void
+     */
+    function AddStringAttachment($string, $filename, $encoding = "base64", 
+                                 $type = "application/octet-stream") {
+        // Append to $attachment array
+        $cur = count($this->attachment);
+        $this->attachment[$cur][0] = $string;
+        $this->attachment[$cur][1] = $filename;
+        $this->attachment[$cur][2] = $filename;
+        $this->attachment[$cur][3] = $encoding;
+        $this->attachment[$cur][4] = $type;
+        $this->attachment[$cur][5] = true; // isString
+        $this->attachment[$cur][6] = "attachment";
+        $this->attachment[$cur][7] = 0;
+    }
+    
+    /**
+     * Adds an embedded attachment.  This can include images, sounds, and 
+     * just about any other document.  Make sure to set the $type to an 
+     * image type.  For JPEG images use "image/jpeg" and for GIF images 
+     * use "image/gif".
+     * @param string $path Path to the attachment.
+     * @param string $cid Content ID of the attachment.  Use this to identify 
+     *        the Id for accessing the image in an HTML form.
+     * @param string $name Overrides the attachment name.
+     * @param string $encoding File encoding (see $Encoding).
+     * @param string $type File extension (MIME) type.  
+     * @return bool
+     */
+    function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", 
+                              $type = "application/octet-stream") {
+    
+        if(!@is_file($path))
+        {
+            $this->SetError($this->Lang("file_access") . $path);
+            return false;
+        }
+
+        $filename = basename($path);
+        if($name == "")
+            $name = $filename;
+
+        // Append to $attachment array
+        $cur = count($this->attachment);
+        $this->attachment[$cur][0] = $path;
+        $this->attachment[$cur][1] = $filename;
+        $this->attachment[$cur][2] = $name;
+        $this->attachment[$cur][3] = $encoding;
+        $this->attachment[$cur][4] = $type;
+        $this->attachment[$cur][5] = false; // isStringAttachment
+        $this->attachment[$cur][6] = "inline";
+        $this->attachment[$cur][7] = $cid;
+    
+        return true;
+    }
+    
+    /**
+     * Returns true if an inline attachment is present.
+     * @access private
+     * @return bool
+     */
+    function InlineImageExists() {
+        $result = false;
+        for($i = 0; $i < count($this->attachment); $i++)
+        {
+            if($this->attachment[$i][6] == "inline")
+            {
+                $result = true;
+                break;
+            }
+        }
+        
+        return $result;
+    }
+
+    /////////////////////////////////////////////////
+    // MESSAGE RESET METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Clears all recipients assigned in the TO array.  Returns void.
+     * @return void
+     */
+    function ClearAddresses() {
+        $this->to = array();
+    }
+
+    /**
+     * Clears all recipients assigned in the CC array.  Returns void.
+     * @return void
+     */
+    function ClearCCs() {
+        $this->cc = array();
+    }
+
+    /**
+     * Clears all recipients assigned in the BCC array.  Returns void.
+     * @return void
+     */
+    function ClearBCCs() {
+        $this->bcc = array();
+    }
+
+    /**
+     * Clears all recipients assigned in the ReplyTo array.  Returns void.
+     * @return void
+     */
+    function ClearReplyTos() {
+        $this->ReplyTo = array();
+    }
+
+    /**
+     * Clears all recipients assigned in the TO, CC and BCC
+     * array.  Returns void.
+     * @return void
+     */
+    function ClearAllRecipients() {
+        $this->to = array();
+        $this->cc = array();
+        $this->bcc = array();
+    }
+
+    /**
+     * Clears all previously set filesystem, string, and binary
+     * attachments.  Returns void.
+     * @return void
+     */
+    function ClearAttachments() {
+        $this->attachment = array();
+    }
+
+    /**
+     * Clears all custom headers.  Returns void.
+     * @return void
+     */
+    function ClearCustomHeaders() {
+        $this->CustomHeader = array();
+    }
+
+
+    /////////////////////////////////////////////////
+    // MISCELLANEOUS METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Adds the error message to the error container.
+     * Returns void.
+     * @access private
+     * @return void
+     */
+    function SetError($msg) {
+        $this->error_count++;
+        $this->ErrorInfo = $msg;
+    }
+
+    /**
+     * Returns the proper RFC 822 formatted date. 
+     * @access private
+     * @return string
+     */
+    function RFCDate() {
+        $tz = date("Z");
+        $tzs = ($tz < 0) ? "-" : "+";
+        $tz = abs($tz);
+        $tz = ($tz/3600)*100 + ($tz%3600)/60;
+        $result = sprintf("%s %s%04d", date("D, j M Y H:i:s"), $tzs, $tz);
+
+        return $result;
+    }
+    
+    /**
+     * Returns the appropriate server variable.  Should work with both 
+     * PHP 4.1.0+ as well as older versions.  Returns an empty string 
+     * if nothing is found.
+     * @access private
+     * @return mixed
+     */
+    function ServerVar($varName) {
+        global $HTTP_SERVER_VARS;
+        global $HTTP_ENV_VARS;
+
+        if(!isset($_SERVER))
+        {
+            $_SERVER = $HTTP_SERVER_VARS;
+            if(!isset($_SERVER["REMOTE_ADDR"]))
+                $_SERVER = $HTTP_ENV_VARS; // must be Apache
+        }
+        
+        if(isset($_SERVER[$varName]))
+            return $_SERVER[$varName];
+        else
+            return "";
+    }
+
+    /**
+     * Returns the server hostname or 'localhost.localdomain' if unknown.
+     * @access private
+     * @return string
+     */
+    function ServerHostname() {
+        if ($this->Hostname != "")
+            $result = $this->Hostname;
+        elseif ($this->ServerVar('SERVER_NAME') != "")
+            $result = $this->ServerVar('SERVER_NAME');
+        else
+            $result = "localhost.localdomain";
+
+        return $result;
+    }
+
+    /**
+     * Returns a message in the appropriate language.
+     * @access private
+     * @return string
+     */
+    function Lang($key) {
+        if(count($this->language) < 1)
+            $this->SetLanguage("en"); // set the default language
+    
+        if(isset($this->language[$key]))
+            return $this->language[$key];
+        else
+            return "Language string failed to load: " . $key;
+    }
+    
+    /**
+     * Returns true if an error occurred.
+     * @return bool
+     */
+    function IsError() {
+        return ($this->error_count > 0);
+    }
+
+    /**
+     * Changes every end of line from CR or LF to CRLF.  
+     * @access private
+     * @return string
+     */
+    function FixEOL($str) {
+        $str = str_replace("\r\n", "\n", $str);
+        $str = str_replace("\r", "\n", $str);
+        $str = str_replace("\n", $this->LE, $str);
+        return $str;
+    }
+
+    /**
+     * Adds a custom header. 
+     * @return void
+     */
+    function AddCustomHeader($custom_header) {
+        $this->CustomHeader[] = explode(":", $custom_header, 2);
+    }
+}
+
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/class/mail/phpmailer/class.smtp.php 2.2.6.src/class/mail/phpmailer/class.smtp.php
--- 2.2.3a-Final.src/class/mail/phpmailer/class.smtp.php	2005-08-07 23:06:20.000000000 -0500
+++ 2.2.6.src/class/mail/phpmailer/class.smtp.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,1010 +1,1045 @@
-<?php
-////////////////////////////////////////////////////
-// SMTP - PHP SMTP class
-//
-// Version 1.02
-//
-// Define an SMTP class that can be used to connect
-// and communicate with any SMTP server. It implements
-// all the SMTP functions defined in RFC821 except TURN.
-//
-// Author: Chris Ryan
-//
-// License: LGPL, see LICENSE
-////////////////////////////////////////////////////
-
-/**
- * STMP is rfc 821 compliant and implements all the rfc 821 SMTP
- * commands except TURN which will always return a not implemented
- * error. SMTP also provides some utility methods for sending mail
- * to an SMTP server.
- * @author Chris Ryan
- */
-class SMTP
-{
-    var $SMTP_PORT = 25; # the default SMTP PORT
-    var $CRLF = "\r\n";  # CRLF pair
-
-    var $smtp_conn;      # the socket to the server
-    var $error;          # error if any on the last call
-    var $helo_rply;      # the reply the server sent to us for HELO
-
-    var $do_debug;       # the level of debug to perform
-
-    /**
-     * Initialize the class so that the data is in a known state.
-     * @access public
-     * @return void
-     */
-    function SMTP() {
-        $this->smtp_conn = 0;
-        $this->error = null;
-        $this->helo_rply = null;
-
-        $this->do_debug = 0;
-    }
-
-    /*************************************************************
-     *                    CONNECTION FUNCTIONS                  *
-     ***********************************************************/
-
-    /**
-     * Connect to the server specified on the port specified.
-     * If the port is not specified use the default SMTP_PORT.
-     * If tval is specified then a connection will try and be
-     * established with the server for that number of seconds.
-     * If tval is not specified the default is 30 seconds to
-     * try on the connection.
-     *
-     * SMTP CODE SUCCESS: 220
-     * SMTP CODE FAILURE: 421
-     * @access public
-     * @return bool
-     */
-    function Connect($host,$port=0,$tval=30) {
-        # set the error val to null so there is no confusion
-        $this->error = null;
-
-        # make sure we are __not__ connected
-        if($this->connected()) {
-            # ok we are connected! what should we do?
-            # for now we will just give an error saying we
-            # are already connected
-            $this->error =
-                array("error" => "Already connected to a server");
-            return false;
-        }
-
-        if(empty($port)) {
-            $port = $this->SMTP_PORT;
-        }
-
-        #connect to the smtp server
-        $this->smtp_conn = fsockopen($host,    # the host of the server
-                                     $port,    # the port to use
-                                     $errno,   # error number if any
-                                     $errstr,  # error message if any
-                                     $tval);   # give up after ? secs
-        # verify we connected properly
-        if(empty($this->smtp_conn)) {
-            $this->error = array("error" => "Failed to connect to server",
-                                 "errno" => $errno,
-                                 "errstr" => $errstr);
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": $errstr ($errno)" . $this->CRLF;
-            }
-            return false;
-        }
-
-        # sometimes the SMTP server takes a little longer to respond
-        # so we will give it a longer timeout for the first read
-        // Windows still does not have support for this timeout function
-        if(substr(PHP_OS, 0, 3) != "WIN")
-           socket_set_timeout($this->smtp_conn, 1, 0);
-
-        # get any announcement stuff
-        $announce = $this->get_lines();
-
-        # set the timeout  of any socket functions at 1/10 of a second
-        //if(function_exists("socket_set_timeout"))
-        //   socket_set_timeout($this->smtp_conn, 0, 100000);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce;
-        }
-
-        return true;
-    }
-
-    /**
-     * Performs SMTP authentication.  Must be run after running the
-     * Hello() method.  Returns true if successfully authenticated.
-     * @access public
-     * @return bool
-     */
-    function Authenticate($username, $password) {
-        // Start authentication
-        fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($code != 334) {
-            $this->error =
-                array("error" => "AUTH not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-
-        // Send encoded username
-        fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($code != 334) {
-            $this->error =
-                array("error" => "Username not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-
-        // Send encoded password
-        fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($code != 235) {
-            $this->error =
-                array("error" => "Password not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns true if connected to a server otherwise false
-     * @access private
-     * @return bool
-     */
-    function Connected() {
-        if(!empty($this->smtp_conn)) {
-            $sock_status = socket_get_status($this->smtp_conn);
-            if($sock_status["eof"]) {
-                # hmm this is an odd situation... the socket is
-                # valid but we aren't connected anymore
-                if($this->do_debug >= 1) {
-                    echo "SMTP -> NOTICE:" . $this->CRLF .
-                         "EOF caught while checking if connected";
-                }
-                $this->Close();
-                return false;
-            }
-            return true; # everything looks good
-        }
-        return false;
-    }
-
-    /**
-     * Closes the socket and cleans up the state of the class.
-     * It is not considered good to use this function without
-     * first trying to use QUIT.
-     * @access public
-     * @return void
-     */
-    function Close() {
-        $this->error = null; # so there is no confusion
-        $this->helo_rply = null;
-        if(!empty($this->smtp_conn)) {
-            # close the connection and cleanup
-            fclose($this->smtp_conn);
-            $this->smtp_conn = 0;
-        }
-    }
-
-
-    /***************************************************************
-     *                        SMTP COMMANDS                       *
-     *************************************************************/
-
-    /**
-     * Issues a data command and sends the msg_data to the server
-     * finializing the mail transaction. $msg_data is the message
-     * that is to be send with the headers. Each header needs to be
-     * on a single line followed by a <CRLF> with the message headers
-     * and the message body being seperated by and additional <CRLF>.
-     *
-     * Implements rfc 821: DATA <CRLF>
-     *
-     * SMTP CODE INTERMEDIATE: 354
-     *     [data]
-     *     <CRLF>.<CRLF>
-     *     SMTP CODE SUCCESS: 250
-     *     SMTP CODE FAILURE: 552,554,451,452
-     * SMTP CODE FAILURE: 451,554
-     * SMTP CODE ERROR  : 500,501,503,421
-     * @access public
-     * @return bool
-     */
-    function Data($msg_data) {
-        $this->error = null; # so no confusion is caused
-
-        if(!$this->connected()) {
-            $this->error = array(
-                    "error" => "Called Data() without being connected");
-            return false;
-        }
-
-        fputs($this->smtp_conn,"DATA" . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 354) {
-            $this->error =
-                array("error" => "DATA command not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-
-        # the server is ready to accept data!
-        # according to rfc 821 we should not send more than 1000
-        # including the CRLF
-        # characters on a single line so we will break the data up
-        # into lines by \r and/or \n then if needed we will break
-        # each of those into smaller lines to fit within the limit.
-        # in addition we will be looking for lines that start with
-        # a period '.' and append and additional period '.' to that
-        # line. NOTE: this does not count towards are limit.
-
-        # normalize the line breaks so we know the explode works
-        $msg_data = str_replace("\r\n","\n",$msg_data);
-        $msg_data = str_replace("\r","\n",$msg_data);
-        $lines = explode("\n",$msg_data);
-
-        # we need to find a good way to determine is headers are
-        # in the msg_data or if it is a straight msg body
-        # currently I'm assuming rfc 822 definitions of msg headers
-        # and if the first field of the first line (':' sperated)
-        # does not contain a space then it _should_ be a header
-        # and we can process all lines before a blank "" line as
-        # headers.
-        $field = substr($lines[0],0,strpos($lines[0],":"));
-        $in_headers = false;
-        if(!empty($field) && !strstr($field," ")) {
-            $in_headers = true;
-        }
-
-        $max_line_length = 998; # used below; set here for ease in change
-
-        while(list(,$line) = @each($lines)) {
-            $lines_out = null;
-            if($line == "" && $in_headers) {
-                $in_headers = false;
-            }
-            # ok we need to break this line up into several
-            # smaller lines
-            while(strlen($line) > $max_line_length) {
-                $pos = strrpos(substr($line,0,$max_line_length)," ");
-                // @XOOPS: Manual fix from PHPMailer 1.73 to prevent endless loops
-                // @XOOPS: We must update to 1.73 and fix its multibyte related issues instead of keeping this
-				if ( !$pos ) {
-					$pos = $max_line_length - 1;
-				}
-                $lines_out[] = substr($line,0,$pos);
-                $line = substr($line,$pos + 1);
-                # if we are processing headers we need to
-                # add a LWSP-char to the front of the new line
-                # rfc 822 on long msg headers
-                if($in_headers) {
-                    $line = "\t" . $line;
-                }
-            }
-            $lines_out[] = $line;
-
-            # now send the lines to the server
-            while(list(,$line_out) = @each($lines_out)) {
-                if(strlen($line_out) > 0)
-                {
-                    if(substr($line_out, 0, 1) == ".") {
-                        $line_out = "." . $line_out;
-                    }
-                }
-                fputs($this->smtp_conn,$line_out . $this->CRLF);
-            }
-        }
-
-        # ok all the message data has been sent so lets get this
-        # over with aleady
-        fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 250) {
-            $this->error =
-                array("error" => "DATA not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Expand takes the name and asks the server to list all the
-     * people who are members of the _list_. Expand will return
-     * back and array of the result or false if an error occurs.
-     * Each value in the array returned has the format of:
-     *     [ <full-name> <sp> ] <path>
-     * The definition of <path> is defined in rfc 821
-     *
-     * Implements rfc 821: EXPN <SP> <string> <CRLF>
-     *
-     * SMTP CODE SUCCESS: 250
-     * SMTP CODE FAILURE: 550
-     * SMTP CODE ERROR  : 500,501,502,504,421
-     * @access public
-     * @return string array
-     */
-    function Expand($name) {
-        $this->error = null; # so no confusion is caused
-
-        if(!$this->connected()) {
-            $this->error = array(
-                    "error" => "Called Expand() without being connected");
-            return false;
-        }
-
-        fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 250) {
-            $this->error =
-                array("error" => "EXPN not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-
-        # parse the reply and place in our array to return to user
-        $entries = explode($this->CRLF,$rply);
-        while(list(,$l) = @each($entries)) {
-            $list[] = substr($l,4);
-        }
-
-        return $list;
-    }
-
-    /**
-     * Sends the HELO command to the smtp server.
-     * This makes sure that we and the server are in
-     * the same known state.
-     *
-     * Implements from rfc 821: HELO <SP> <domain> <CRLF>
-     *
-     * SMTP CODE SUCCESS: 250
-     * SMTP CODE ERROR  : 500, 501, 504, 421
-     * @access public
-     * @return bool
-     */
-    function Hello($host="") {
-        $this->error = null; # so no confusion is caused
-
-        if(!$this->connected()) {
-            $this->error = array(
-                    "error" => "Called Hello() without being connected");
-            return false;
-        }
-
-        # if a hostname for the HELO wasn't specified determine
-        # a suitable one to send
-        if(empty($host)) {
-            # we need to determine some sort of appopiate default
-            # to send to the server
-            $host = "localhost";
-        }
-
-        fputs($this->smtp_conn,"HELO " . $host . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply;
-        }
-
-        if($code != 250) {
-            $this->error =
-                array("error" => "HELO not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-
-        $this->helo_rply = $rply;
-
-        return true;
-    }
-
-    /**
-     * Gets help information on the keyword specified. If the keyword
-     * is not specified then returns generic help, ussually contianing
-     * A list of keywords that help is available on. This function
-     * returns the results back to the user. It is up to the user to
-     * handle the returned data. If an error occurs then false is
-     * returned with $this->error set appropiately.
-     *
-     * Implements rfc 821: HELP [ <SP> <string> ] <CRLF>
-     *
-     * SMTP CODE SUCCESS: 211,214
-     * SMTP CODE ERROR  : 500,501,502,504,421
-     * @access public
-     * @return string
-     */
-    function Help($keyword="") {
-        $this->error = null; # to avoid confusion
-
-        if(!$this->connected()) {
-            $this->error = array(
-                    "error" => "Called Help() without being connected");
-            return false;
-        }
-
-        $extra = "";
-        if(!empty($keyword)) {
-            $extra = " " . $keyword;
-        }
-
-        fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 211 && $code != 214) {
-            $this->error =
-                array("error" => "HELP not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-
-        return $rply;
-    }
-
-    /**
-     * Starts a mail transaction from the email address specified in
-     * $from. Returns true if successful or false otherwise. If True
-     * the mail transaction is started and then one or more Recipient
-     * commands may be called followed by a Data command.
-     *
-     * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
-     *
-     * SMTP CODE SUCCESS: 250
-     * SMTP CODE SUCCESS: 552,451,452
-     * SMTP CODE SUCCESS: 500,501,421
-     * @access public
-     * @return bool
-     */
-    function Mail($from) {
-        $this->error = null; # so no confusion is caused
-
-        if(!$this->connected()) {
-            $this->error = array(
-                    "error" => "Called Mail() without being connected");
-            return false;
-        }
-
-        fputs($this->smtp_conn,"MAIL FROM:" . $from . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 250) {
-            $this->error =
-                array("error" => "MAIL not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Sends the command NOOP to the SMTP server.
-     *
-     * Implements from rfc 821: NOOP <CRLF>
-     *
-     * SMTP CODE SUCCESS: 250
-     * SMTP CODE ERROR  : 500, 421
-     * @access public
-     * @return bool
-     */
-    function Noop() {
-        $this->error = null; # so no confusion is caused
-
-        if(!$this->connected()) {
-            $this->error = array(
-                    "error" => "Called Noop() without being connected");
-            return false;
-        }
-
-        fputs($this->smtp_conn,"NOOP" . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 250) {
-            $this->error =
-                array("error" => "NOOP not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Sends the quit command to the server and then closes the socket
-     * if there is no error or the $close_on_error argument is true.
-     *
-     * Implements from rfc 821: QUIT <CRLF>
-     *
-     * SMTP CODE SUCCESS: 221
-     * SMTP CODE ERROR  : 500
-     * @access public
-     * @return bool
-     */
-    function Quit($close_on_error=true) {
-        $this->error = null; # so there is no confusion
-
-        if(!$this->connected()) {
-            $this->error = array(
-                    "error" => "Called Quit() without being connected");
-            return false;
-        }
-
-        # send the quit command to the server
-        fputs($this->smtp_conn,"quit" . $this->CRLF);
-
-        # get any good-bye messages
-        $byemsg = $this->get_lines();
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg;
-        }
-
-        $rval = true;
-        $e = null;
-
-        $code = substr($byemsg,0,3);
-        if($code != 221) {
-            # use e as a tmp var cause Close will overwrite $this->error
-            $e = array("error" => "SMTP server rejected quit command",
-                       "smtp_code" => $code,
-                       "smtp_rply" => substr($byemsg,4));
-            $rval = false;
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $e["error"] . ": " .
-                         $byemsg . $this->CRLF;
-            }
-        }
-
-        if(empty($e) || $close_on_error) {
-            $this->Close();
-        }
-
-        return $rval;
-    }
-
-    /**
-     * Sends the command RCPT to the SMTP server with the TO: argument of $to.
-     * Returns true if the recipient was accepted false if it was rejected.
-     *
-     * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
-     *
-     * SMTP CODE SUCCESS: 250,251
-     * SMTP CODE FAILURE: 550,551,552,553,450,451,452
-     * SMTP CODE ERROR  : 500,501,503,421
-     * @access public
-     * @return bool
-     */
-    function Recipient($to) {
-        $this->error = null; # so no confusion is caused
-
-        if(!$this->connected()) {
-            $this->error = array(
-                    "error" => "Called Recipient() without being connected");
-            return false;
-        }
-
-        fputs($this->smtp_conn,"RCPT TO:" . $to . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 250 && $code != 251) {
-            $this->error =
-                array("error" => "RCPT not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Sends the RSET command to abort and transaction that is
-     * currently in progress. Returns true if successful false
-     * otherwise.
-     *
-     * Implements rfc 821: RSET <CRLF>
-     *
-     * SMTP CODE SUCCESS: 250
-     * SMTP CODE ERROR  : 500,501,504,421
-     * @access public
-     * @return bool
-     */
-    function Reset() {
-        $this->error = null; # so no confusion is caused
-
-        if(!$this->connected()) {
-            $this->error = array(
-                    "error" => "Called Reset() without being connected");
-            return false;
-        }
-
-        fputs($this->smtp_conn,"RSET" . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 250) {
-            $this->error =
-                array("error" => "RSET failed",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Starts a mail transaction from the email address specified in
-     * $from. Returns true if successful or false otherwise. If True
-     * the mail transaction is started and then one or more Recipient
-     * commands may be called followed by a Data command. This command
-     * will send the message to the users terminal if they are logged
-     * in.
-     *
-     * Implements rfc 821: SEND <SP> FROM:<reverse-path> <CRLF>
-     *
-     * SMTP CODE SUCCESS: 250
-     * SMTP CODE SUCCESS: 552,451,452
-     * SMTP CODE SUCCESS: 500,501,502,421
-     * @access public
-     * @return bool
-     */
-    function Send($from) {
-        $this->error = null; # so no confusion is caused
-
-        if(!$this->connected()) {
-            $this->error = array(
-                    "error" => "Called Send() without being connected");
-            return false;
-        }
-
-        fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 250) {
-            $this->error =
-                array("error" => "SEND not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Starts a mail transaction from the email address specified in
-     * $from. Returns true if successful or false otherwise. If True
-     * the mail transaction is started and then one or more Recipient
-     * commands may be called followed by a Data command. This command
-     * will send the message to the users terminal if they are logged
-     * in and send them an email.
-     *
-     * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
-     *
-     * SMTP CODE SUCCESS: 250
-     * SMTP CODE SUCCESS: 552,451,452
-     * SMTP CODE SUCCESS: 500,501,502,421
-     * @access public
-     * @return bool
-     */
-    function SendAndMail($from) {
-        $this->error = null; # so no confusion is caused
-
-        if(!$this->connected()) {
-            $this->error = array(
-                "error" => "Called SendAndMail() without being connected");
-            return false;
-        }
-
-        fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 250) {
-            $this->error =
-                array("error" => "SAML not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Starts a mail transaction from the email address specified in
-     * $from. Returns true if successful or false otherwise. If True
-     * the mail transaction is started and then one or more Recipient
-     * commands may be called followed by a Data command. This command
-     * will send the message to the users terminal if they are logged
-     * in or mail it to them if they are not.
-     *
-     * Implements rfc 821: SOML <SP> FROM:<reverse-path> <CRLF>
-     *
-     * SMTP CODE SUCCESS: 250
-     * SMTP CODE SUCCESS: 552,451,452
-     * SMTP CODE SUCCESS: 500,501,502,421
-     * @access public
-     * @return bool
-     */
-    function SendOrMail($from) {
-        $this->error = null; # so no confusion is caused
-
-        if(!$this->connected()) {
-            $this->error = array(
-                "error" => "Called SendOrMail() without being connected");
-            return false;
-        }
-
-        fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 250) {
-            $this->error =
-                array("error" => "SOML not accepted from server",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * This is an optional command for SMTP that this class does not
-     * support. This method is here to make the RFC821 Definition
-     * complete for this class and __may__ be implimented in the future
-     *
-     * Implements from rfc 821: TURN <CRLF>
-     *
-     * SMTP CODE SUCCESS: 250
-     * SMTP CODE FAILURE: 502
-     * SMTP CODE ERROR  : 500, 503
-     * @access public
-     * @return bool
-     */
-    function Turn() {
-        $this->error = array("error" => "This method, TURN, of the SMTP ".
-                                        "is not implemented");
-        if($this->do_debug >= 1) {
-            echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF;
-        }
-        return false;
-    }
-
-    /**
-     * Verifies that the name is recognized by the server.
-     * Returns false if the name could not be verified otherwise
-     * the response from the server is returned.
-     *
-     * Implements rfc 821: VRFY <SP> <string> <CRLF>
-     *
-     * SMTP CODE SUCCESS: 250,251
-     * SMTP CODE FAILURE: 550,551,553
-     * SMTP CODE ERROR  : 500,501,502,421
-     * @access public
-     * @return int
-     */
-    function Verify($name) {
-        $this->error = null; # so no confusion is caused
-
-        if(!$this->connected()) {
-            $this->error = array(
-                    "error" => "Called Verify() without being connected");
-            return false;
-        }
-
-        fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
-
-        $rply = $this->get_lines();
-        $code = substr($rply,0,3);
-
-        if($this->do_debug >= 2) {
-            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
-        }
-
-        if($code != 250 && $code != 251) {
-            $this->error =
-                array("error" => "VRFY failed on name '$name'",
-                      "smtp_code" => $code,
-                      "smtp_msg" => substr($rply,4));
-            if($this->do_debug >= 1) {
-                echo "SMTP -> ERROR: " . $this->error["error"] .
-                         ": " . $rply . $this->CRLF;
-            }
-            return false;
-        }
-        return $rply;
-    }
-
-    /*******************************************************************
-     *                       INTERNAL FUNCTIONS                       *
-     ******************************************************************/
-
-    /**
-     * Read in as many lines as possible
-     * either before eof or socket timeout occurs on the operation.
-     * With SMTP we can tell if we have more lines to read if the
-     * 4th character is '-' symbol. If it is a space then we don't
-     * need to read anything else.
-     * @access private
-     * @return string
-     */
-    function get_lines() {
-        $data = "";
-        while($str = fgets($this->smtp_conn,515)) {
-            if($this->do_debug >= 4) {
-                echo "SMTP -> get_lines(): \$data was \"$data\"" .
-                         $this->CRLF;
-                echo "SMTP -> get_lines(): \$str is \"$str\"" .
-                         $this->CRLF;
-            }
-            $data .= $str;
-            if($this->do_debug >= 4) {
-                echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF;
-            }
-            # if the 4th character is a space then we are done reading
-            # so just break the loop
-            if(substr($str,3,1) == " ") { break; }
-        }
-        return $data;
-    }
-
-}
-
-
- ?>
+<?php
+////////////////////////////////////////////////////
+// SMTP - PHP SMTP class
+//
+// Version 1.02
+//
+// Define an SMTP class that can be used to connect
+// and communicate with any SMTP server. It implements
+// all the SMTP functions defined in RFC821 except TURN.
+//
+// Author: Chris Ryan
+//
+// License: LGPL, see LICENSE
+////////////////////////////////////////////////////
+
+/**
+ * SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
+ * commands except TURN which will always return a not implemented
+ * error. SMTP also provides some utility methods for sending mail
+ * to an SMTP server.
+ * @package PHPMailer
+ * @author Chris Ryan
+ */
+class SMTP
+{
+    /**
+     *  SMTP server port
+     *  @var int
+     */
+    var $SMTP_PORT = 25;
+    
+    /**
+     *  SMTP reply line ending
+     *  @var string
+     */
+    var $CRLF = "\r\n";
+    
+    /**
+     *  Sets whether debugging is turned on
+     *  @var bool
+     */
+    var $do_debug;       # the level of debug to perform
+
+    /**#@+
+     * @access private
+     */
+    var $smtp_conn;      # the socket to the server
+    var $error;          # error if any on the last call
+    var $helo_rply;      # the reply the server sent to us for HELO
+    /**#@-*/
+
+    /**
+     * Initialize the class so that the data is in a known state.
+     * @access public
+     * @return void
+     */
+    function SMTP() {
+        $this->smtp_conn = 0;
+        $this->error = null;
+        $this->helo_rply = null;
+
+        $this->do_debug = 0;
+    }
+
+    /*************************************************************
+     *                    CONNECTION FUNCTIONS                  *
+     ***********************************************************/
+
+    /**
+     * Connect to the server specified on the port specified.
+     * If the port is not specified use the default SMTP_PORT.
+     * If tval is specified then a connection will try and be
+     * established with the server for that number of seconds.
+     * If tval is not specified the default is 30 seconds to
+     * try on the connection.
+     *
+     * SMTP CODE SUCCESS: 220
+     * SMTP CODE FAILURE: 421
+     * @access public
+     * @return bool
+     */
+    function Connect($host,$port=0,$tval=30) {
+        # set the error val to null so there is no confusion
+        $this->error = null;
+
+        # make sure we are __not__ connected
+        if($this->connected()) {
+            # ok we are connected! what should we do?
+            # for now we will just give an error saying we
+            # are already connected
+            $this->error =
+                array("error" => "Already connected to a server");
+            return false;
+        }
+
+        if(empty($port)) {
+            $port = $this->SMTP_PORT;
+        }
+
+        #connect to the smtp server
+        $this->smtp_conn = fsockopen($host,    # the host of the server
+                                     $port,    # the port to use
+                                     $errno,   # error number if any
+                                     $errstr,  # error message if any
+                                     $tval);   # give up after ? secs
+        # verify we connected properly
+        if(empty($this->smtp_conn)) {
+            $this->error = array("error" => "Failed to connect to server",
+                                 "errno" => $errno,
+                                 "errstr" => $errstr);
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": $errstr ($errno)" . $this->CRLF;
+            }
+            return false;
+        }
+
+        # sometimes the SMTP server takes a little longer to respond
+        # so we will give it a longer timeout for the first read
+        // Windows still does not have support for this timeout function
+        if(substr(PHP_OS, 0, 3) != "WIN")
+           socket_set_timeout($this->smtp_conn, $tval, 0);
+
+        # get any announcement stuff
+        $announce = $this->get_lines();
+
+        # set the timeout  of any socket functions at 1/10 of a second
+        //if(function_exists("socket_set_timeout"))
+        //   socket_set_timeout($this->smtp_conn, 0, 100000);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce;
+        }
+
+        return true;
+    }
+
+    /**
+     * Performs SMTP authentication.  Must be run after running the
+     * Hello() method.  Returns true if successfully authenticated.
+     * @access public
+     * @return bool
+     */
+    function Authenticate($username, $password) {
+        // Start authentication
+        fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($code != 334) {
+            $this->error =
+                array("error" => "AUTH not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+
+        // Send encoded username
+        fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($code != 334) {
+            $this->error =
+                array("error" => "Username not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+
+        // Send encoded password
+        fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($code != 235) {
+            $this->error =
+                array("error" => "Password not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Returns true if connected to a server otherwise false
+     * @access private
+     * @return bool
+     */
+    function Connected() {
+        if(!empty($this->smtp_conn)) {
+            $sock_status = socket_get_status($this->smtp_conn);
+            if($sock_status["eof"]) {
+                # hmm this is an odd situation... the socket is
+                # valid but we aren't connected anymore
+                if($this->do_debug >= 1) {
+                    echo "SMTP -> NOTICE:" . $this->CRLF .
+                         "EOF caught while checking if connected";
+                }
+                $this->Close();
+                return false;
+            }
+            return true; # everything looks good
+        }
+        return false;
+    }
+
+    /**
+     * Closes the socket and cleans up the state of the class.
+     * It is not considered good to use this function without
+     * first trying to use QUIT.
+     * @access public
+     * @return void
+     */
+    function Close() {
+        $this->error = null; # so there is no confusion
+        $this->helo_rply = null;
+        if(!empty($this->smtp_conn)) {
+            # close the connection and cleanup
+            fclose($this->smtp_conn);
+            $this->smtp_conn = 0;
+        }
+    }
+
+
+    /***************************************************************
+     *                        SMTP COMMANDS                       *
+     *************************************************************/
+
+    /**
+     * Issues a data command and sends the msg_data to the server
+     * finializing the mail transaction. $msg_data is the message
+     * that is to be send with the headers. Each header needs to be
+     * on a single line followed by a <CRLF> with the message headers
+     * and the message body being seperated by and additional <CRLF>.
+     *
+     * Implements rfc 821: DATA <CRLF>
+     *
+     * SMTP CODE INTERMEDIATE: 354
+     *     [data]
+     *     <CRLF>.<CRLF>
+     *     SMTP CODE SUCCESS: 250
+     *     SMTP CODE FAILURE: 552,554,451,452
+     * SMTP CODE FAILURE: 451,554
+     * SMTP CODE ERROR  : 500,501,503,421
+     * @access public
+     * @return bool
+     */
+    function Data($msg_data) {
+        $this->error = null; # so no confusion is caused
+
+        if(!$this->connected()) {
+            $this->error = array(
+                    "error" => "Called Data() without being connected");
+            return false;
+        }
+
+        fputs($this->smtp_conn,"DATA" . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 354) {
+            $this->error =
+                array("error" => "DATA command not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+
+        # the server is ready to accept data!
+        # according to rfc 821 we should not send more than 1000
+        # including the CRLF
+        # characters on a single line so we will break the data up
+        # into lines by \r and/or \n then if needed we will break
+        # each of those into smaller lines to fit within the limit.
+        # in addition we will be looking for lines that start with
+        # a period '.' and append and additional period '.' to that
+        # line. NOTE: this does not count towards are limit.
+
+        # normalize the line breaks so we know the explode works
+        $msg_data = str_replace("\r\n","\n",$msg_data);
+        $msg_data = str_replace("\r","\n",$msg_data);
+        $lines = explode("\n",$msg_data);
+
+        # we need to find a good way to determine is headers are
+        # in the msg_data or if it is a straight msg body
+        # currently I'm assuming rfc 822 definitions of msg headers
+        # and if the first field of the first line (':' sperated)
+        # does not contain a space then it _should_ be a header
+        # and we can process all lines before a blank "" line as
+        # headers.
+        $field = substr($lines[0],0,strpos($lines[0],":"));
+        $in_headers = false;
+        if(!empty($field) && !strstr($field," ")) {
+            $in_headers = true;
+        }
+
+        $max_line_length = 998; # used below; set here for ease in change
+
+        while(list(,$line) = @each($lines)) {
+            $lines_out = null;
+            if($line == "" && $in_headers) {
+                $in_headers = false;
+            }
+            # ok we need to break this line up into several
+            # smaller lines
+            while(strlen($line) > $max_line_length) {
+                $pos = strrpos(substr($line,0,$max_line_length)," ");
+
+                # Patch to fix DOS attack
+                if(!$pos) {
+                    $pos = $max_line_length - 1;
+                }
+
+                $lines_out[] = substr($line,0,$pos);
+                $line = substr($line,$pos + 1);
+                # if we are processing headers we need to
+                # add a LWSP-char to the front of the new line
+                # rfc 822 on long msg headers
+                if($in_headers) {
+                    $line = "\t" . $line;
+                }
+            }
+            $lines_out[] = $line;
+
+            # now send the lines to the server
+            while(list(,$line_out) = @each($lines_out)) {
+                if(strlen($line_out) > 0)
+                {
+                    if(substr($line_out, 0, 1) == ".") {
+                        $line_out = "." . $line_out;
+                    }
+                }
+                fputs($this->smtp_conn,$line_out . $this->CRLF);
+            }
+        }
+
+        # ok all the message data has been sent so lets get this
+        # over with aleady
+        fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 250) {
+            $this->error =
+                array("error" => "DATA not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Expand takes the name and asks the server to list all the
+     * people who are members of the _list_. Expand will return
+     * back and array of the result or false if an error occurs.
+     * Each value in the array returned has the format of:
+     *     [ <full-name> <sp> ] <path>
+     * The definition of <path> is defined in rfc 821
+     *
+     * Implements rfc 821: EXPN <SP> <string> <CRLF>
+     *
+     * SMTP CODE SUCCESS: 250
+     * SMTP CODE FAILURE: 550
+     * SMTP CODE ERROR  : 500,501,502,504,421
+     * @access public
+     * @return string array
+     */
+    function Expand($name) {
+        $this->error = null; # so no confusion is caused
+
+        if(!$this->connected()) {
+            $this->error = array(
+                    "error" => "Called Expand() without being connected");
+            return false;
+        }
+
+        fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 250) {
+            $this->error =
+                array("error" => "EXPN not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+
+        # parse the reply and place in our array to return to user
+        $entries = explode($this->CRLF,$rply);
+        while(list(,$l) = @each($entries)) {
+            $list[] = substr($l,4);
+        }
+
+        return $list;
+    }
+
+    /**
+     * Sends the HELO command to the smtp server.
+     * This makes sure that we and the server are in
+     * the same known state.
+     *
+     * Implements from rfc 821: HELO <SP> <domain> <CRLF>
+     *
+     * SMTP CODE SUCCESS: 250
+     * SMTP CODE ERROR  : 500, 501, 504, 421
+     * @access public
+     * @return bool
+     */
+    function Hello($host="") {
+        $this->error = null; # so no confusion is caused
+
+        if(!$this->connected()) {
+            $this->error = array(
+                    "error" => "Called Hello() without being connected");
+            return false;
+        }
+
+        # if a hostname for the HELO wasn't specified determine
+        # a suitable one to send
+        if(empty($host)) {
+            # we need to determine some sort of appopiate default
+            # to send to the server
+            $host = "localhost";
+        }
+
+        // Send extended hello first (RFC 2821)
+        if(!$this->SendHello("EHLO", $host))
+        {
+            if(!$this->SendHello("HELO", $host))
+                return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Sends a HELO/EHLO command.
+     * @access private
+     * @return bool
+     */
+    function SendHello($hello, $host) {
+        fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply;
+        }
+
+        if($code != 250) {
+            $this->error =
+                array("error" => $hello . " not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+
+        $this->helo_rply = $rply;
+        
+        return true;
+    }
+
+    /**
+     * Gets help information on the keyword specified. If the keyword
+     * is not specified then returns generic help, ussually contianing
+     * A list of keywords that help is available on. This function
+     * returns the results back to the user. It is up to the user to
+     * handle the returned data. If an error occurs then false is
+     * returned with $this->error set appropiately.
+     *
+     * Implements rfc 821: HELP [ <SP> <string> ] <CRLF>
+     *
+     * SMTP CODE SUCCESS: 211,214
+     * SMTP CODE ERROR  : 500,501,502,504,421
+     * @access public
+     * @return string
+     */
+    function Help($keyword="") {
+        $this->error = null; # to avoid confusion
+
+        if(!$this->connected()) {
+            $this->error = array(
+                    "error" => "Called Help() without being connected");
+            return false;
+        }
+
+        $extra = "";
+        if(!empty($keyword)) {
+            $extra = " " . $keyword;
+        }
+
+        fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 211 && $code != 214) {
+            $this->error =
+                array("error" => "HELP not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+
+        return $rply;
+    }
+
+    /**
+     * Starts a mail transaction from the email address specified in
+     * $from. Returns true if successful or false otherwise. If True
+     * the mail transaction is started and then one or more Recipient
+     * commands may be called followed by a Data command.
+     *
+     * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
+     *
+     * SMTP CODE SUCCESS: 250
+     * SMTP CODE SUCCESS: 552,451,452
+     * SMTP CODE SUCCESS: 500,501,421
+     * @access public
+     * @return bool
+     */
+    function Mail($from) {
+        $this->error = null; # so no confusion is caused
+
+        if(!$this->connected()) {
+            $this->error = array(
+                    "error" => "Called Mail() without being connected");
+            return false;
+        }
+
+        fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 250) {
+            $this->error =
+                array("error" => "MAIL not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Sends the command NOOP to the SMTP server.
+     *
+     * Implements from rfc 821: NOOP <CRLF>
+     *
+     * SMTP CODE SUCCESS: 250
+     * SMTP CODE ERROR  : 500, 421
+     * @access public
+     * @return bool
+     */
+    function Noop() {
+        $this->error = null; # so no confusion is caused
+
+        if(!$this->connected()) {
+            $this->error = array(
+                    "error" => "Called Noop() without being connected");
+            return false;
+        }
+
+        fputs($this->smtp_conn,"NOOP" . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 250) {
+            $this->error =
+                array("error" => "NOOP not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Sends the quit command to the server and then closes the socket
+     * if there is no error or the $close_on_error argument is true.
+     *
+     * Implements from rfc 821: QUIT <CRLF>
+     *
+     * SMTP CODE SUCCESS: 221
+     * SMTP CODE ERROR  : 500
+     * @access public
+     * @return bool
+     */
+    function Quit($close_on_error=true) {
+        $this->error = null; # so there is no confusion
+
+        if(!$this->connected()) {
+            $this->error = array(
+                    "error" => "Called Quit() without being connected");
+            return false;
+        }
+
+        # send the quit command to the server
+        fputs($this->smtp_conn,"quit" . $this->CRLF);
+
+        # get any good-bye messages
+        $byemsg = $this->get_lines();
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg;
+        }
+
+        $rval = true;
+        $e = null;
+
+        $code = substr($byemsg,0,3);
+        if($code != 221) {
+            # use e as a tmp var cause Close will overwrite $this->error
+            $e = array("error" => "SMTP server rejected quit command",
+                       "smtp_code" => $code,
+                       "smtp_rply" => substr($byemsg,4));
+            $rval = false;
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $e["error"] . ": " .
+                         $byemsg . $this->CRLF;
+            }
+        }
+
+        if(empty($e) || $close_on_error) {
+            $this->Close();
+        }
+
+        return $rval;
+    }
+
+    /**
+     * Sends the command RCPT to the SMTP server with the TO: argument of $to.
+     * Returns true if the recipient was accepted false if it was rejected.
+     *
+     * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
+     *
+     * SMTP CODE SUCCESS: 250,251
+     * SMTP CODE FAILURE: 550,551,552,553,450,451,452
+     * SMTP CODE ERROR  : 500,501,503,421
+     * @access public
+     * @return bool
+     */
+    function Recipient($to) {
+        $this->error = null; # so no confusion is caused
+
+        if(!$this->connected()) {
+            $this->error = array(
+                    "error" => "Called Recipient() without being connected");
+            return false;
+        }
+
+        fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 250 && $code != 251) {
+            $this->error =
+                array("error" => "RCPT not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Sends the RSET command to abort and transaction that is
+     * currently in progress. Returns true if successful false
+     * otherwise.
+     *
+     * Implements rfc 821: RSET <CRLF>
+     *
+     * SMTP CODE SUCCESS: 250
+     * SMTP CODE ERROR  : 500,501,504,421
+     * @access public
+     * @return bool
+     */
+    function Reset() {
+        $this->error = null; # so no confusion is caused
+
+        if(!$this->connected()) {
+            $this->error = array(
+                    "error" => "Called Reset() without being connected");
+            return false;
+        }
+
+        fputs($this->smtp_conn,"RSET" . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 250) {
+            $this->error =
+                array("error" => "RSET failed",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Starts a mail transaction from the email address specified in
+     * $from. Returns true if successful or false otherwise. If True
+     * the mail transaction is started and then one or more Recipient
+     * commands may be called followed by a Data command. This command
+     * will send the message to the users terminal if they are logged
+     * in.
+     *
+     * Implements rfc 821: SEND <SP> FROM:<reverse-path> <CRLF>
+     *
+     * SMTP CODE SUCCESS: 250
+     * SMTP CODE SUCCESS: 552,451,452
+     * SMTP CODE SUCCESS: 500,501,502,421
+     * @access public
+     * @return bool
+     */
+    function Send($from) {
+        $this->error = null; # so no confusion is caused
+
+        if(!$this->connected()) {
+            $this->error = array(
+                    "error" => "Called Send() without being connected");
+            return false;
+        }
+
+        fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 250) {
+            $this->error =
+                array("error" => "SEND not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Starts a mail transaction from the email address specified in
+     * $from. Returns true if successful or false otherwise. If True
+     * the mail transaction is started and then one or more Recipient
+     * commands may be called followed by a Data command. This command
+     * will send the message to the users terminal if they are logged
+     * in and send them an email.
+     *
+     * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
+     *
+     * SMTP CODE SUCCESS: 250
+     * SMTP CODE SUCCESS: 552,451,452
+     * SMTP CODE SUCCESS: 500,501,502,421
+     * @access public
+     * @return bool
+     */
+    function SendAndMail($from) {
+        $this->error = null; # so no confusion is caused
+
+        if(!$this->connected()) {
+            $this->error = array(
+                "error" => "Called SendAndMail() without being connected");
+            return false;
+        }
+
+        fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 250) {
+            $this->error =
+                array("error" => "SAML not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Starts a mail transaction from the email address specified in
+     * $from. Returns true if successful or false otherwise. If True
+     * the mail transaction is started and then one or more Recipient
+     * commands may be called followed by a Data command. This command
+     * will send the message to the users terminal if they are logged
+     * in or mail it to them if they are not.
+     *
+     * Implements rfc 821: SOML <SP> FROM:<reverse-path> <CRLF>
+     *
+     * SMTP CODE SUCCESS: 250
+     * SMTP CODE SUCCESS: 552,451,452
+     * SMTP CODE SUCCESS: 500,501,502,421
+     * @access public
+     * @return bool
+     */
+    function SendOrMail($from) {
+        $this->error = null; # so no confusion is caused
+
+        if(!$this->connected()) {
+            $this->error = array(
+                "error" => "Called SendOrMail() without being connected");
+            return false;
+        }
+
+        fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 250) {
+            $this->error =
+                array("error" => "SOML not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * This is an optional command for SMTP that this class does not
+     * support. This method is here to make the RFC821 Definition
+     * complete for this class and __may__ be implimented in the future
+     *
+     * Implements from rfc 821: TURN <CRLF>
+     *
+     * SMTP CODE SUCCESS: 250
+     * SMTP CODE FAILURE: 502
+     * SMTP CODE ERROR  : 500, 503
+     * @access public
+     * @return bool
+     */
+    function Turn() {
+        $this->error = array("error" => "This method, TURN, of the SMTP ".
+                                        "is not implemented");
+        if($this->do_debug >= 1) {
+            echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF;
+        }
+        return false;
+    }
+
+    /**
+     * Verifies that the name is recognized by the server.
+     * Returns false if the name could not be verified otherwise
+     * the response from the server is returned.
+     *
+     * Implements rfc 821: VRFY <SP> <string> <CRLF>
+     *
+     * SMTP CODE SUCCESS: 250,251
+     * SMTP CODE FAILURE: 550,551,553
+     * SMTP CODE ERROR  : 500,501,502,421
+     * @access public
+     * @return int
+     */
+    function Verify($name) {
+        $this->error = null; # so no confusion is caused
+
+        if(!$this->connected()) {
+            $this->error = array(
+                    "error" => "Called Verify() without being connected");
+            return false;
+        }
+
+        fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($this->do_debug >= 2) {
+            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+        }
+
+        if($code != 250 && $code != 251) {
+            $this->error =
+                array("error" => "VRFY failed on name '$name'",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                echo "SMTP -> ERROR: " . $this->error["error"] .
+                         ": " . $rply . $this->CRLF;
+            }
+            return false;
+        }
+        return $rply;
+    }
+
+    /*******************************************************************
+     *                       INTERNAL FUNCTIONS                       *
+     ******************************************************************/
+
+    /**
+     * Read in as many lines as possible
+     * either before eof or socket timeout occurs on the operation.
+     * With SMTP we can tell if we have more lines to read if the
+     * 4th character is '-' symbol. If it is a space then we don't
+     * need to read anything else.
+     * @access private
+     * @return string
+     */
+    function get_lines() {
+        $data = "";
+        while($str = fgets($this->smtp_conn,515)) {
+            if($this->do_debug >= 4) {
+                echo "SMTP -> get_lines(): \$data was \"$data\"" .
+                         $this->CRLF;
+                echo "SMTP -> get_lines(): \$str is \"$str\"" .
+                         $this->CRLF;
+            }
+            $data .= $str;
+            if($this->do_debug >= 4) {
+                echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF;
+            }
+            # if the 4th character is a space then we are done reading
+            # so just break the loop
+            if(substr($str,3,1) == " ") { break; }
+        }
+        return $data;
+    }
+
+}
+
+
+ ?>
diff -ruN 2.2.3a-Final.src/class/mail/phpmailer/language/phpmailer.lang-en.php 2.2.6.src/class/mail/phpmailer/language/phpmailer.lang-en.php
--- 2.2.3a-Final.src/class/mail/phpmailer/language/phpmailer.lang-en.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/class/mail/phpmailer/language/phpmailer.lang-en.php	2007-09-09 00:44:27.000000000 -0500
@@ -0,0 +1,23 @@
+<?php
+/**
+ * PHPMailer language file.  
+ * English Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' .
+                                     'recipient email address.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
+$PHPMAILER_LANG["execute"] = 'Could not execute: ';
+$PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.';
+$PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.';
+$PHPMAILER_LANG["from_failed"] = 'The following From address failed: ';
+$PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' .
+                                       'recipients failed: ';
+$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.';
+$PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.';
+$PHPMAILER_LANG["file_access"] = 'Could not access file: ';
+$PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: ';
+$PHPMAILER_LANG["encoding"] = 'Unknown encoding: ';
+?>
diff -ruN 2.2.3a-Final.src/class/mail/phpmailer/README 2.2.6.src/class/mail/phpmailer/README
--- 2.2.3a-Final.src/class/mail/phpmailer/README	2004-12-30 06:56:27.000000000 -0600
+++ 2.2.6.src/class/mail/phpmailer/README	2007-09-09 00:44:27.000000000 -0500
@@ -1,9 +1,11 @@
-phpmailer - PHP email class
-==============================
-http://phpmailer.sourceforge.net
+PHPMailer
+Full Featured Email Transfer Class for PHP
+==========================================
 
-Please read LICENSE for information on this softwares availability and
-distribution.
+http://phpmailer.sourceforge.net/
+
+This software is licenced under the LGPL.  Please read LICENSE for information on the
+software availability and distribution.
 
 Class Features:
 - Send emails with multiple TOs, CCs, BCCs and REPLY-TOs
@@ -12,8 +14,8 @@
 - Support for 8bit, base64, binary, and quoted-printable encoding
 - Uses the same methods as the very popular AspEmail active server (COM) component
 - SMTP authentication
-- Word wrap
-- Many more...
+- Native language support
+- Word wrap, and more!
 
 Why you might need it:
 
@@ -37,19 +39,34 @@
 
 Copy class.phpmailer.php into your php.ini include_path. If you are
 using the SMTP mailer then place class.smtp.php in your path as well.
+In the language directory you will find several files like 
+phpmailer.lang-en.php.  If you look right before the .php extension 
+that there are two letters.  These represent the language type of the 
+translation file.  For instance "en" is the English file and "br" is 
+the Portuguese file.  Chose the file that best fits with your language 
+and place it in the PHP include path.  If your language is English 
+then you have nothing more to do.  If it is a different language then 
+you must point PHPMailer to the correct translation.  To do this, call 
+the PHPMailer SetLanguage method like so:
+
+// To load the Portuguese version
+$mail->SetLanguage("br", "/optional/path/to/language/directory/");
+
+That's it.  You should now be ready to use PHPMailer!
+
 
-Example
+A Simple Example:
 
 <?php
 require("class.phpmailer.php");
 
-$mail = new phpmailer();
+$mail = new PHPMailer();
 
 $mail->IsSMTP();                                      // set mailer to use SMTP
 $mail->Host = "smtp1.example.com;smtp2.example.com";  // specify main and backup server
-$mail->SMTPAuth = true     // turn on SMTP authentication
-$mail->Username = "jswan"  // SMTP username
-$mail->Password = "secret" // SMTP password
+$mail->SMTPAuth = true;     // turn on SMTP authentication
+$mail->Username = "jswan";  // SMTP username
+$mail->Password = "secret"; // SMTP password
 
 $mail->From = "from@example.com";
 $mail->FromName = "Mailer";
@@ -82,4 +99,4 @@
 
 Download: http://sourceforge.net/project/showfiles.php?group_id=26031
 
-Brent R. Matzelle <bmatzelle@yahoo.com>
+Brent R. Matzelle
diff -ruN 2.2.3a-Final.src/class/mail/xoopsmultimailer.php 2.2.6.src/class/mail/xoopsmultimailer.php
--- 2.2.3a-Final.src/class/mail/xoopsmultimailer.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/mail/xoopsmultimailer.php	2007-12-08 01:24:16.000000000 -0600
@@ -1,192 +1,278 @@
-<?php
-// $Id: xoopsmultimailer.php,v 1.7.6.2 2005/08/14 19:17:50 skalpa Exp $
-//  ------------------------------------------------------------------------ //
-//                XOOPS - PHP Content Management System                      //
-//                    Copyright (c) 2000 XOOPS.org                           //
-//                       <http://www.xoops.org/>                             //
-//  ------------------------------------------------------------------------ //
-//  This program 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.                                      //
-//                                                                           //
-//  You may not change or alter any portion of this comment or credits       //
-//  of supporting developers from this source code or any supporting         //
-//  source code which is considered copyrighted (c) material of the          //
-//  original comment or credit authors.                                      //
-//                                                                           //
-//  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.                             //
-//                                                                           //
-//  You should have received a copy of the GNU General Public License        //
-//  along with this program; if not, write to the Free Software              //
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
-//  ------------------------------------------------------------------------ //
-// Author: Jochen Bnagel (job@buennagel.com)                               //
-// URL:  http://www.xoops.org												 //
-// Project: The XOOPS Project                                                //
-// ------------------------------------------------------------------------- //
-if (!defined("XOOPS_ROOT_PATH")) {
-    die("XOOPS root path not defined");
-}
-/**
- * @package		class
- * @subpackage	mail
- * 
- * @filesource 
- *
- * @author		Jochen Bnagel	<jb@buennagel.com>
- * @copyright	copyright (c) 2000-2003 The XOOPS Project (http://www.xoops.org)
- *
- * @version		$Revision: 1.7.6.2 $ - $Date: 2005/08/14 19:17:50 $
- */
-
-/**
- * load the base class
- */
-require_once(XOOPS_ROOT_PATH.'/class/mail/phpmailer/class.phpmailer.php');
-
-/**
- * Mailer Class.
- * 
- * At the moment, this does nothing but send email through PHP's "mail()" function,
- * but it has the abiltiy to do much more.
- * 
- * If you have problems sending mail with "mail()", you can edit the member variables
- * to suit your setting. Later this will be possible through the admin panel.
- *
- * @todo		Make a page in the admin panel for setting mailer preferences.
- * 
- * @package		class
- * @subpackage	mail
- *
- * @author		Jochen Buennagel	<job@buennagel.com>
- * @copyright	(c) 2000-2003 The Xoops Project - www.xoops.org
- * @version		$Revision: 1.7.6.2 $ - changed by $Author: skalpa $ on $Date: 2005/08/14 19:17:50 $
- */
-class XoopsMultiMailer extends phpmailer {
-
-	/**
-	 * "from" address
-	 * @var 	string
-	 * @access	private
-	 */
-	var $From 		= "";
-	
-	/**
-	 * "from" name
-	 * @var 	string
-	 * @access	private
-	 */
-	var $FromName 	= "";
-
-	// can be "smtp", "sendmail", or "mail"
-	/**
-	 * Method to be used when sending the mail.
-	 * 
-	 * This can be:
-	 * <li>mail (standard PHP function "mail()") (default)
-	 * <li>smtp	(send through any SMTP server, SMTPAuth is supported.
-	 * You must set {@link $Host}, for SMTPAuth also {@link $SMTPAuth}, 
-	 * {@link $Username}, and {@link $Password}.)
-	 * <li>sendmail (manually set the path to your sendmail program 
-	 * to something different than "mail()" uses in {@link $Sendmail}) 
-	 * 
-	 * @var 	string
-	 * @access	private
-	 */
-	var $Mailer		= "mail";
-
-	/**
-	 * set if $Mailer is "sendmail"
-	 * 
-	 * Only used if {@link $Mailer} is set to "sendmail".
-	 * Contains the full path to your sendmail program or replacement.
-	 * @var 	string
-	 * @access	private
-	 */
-	var $Sendmail = "/usr/sbin/sendmail";
-
-	/**
-	 * SMTP Host.
-	 * 
-	 * Only used if {@link $Mailer} is set to "smtp"
-	 * @var 	string
-	 * @access	private
-	 */
-	var $Host		= "";
-
-	/**
-	 * Does your SMTP host require SMTPAuth authentication?
-	 * @var 	boolean
-	 * @access	private
-	 */
-	var $SMTPAuth	= FALSE;
-
-	/**
-	 * Username for authentication with your SMTP host.
-	 * 
-	 * Only used if {@link $Mailer} is "smtp" and {@link $SMTPAuth} is TRUE
-	 * @var 	string
-	 * @access	private
-	 */
-	var $Username	= "";
-
-	/**
-	 * Password for SMTPAuth.
-	 * 
-	 * Only used if {@link $Mailer} is "smtp" and {@link $SMTPAuth} is TRUE
-	 * @var 	string
-	 * @access	private
-	 */
-	var $Password	= "";
-	
-	/**
-	 * Constuctor
-	 * 
-	 * @access public
-	 * @return void 
-	 * 
-	 * @global	$xoopsConfig
-	 */
-	function XoopsMultiMailer(){
-		global $xoopsConfig;
-	
-		$config_handler =& xoops_gethandler('config');
-		$xoopsMailerConfig =& $config_handler->getConfigsByCat(XOOPS_CONF_MAILER);
-		$this->From = $xoopsMailerConfig['from'];
-		if ($this->From == '') {
-		    $this->From = $xoopsConfig['adminmail'];
-		}
-		
-		if ($xoopsMailerConfig["mailmethod"] == "smtpauth") {
-		    $this->Mailer = "smtp";
-			$this->SMTPAuth = TRUE;
-			$this->Host = $xoopsMailerConfig['smtphost'];
-			$this->Username = $xoopsMailerConfig['smtpuser'];
-			$this->Password = $xoopsMailerConfig['smtppass'];
-		} else {
-			$this->Mailer = $xoopsMailerConfig['mailmethod'];
-			$this->SMTPAuth = FALSE;
-			$this->Sendmail = $xoopsMailerConfig['sendmailpath'];
-			$this->Host = $xoopsMailerConfig['smtphost'];
-		}
-	}
-
-	/**
-     * Formats an address correctly. This overrides the default addr_format method which does not seem to encode $FromName correctly
-     * @access private
-     * @return string
-     */
-    function addr_format($addr) {
-        if(empty($addr[1]))
-            $formatted = $addr[0];
-        else
-            $formatted = sprintf('%s <%s>', '=?'.$this->CharSet.'?B?'.base64_encode($addr[1]).'?=', $addr[0]);
-
-        return $formatted;
-    }
-}
+<?php
+// $Id: xoopsmultimailer.php 1164 2007-12-08 07:24:16Z phppp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+// Author: Jochen Bnagel (job@buennagel.com)                               //
+// URL:  http://www.xoops.org												 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+if (!defined("XOOPS_ROOT_PATH")) {
+    die("XOOPS root path not defined");
+}
+/**
+ * @package		class
+ * @subpackage	mail
+ * 
+ * @filesource 
+ *
+ * @author		Jochen Bnagel	<jb@buennagel.com>
+ * @copyright	copyright (c) 2000-2003 The XOOPS Project (http://www.xoops.org)
+ *
+ * @version		$Revision: 1164 $ - $Date: 2007-12-08 02:24:16 -0500 (Sat, 08 Dec 2007) $
+ */
+
+/**
+ * load the base class
+ */
+require_once(XOOPS_ROOT_PATH.'/class/mail/phpmailer/class.phpmailer.php');
+
+/**
+ * Mailer Class.
+ * 
+ * At the moment, this does nothing but send email through PHP's "mail()" function,
+ * but it has the abiltiy to do much more.
+ * 
+ * If you have problems sending mail with "mail()", you can edit the member variables
+ * to suit your setting. Later this will be possible through the admin panel.
+ *
+ * @todo		Make a page in the admin panel for setting mailer preferences.
+ * 
+ * @package		class
+ * @subpackage	mail
+ *
+ * @author		Jochen Buennagel	<job@buennagel.com>
+ * @copyright	(c) 2000-2003 The Xoops Project - www.xoops.org
+ * @version		$Revision: 1164 $ - changed by $Author$ on $Date: 2007-12-08 02:24:16 -0500 (Sat, 08 Dec 2007) $
+ */
+class XoopsMultiMailer extends PHPMailer {
+
+	/**
+	 * "from" address
+	 * @var 	string
+	 * @access	private
+	 */
+	var $From 		= "";
+	
+	/**
+	 * "from" name
+	 * @var 	string
+	 * @access	private
+	 */
+	var $FromName 	= "";
+
+	// can be "smtp", "sendmail", or "mail"
+	/**
+	 * Method to be used when sending the mail.
+	 * 
+	 * This can be:
+	 * <li>mail (standard PHP function "mail()") (default)
+	 * <li>smtp	(send through any SMTP server, SMTPAuth is supported.
+	 * You must set {@link $Host}, for SMTPAuth also {@link $SMTPAuth}, 
+	 * {@link $Username}, and {@link $Password}.)
+	 * <li>sendmail (manually set the path to your sendmail program 
+	 * to something different than "mail()" uses in {@link $Sendmail}) 
+	 * 
+	 * @var 	string
+	 * @access	private
+	 */
+	var $Mailer		= "mail";
+
+	/**
+	 * set if $Mailer is "sendmail"
+	 * 
+	 * Only used if {@link $Mailer} is set to "sendmail".
+	 * Contains the full path to your sendmail program or replacement.
+	 * @var 	string
+	 * @access	private
+	 */
+	var $Sendmail = "/usr/sbin/sendmail";
+
+	/**
+	 * SMTP Host.
+	 * 
+	 * Only used if {@link $Mailer} is set to "smtp"
+	 * @var 	string
+	 * @access	private
+	 */
+	var $Host		= "";
+
+	/**
+	 * Does your SMTP host require SMTPAuth authentication?
+	 * @var 	boolean
+	 * @access	private
+	 */
+	var $SMTPAuth	= FALSE;
+
+	/**
+	 * Username for authentication with your SMTP host.
+	 * 
+	 * Only used if {@link $Mailer} is "smtp" and {@link $SMTPAuth} is TRUE
+	 * @var 	string
+	 * @access	private
+	 */
+	var $Username	= "";
+
+	/**
+	 * Password for SMTPAuth.
+	 * 
+	 * Only used if {@link $Mailer} is "smtp" and {@link $SMTPAuth} is TRUE
+	 * @var 	string
+	 * @access	private
+	 */
+	var $Password	= "";
+	
+	/**
+	 * Constuctor
+	 * 
+	 * @access public
+	 * @return void 
+	 * 
+	 * @global	$xoopsConfig
+	 */
+	function XoopsMultiMailer(){
+		global $xoopsConfig;
+	
+		$config_handler =& xoops_gethandler('config');
+		$xoopsMailerConfig =& $config_handler->getConfigsByCat(XOOPS_CONF_MAILER);
+		$this->From = $xoopsMailerConfig['from'];
+		if ($this->From == '') {
+		    $this->From = $xoopsConfig['adminmail'];
+		}
+		$this->Sender = $this->From;
+
+		if ($xoopsMailerConfig["mailmethod"] == "smtpauth") {
+		    $this->Mailer = "smtp";
+			$this->SMTPAuth = TRUE;
+			$this->Host = $xoopsMailerConfig['smtphost'];
+			$this->Username = $xoopsMailerConfig['smtpuser'];
+			$this->Password = $xoopsMailerConfig['smtppass'];
+		} else {
+			$this->Mailer = $xoopsMailerConfig['mailmethod'];
+			$this->SMTPAuth = FALSE;
+			$this->Sendmail = $xoopsMailerConfig['sendmailpath'];
+			$this->Host = $xoopsMailerConfig['smtphost'];
+		}
+		$this->CharSet = strtolower( _CHARSET );
+		if ( file_exists( XOOPS_ROOT_PATH . "/language/{$xoopsConfig['language']}/phpmailer.php" ) ) {
+			include( XOOPS_ROOT_PATH . "/language/{$xoopsConfig['language']}/phpmailer.php" );
+			$this->language = $PHPMAILER_LANG;
+		} else {
+			$this->SetLanguage( 'en', XOOPS_ROOT_PATH . "/class/mail/phpmailer/language/" );
+		}
+		$this->PluginDir = XOOPS_ROOT_PATH."/class/mail/phpmailer/";
+	}
+
+	/**
+     * Formats an address correctly. This overrides the default addr_format method which does not seem to encode $FromName correctly
+     * @access private
+     * @return string
+     */
+    function AddrFormat($addr) {
+        if(empty($addr[1]))
+            $formatted = $addr[0];
+        else
+            $formatted = sprintf('%s <%s>', '=?'.$this->CharSet.'?B?'.base64_encode($addr[1]).'?=', $addr[0]);
+
+        return $formatted;
+    }
+    /**
+    * Sends mail via SMTP using PhpSMTP (Author:
+    * Chris Ryan).  Returns bool.  Returns false if there is a
+    * bad MAIL FROM, or DATA input.
+    * Rebuild Header if there is a bad RCPT
+    * @access protected
+    * @return bool
+    */
+    function SmtpSend($header, $body) {
+        include_once($this->PluginDir . "class.smtp.php");
+        $error = "";
+        $bad_rcpt = array();
+
+        if (!$this->SmtpConnect()) {
+            return false;
+        }            
+
+        $smtp_from = ($this->Sender == "") ? $this->From : $this->Sender;
+        if (!$this->smtp->Mail($smtp_from)) {
+            $error = $this->Lang("from_failed") . $smtp_from;
+            $this->SetError($error);
+            $this->smtp->Reset();
+            return false;
+        }
+        // Attempt to send attach all recipients
+        for ($i = 0; $i < count($this->to); $i++) {
+            if (!$this->smtp->Recipient($this->to[$i][0])) {
+                $bad_rcpt[] = $this->to[$i][0];
+                unset($this->to[$i]);
+            }
+        }
+        for ($i = 0; $i < count($this->cc); $i++) {
+            if (!$this->smtp->Recipient($this->cc[$i][0])) {
+                $bad_rcpt[] = $this->cc[$i][0];
+                unset($this->cc[$i]);
+            }
+        }
+        for ($i = 0; $i < count($this->bcc); $i++) {
+            if (!$this->smtp->Recipient($this->bcc[$i][0])) {
+                $bad_rcpt[] = $this->bcc[$i][0];
+                unset($this->bcc[$i]);
+            }
+        }
+
+        // Create error message
+        $count = count($bad_rcpt);
+        if ($count > 0) {
+            for ($i = 0; $i < $count; $i++) {
+                if ($i != 0) { 
+                    $error .= ", ";
+                }
+                $error .= $bad_rcpt[$i];
+            }
+            
+            //To rebuild a correct header, it should to rebuild a correct adress array
+            $this->to = array_values($this->to);
+            $this->cc = array_values($this->cc);
+            $this->bcc = array_values($this->bcc);
+            $header = $this->CreateHeader();
+            
+            $error = $this->Lang("recipients_failed") . $error;
+            $this->SetError($error);
+        }
+        if (!$this->smtp->Data($header . $body)) {
+            $this->SetError($this->Lang("data_not_accepted"));
+            $this->smtp->Reset();
+            return false;
+        }
+        if ($this->SMTPKeepAlive == true) {
+            $this->smtp->Reset();
+        } else {
+            $this->SmtpClose();
+        }
+
+        return true;
+    }
+}
+
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/class/mimetypes.inc.php 2.2.6.src/class/mimetypes.inc.php
--- 2.2.3a-Final.src/class/mimetypes.inc.php	2005-03-31 11:39:25.000000000 -0600
+++ 2.2.6.src/class/mimetypes.inc.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,233 +1,118 @@
-<?php
-// $Id: mimetypes.inc.php,v 1.1.4.2 2005/03/31 18:39:25 mithyt2 Exp $
-/**
-
-* Extension to mimetype lookup table
-
-*
-
-* This file is provided as an helper for objects who need to perform filename to mimetype translations.
-
-* Common types have been provided, but feel free to add your own one if you need it.
-
-* <br /><br />
-
-* See the enclosed file LICENSE for licensing information.
-
-* If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html
-
-*
-
-* @copyright    The Xoops project http://www.xoops.org/
-
-* @license      http://www.fsf.org/copyleft/gpl.html GNU public license
-
-* @author       Skalpa Keo <skalpa@xoops.org>
-
-* @since        2.0.9.3
-
-*/
-
-return array(
-
-     "hqx"		=> "application/mac-binhex40",
-
-     "doc"		=> "application/msword",
-
-     "dot"		=> "application/msword",
-
-     "bin"		=> "application/octet-stream",
-
-     "lha"		=> "application/octet-stream",
-
-     "lzh"		=> "application/octet-stream",
-
-     "exe"		=> "application/octet-stream",
-
-     "class"	=> "application/octet-stream",
-
-     "so"		=> "application/octet-stream",
-
-     "dll"		=> "application/octet-stream",
-
-     "pdf"		=> "application/pdf",
-
-     "ai"		=> "application/postscript",
-
-     "eps"		=> "application/postscript",
-
-     "ps"		=> "application/postscript",
-
-     "smi"		=> "application/smil",
-
-     "smil"		=> "application/smil",
-
-     "wbxml"	=> "application/vnd.wap.wbxml",
-
-     "wmlc"		=> "application/vnd.wap.wmlc",
-
-     "wmlsc"	=> "application/vnd.wap.wmlscriptc",
-
-     "xla"		=> "application/vnd.ms-excel",
-
-     "xls"		=> "application/vnd.ms-excel",
-
-     "xlt"		=> "application/vnd.ms-excel",
-
-     "ppt"		=> "application/vnd.ms-powerpoint",
-
-     "csh"		=> "application/x-csh",
-
-     "dcr"		=> "application/x-director",
-
-     "dir"		=> "application/x-director",
-
-     "dxr"		=> "application/x-director",
-
-     "spl"		=> "application/x-futuresplash",
-
-     "gtar"		=> "application/x-gtar",
-
-     "php"		=> "application/x-httpd-php",
-
-     "php3"		=> "application/x-httpd-php",
-
-     "php5"		=> "application/x-httpd-php",
-
-     "phtml"	=> "application/x-httpd-php",
-
-     "js"		=> "application/x-javascript",
-
-     "sh"		=> "application/x-sh",
-
-     "swf"		=> "application/x-shockwave-flash",
-
-     "sit"		=> "application/x-stuffit",
-
-     "tar"		=> "application/x-tar",
-
-     "tcl"		=> "application/x-tcl",
-
-     "xhtml"	=> "application/xhtml+xml",
-
-     "xht"		=> "application/xhtml+xml",
-
-     "xhtml"	=> "application/xml",
-
-     "ent"		=> "application/xml-external-parsed-entity",
-
-     "dtd"		=> "application/xml-dtd",
-
-     "mod"		=> "application/xml-dtd",
-
-     "gz"		=> "application/x-gzip",
-
-     "zip"		=> "application/zip",
-
-     "au"		=> "audio/basic",
-
-     "snd"		=> "audio/basic",
-
-     "mid"		=> "audio/midi",
-
-     "midi"		=> "audio/midi",
-
-     "kar"		=> "audio/midi",
-
-     "mp1"		=> "audio/mpeg",
-
-     "mp2"		=> "audio/mpeg",
-
-     "mp3"		=> "audio/mpeg",
-
-     "aif"		=> "audio/x-aiff",
-
-     "aiff"		=> "audio/x-aiff",
-
-     "m3u"		=> "audio/x-mpegurl",
-
-     "ram"		=> "audio/x-pn-realaudio",
-
-     "rm"		=> "audio/x-pn-realaudio",
-
-     "rpm"		=> "audio/x-pn-realaudio-plugin",
-
-     "ra"		=> "audio/x-realaudio",
-
-     "wav"		=> "audio/x-wav",
-
-     "bmp"		=> "image/bmp",
-
-     "gif"		=> "image/gif",
-
-     "jpeg"		=> "image/jpeg",
-
-     "jpg"		=> "image/jpeg",
-
-     "jpe"		=> "image/jpeg",
-
-     "png"		=> "image/png",
-
-     "tiff"		=> "image/tiff",
-
-     "tif"		=> "image/tif",
-
-     "wbmp"		=> "image/vnd.wap.wbmp",
-
-     "pnm"		=> "image/x-portable-anymap",
-
-     "pbm"		=> "image/x-portable-bitmap",
-
-     "pgm"		=> "image/x-portable-graymap",
-
-     "ppm"		=> "image/x-portable-pixmap",
-
-     "xbm"		=> "image/x-xbitmap",
-
-     "xpm"		=> "image/x-xpixmap",
-
-	 "ics"		=> "text/calendar",
-
-	 "ifb"		=> "text/calendar",
-
-     "css"		=> "text/css",
-
-     "html"		=> "text/html",
-
-     "htm"		=> "text/html",
-
-     "asc"		=> "text/plain",
-
-     "txt"		=> "text/plain",
-
-     "rtf"		=> "text/rtf",
-
-     "sgml"		=> "text/x-sgml",
-
-     "sgm"		=> "text/x-sgml",
-
-     "tsv"		=> "text/tab-seperated-values",
-
-     "wml"		=> "text/vnd.wap.wml",
-
-     "wmls"		=> "text/vnd.wap.wmlscript",
-
-     "xsl"		=> "text/xml",
-
-     "mpeg"		=> "video/mpeg",
-
-     "mpg"		=> "video/mpeg",
-
-     "mpe"		=> "video/mpeg",
-
-     "qt"		=> "video/quicktime",
-
-     "mov"		=> "video/quicktime",
-
-     "avi"		=> "video/x-msvideo",
-
-);
-
-
-
+<?php
+// $Id: mimetypes.inc.php 185 2006-01-22 23:49:01Z skalpa $
+/**
+* Extension to mimetype lookup table
+*
+* This file is provided as an helper for objects who need to perform filename to mimetype translations.
+* Common types have been provided, but feel free to add your own one if you need it.
+* <br /><br />
+* See the enclosed file LICENSE for licensing information.
+* If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html
+*
+* @copyright    The Xoops project http://www.xoops.org/
+* @license      http://www.fsf.org/copyleft/gpl.html GNU public license
+* @author       Skalpa Keo <skalpa@xoops.org>
+* @since        2.0.9.3
+*/
+
+return array(
+     "hqx"      => "application/mac-binhex40",
+     "doc"      => "application/msword",
+     "dot"      => "application/msword",
+     "bin"      => "application/octet-stream",
+     "lha"      => "application/octet-stream",
+     "lzh"      => "application/octet-stream",
+     "exe"      => "application/octet-stream",
+     "class"    => "application/octet-stream",
+     "so"       => "application/octet-stream",
+     "dll"      => "application/octet-stream",
+     "pdf"      => "application/pdf",
+     "ai"       => "application/postscript",
+     "eps"      => "application/postscript",
+     "ps"       => "application/postscript",
+     "smi"      => "application/smil",
+     "smil"     => "application/smil",
+     "wbxml"    => "application/vnd.wap.wbxml",
+     "wmlc"     => "application/vnd.wap.wmlc",
+     "wmlsc"    => "application/vnd.wap.wmlscriptc",
+     "xla"      => "application/vnd.ms-excel",
+     "xls"      => "application/vnd.ms-excel",
+     "xlt"      => "application/vnd.ms-excel",
+     "ppt"      => "application/vnd.ms-powerpoint",
+     "csh"      => "application/x-csh",
+     "dcr"      => "application/x-director",
+     "dir"      => "application/x-director",
+     "dxr"      => "application/x-director",
+     "spl"      => "application/x-futuresplash",
+     "gtar"     => "application/x-gtar",
+     "php"      => "application/x-httpd-php",
+     "php3"     => "application/x-httpd-php",
+     "php5"     => "application/x-httpd-php",
+     "phtml"    => "application/x-httpd-php",
+     "js"       => "application/x-javascript",
+     "sh"       => "application/x-sh",
+     "swf"      => "application/x-shockwave-flash",
+     "sit"      => "application/x-stuffit",
+     "tar"      => "application/x-tar",
+     "tcl"      => "application/x-tcl",
+     "xhtml"    => "application/xhtml+xml",
+     "xht"      => "application/xhtml+xml",
+     "xhtml"    => "application/xml",
+     "ent"      => "application/xml-external-parsed-entity",
+     "dtd"      => "application/xml-dtd",
+     "mod"      => "application/xml-dtd",
+     "gz"       => "application/x-gzip",
+     "zip"      => "application/zip",
+     "au"       => "audio/basic",
+     "snd"      => "audio/basic",
+     "mid"      => "audio/midi",
+     "midi"     => "audio/midi",
+     "kar"      => "audio/midi",
+     "mp1"      => "audio/mpeg",
+     "mp2"      => "audio/mpeg",
+     "mp3"      => "audio/mpeg",
+     "aif"      => "audio/x-aiff",
+     "aiff"     => "audio/x-aiff",
+     "m3u"      => "audio/x-mpegurl",
+     "ram"      => "audio/x-pn-realaudio",
+     "rm"       => "audio/x-pn-realaudio",
+     "rpm"      => "audio/x-pn-realaudio-plugin",
+     "ra"       => "audio/x-realaudio",
+     "wav"      => "audio/x-wav",
+     "bmp"      => "image/bmp",
+     "gif"      => "image/gif",
+     "jpeg"     => "image/jpeg",
+     "jpg"      => "image/jpeg",
+     "jpe"      => "image/jpeg",
+     "png"      => "image/png",
+     "tiff"     => "image/tiff",
+     "tif"      => "image/tif",
+     "wbmp"     => "image/vnd.wap.wbmp",
+     "pnm"      => "image/x-portable-anymap",
+     "pbm"      => "image/x-portable-bitmap",
+     "pgm"      => "image/x-portable-graymap",
+     "ppm"      => "image/x-portable-pixmap",
+     "xbm"      => "image/x-xbitmap",
+     "xpm"      => "image/x-xpixmap",
+     "ics"      => "text/calendar",
+     "ifb"      => "text/calendar",
+     "css"      => "text/css",
+     "html"     => "text/html",
+     "htm"      => "text/html",
+     "asc"      => "text/plain",
+     "txt"      => "text/plain",
+     "rtf"      => "text/rtf",
+     "sgml"     => "text/x-sgml",
+     "sgm"      => "text/x-sgml",
+     "tsv"      => "text/tab-seperated-values",
+     "wml"      => "text/vnd.wap.wml",
+     "wmls"     => "text/vnd.wap.wmlscript",
+     "xsl"      => "text/xml",
+     "mpeg"     => "video/mpeg",
+     "mpg"      => "video/mpeg",
+     "mpe"      => "video/mpeg",
+     "qt"       => "video/quicktime",
+     "mov"      => "video/quicktime",
+     "avi"      => "video/x-msvideo",
+);
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/class/module.errorhandler.php 2.2.6.src/class/module.errorhandler.php
--- 2.2.3a-Final.src/class/module.errorhandler.php	2004-12-26 13:11:48.000000000 -0600
+++ 2.2.6.src/class/module.errorhandler.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: module.errorhandler.php,v 1.9 2004/12/26 19:11:48 onokazu Exp $
+// $Id: module.errorhandler.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/module.textsanitizer.php 2.2.6.src/class/module.textsanitizer.php
--- 2.2.3a-Final.src/class/module.textsanitizer.php	2005-10-27 19:42:20.000000000 -0500
+++ 2.2.6.src/class/module.textsanitizer.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: module.textsanitizer.php,v 1.26.6.6.2.2 2005/10/28 01:42:20 skalpa Exp $
+// $Id: module.textsanitizer.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -131,18 +131,22 @@
 	function makeClickable( $text )
 	{
 		/*$patterns = array("/(^|[^]_a-z0-9-=\"'\/])([a-z]+?):\/\/([^, \r\n\"\(\)'<>]+)/i", "/(^|[^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([^, \r\n\"\(\)'<>]+)/i", "/(^|[^]_a-z0-9-=\"'\/])ftp\.([a-z0-9\-]+)\.([^, \r\n\"\(\)'<>]+)/i", "/(^|[^]_a-z0-9-=\"'\/:\.])([a-z0-9\-_\.]+?)@([^, \r\n\"\(\)'<>\[\]]+)/i");*/
-		$patterns = array("/(^|[^]_a-z0-9-=\"'\/])([a-z]+?):\/\/([^
-                            \r\n\"\(\)'<>]+)/i",
-                            "/(^|[^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([^
-                            \r\n\"\(\)'<>]+)/i",
-                            "/(^|[^]_a-z0-9-=\"'\/])ftp\.([a-z0-9\-]+)\.([^
-                            \r\n\"\(\)'<>]+)/i",
-                            "/(^|[^]_a-z0-9-=\"'\/:\.])([a-z0-9\-_\.]+?)@([^
-                            \r\n\"\(\)'<>\[\]]+)/i");
+		$patterns = array("/(^|[^]_a-z0-9-=\"'\/])([a-z]+?):\/\/([^,\r\n\"\(\)'<>\s\b\[\]]+)/i",
+                            "/(^|[^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([^,\r\n\"\(\)'<>\s\b\[\]]+)/i"
+                            /*
+                            ,
+                            "/(^|[^]_a-z0-9-=\"'\/])ftp\.([a-z0-9\-]+)\.([^\r\n\"\(\)'<>]+)/i",
+                            "/(^|[^]_a-z0-9-=\"'\/:\.])([a-z0-9\-_\.]+?)@([^\r\n\"\(\)'<>\[\]]+)/i"
+                            */
+                            );
 		$replacements = array("\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", 
-		                      "\\1<a href=\"http://www.\\2.\\3\" target=\"_blank\">www.\\2.\\3</a>",
+		                      "\\1<a href=\"http://www.\\2.\\3\" target=\"_blank\">www.\\2.\\3</a>"
+		                      /*
+		                      ,
 		                       "\\1<a href=\"ftp://ftp.\\2.\\3\" target=\"_blank\">ftp.\\2.\\3</a>",
-		                       "\\1<script type=\"text/javascript\">var id='\\2';var host1='\\3';var host2='';document.write('<a href=\"mailto:'+id+'@'+host1+'.'+host2+'\">'+id+'@'+host1+'.'+host2+'</a>');</script>");
+		                       "\\1<script type=\"text/javascript\">var id='\\2';var host1='\\3';var host2='';document.write('<a href=\"mailto:'+id+'@'+host1+'.'+host2+'\">'+id+'@'+host1+'.'+host2+'</a>');</script>"
+		                       */
+		                       );
 		return preg_replace($patterns, $replacements, $text);
 	}
 
@@ -307,28 +311,28 @@
 	{
 		if ($html != 1) {
 			// html not allowed
-			$text =& $this->htmlSpecialChars($text);
+			$text = $this->htmlSpecialChars($text);
 		}
-		$text =& $this->codePreConv($text, $xcode); // Ryuji_edit(2003-11-18)
-		$text =& $this->makeClickable($text);
+		$text = $this->codePreConv($text, $xcode); // Ryuji_edit(2003-11-18)
+		$text = $this->makeClickable($text);
 		if ($smiley != 0) {
 			// process smiley
-			$text =& $this->smiley($text);
+			$text = $this->smiley($text);
 		}
 		if ($xcode != 0) {
 			// decode xcode
 			if ($image != 0) {
 				// image allowed
-				$text =& $this->xoopsCodeDecode($text);
+				$text = $this->xoopsCodeDecode($text);
             		} else {
                 		// image not allowed
-                		$text =& $this->xoopsCodeDecode($text, 0);
+                		$text = $this->xoopsCodeDecode($text, 0);
 			}
 		}
 		if ($br != 0) {
-			$text =& $this->nl2Br($text);
+			$text = $this->nl2Br($text);
 		}
-		$text =& $this->codeConv($text, $xcode, $image);	// Ryuji_edit(2003-11-18)
+		$text = $this->codeConv($text, $xcode, $image);	// Ryuji_edit(2003-11-18)
 		return $text;
 	}
 
@@ -345,31 +349,31 @@
 	 **/
 	function &previewTarea(&$text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
 	{
-		$text =& $this->stripSlashesGPC($text);
+		$text = $this->stripSlashesGPC($text);
 		if ($html != 1) {
 			// html not allowed
-			$text =& $this->htmlSpecialChars($text);
+			$text = $this->htmlSpecialChars($text);
 		}
-		$text =& $this->codePreConv($text, $xcode); // Ryuji_edit(2003-11-18)
-		$text =& $this->makeClickable($text);
+		$text = $this->codePreConv($text, $xcode); // Ryuji_edit(2003-11-18)
+		$text = $this->makeClickable($text);
 		if ($smiley != 0) {
 			// process smiley
-			$text =& $this->smiley($text);
+			$text = $this->smiley($text);
 		}
 		if ($xcode != 0) {
 			// decode xcode
 			if ($image != 0) {
 				// image allowed
-				$text =& $this->xoopsCodeDecode($text);
+				$text = $this->xoopsCodeDecode($text);
 			} else {
 				// image not allowed
-				$text =& $this->xoopsCodeDecode($text, 0);
+				$text = $this->xoopsCodeDecode($text, 0);
 			}
 		}
 		if ($br != 0) {
-			$text =& $this->nl2Br($text);
+			$text = $this->nl2Br($text);
 		}
-		$text =& $this->codeConv($text, $xcode, $image);	// Ryuji_edit(2003-11-18)
+		$text = $this->codeConv($text, $xcode, $image);	// Ryuji_edit(2003-11-18)
 		return $text;
 	}
 
@@ -390,6 +394,13 @@
 		if ($this->censorConf['censor_enable'] == 1) {
 			$replacement = $this->censorConf['censor_replace'];
 			foreach ($this->censorConf['censor_words'] as $bad) {
+				$bad = trim($bad);
+				if(!empty($bad)){
+					$patterns[] = "/([^0-9a-z_])".$bad."([^0-9a-z_])/siU";
+					$replacements[] = "\\1".$replacement."\\2";
+					$text = preg_replace($patterns, $replacements, $text);
+				}
+				/*
 				if ( !empty($bad) && $bad != null && $bad != "" && $bad != " ") {//$bad must not be an empty string or everything will be censored. Spaces not allowed as bad strings either
 	 				$bad = quotemeta($bad);
 					$patterns[] = "/(\s)".$bad."/siU";
@@ -402,6 +413,7 @@
 					$replacements[] = "]".$replacement;
 					$text = preg_replace($patterns, $replacements, $text);
 				}
+				*/
    			}
 		}
    		return $text;
@@ -573,7 +585,7 @@
 	function &oopsStripSlashesRT($text)
 	{
 		if (get_magic_quotes_runtime()) {
-			$text =& stripslashes($text);
+			$text = stripslashes($text);
 		}
 		return $text;
 	}
diff -ruN 2.2.3a-Final.src/class/pagenav.php 2.2.6.src/class/pagenav.php
--- 2.2.3a-Final.src/class/pagenav.php	2005-07-04 09:23:50.000000000 -0500
+++ 2.2.6.src/class/pagenav.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pagenav.php,v 1.10.6.3 2005/07/04 15:23:50 mithyt2 Exp $
+// $Id: pagenav.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/smarty/Config_File.class.php 2.2.6.src/class/smarty/Config_File.class.php
--- 2.2.3a-Final.src/class/smarty/Config_File.class.php	2004-12-26 13:11:49.000000000 -0600
+++ 2.2.6.src/class/smarty/Config_File.class.php	2006-01-22 16:34:51.000000000 -0600
@@ -25,7 +25,7 @@
  * @package Smarty
  */
 
-/* $Id: Config_File.class.php,v 1.3 2004/12/26 19:11:49 onokazu Exp $ */
+/* $Id: Config_File.class.php 184 2006-01-22 22:34:51Z skalpa $ */
 
 /**
  * Config file reading class
diff -ruN 2.2.3a-Final.src/class/smarty/plugins/compiler.foreachq.php 2.2.6.src/class/smarty/plugins/compiler.foreachq.php
--- 2.2.3a-Final.src/class/smarty/plugins/compiler.foreachq.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/class/smarty/plugins/compiler.foreachq.php	2007-09-09 00:44:27.000000000 -0500
@@ -0,0 +1,104 @@
+<?php
+/**
+ * foreachq Smarty compiler plug-in
+ *
+ * See the enclosed file LICENSE for licensing information.
+ * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html
+ *
+ * @copyright   The XOOPS project http://www.xoops.org/
+ * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @author		Skalpa Keo <skalpa@xoops.org>
+ * @package		xos_opal
+ * @subpackage	xos_opal_Smarty
+ * @since       2.0.14
+ * @version		$Id: compiler.foreachq.php 507 2006-05-26 23:39:35Z skalpa $
+ */
+
+/**
+ * Quick foreach template plug-in
+ *
+ * This plug-in works as a direct replacement for the original Smarty
+ * {@link http://smarty.php.net/manual/en/language.function.foreach.php foreach} function.
+ * 
+ * The difference with <var>foreach</var> is minimal in terms of functionality, but can boost your templates
+ * a lot: foreach duplicates the content of the variable that is iterated, to ensure non-array
+ * variables can be specified freely. This implementation does not do that, but as a consequence
+ * requires that the variable you specify in the <var>from</var> parameter is an array or
+ * (when using PHP5) an object. Check the difference between the code generated by foreach
+ * and foreachq to understand completely.
+ * 
+ * <b>Note:</b> to use foreachq, only the opening tag has to be replaced. The closing tab still
+ * remains {/foreach}
+ * 
+ * <code>
+ * // Iterate, slow version
+ * {foreach from=$array item=elt}
+ *   {$elt}
+ * {/foreach}
+ * // Iterate, fast version
+ * {foreachq from=$array item=elt}
+ *   {$elt}
+ * {/foreach}
+ * </code>
+ */
+function smarty_compiler_foreachq( $argStr, &$comp ) {
+
+	$comp->_push_tag('foreach');
+
+	$attrs = $comp->_parse_attrs( $argStr, false );
+
+    $arg_list = array();
+
+    if (empty($attrs['from'])) {
+        return $comp->_syntax_error("foreachq: missing 'from' attribute", E_USER_ERROR, __FILE__, __LINE__);
+    }
+    $from = $attrs['from'];
+
+    if (empty($attrs['item'])) {
+        return $comp->_syntax_error("foreachq: missing 'item' attribute", E_USER_ERROR, __FILE__, __LINE__);
+    }
+    $item = $comp->_dequote($attrs['item']);
+    if (!preg_match('~^\w+$~', $item)) {
+        return $comp->_syntax_error("'foreachq: item' must be a variable name (literal string)", E_USER_ERROR, __FILE__, __LINE__);
+    }
+
+    if (isset($attrs['key'])) {
+        $key  = $comp->_dequote($attrs['key']);
+        if (!preg_match('~^\w+$~', $key)) {
+            return $comp->_syntax_error("foreachq: 'key' must to be a variable name (literal string)", E_USER_ERROR, __FILE__, __LINE__);
+        }
+        $key_part = "\$this->_tpl_vars['$key'] => ";
+    } else {
+        $key = null;
+        $key_part = '';
+    }
+
+    if (isset($attrs['name'])) {
+        $name = $attrs['name'];
+    } else {
+        $name = null;
+    }
+
+    $output = '';
+    //$output .= "\$_from = $from; if (!is_array(\$_from) && !is_object(\$_from)) { settype(\$_from, 'array'); }";
+    if (isset($name)) {
+        $foreach_props = "\$this->_foreach[$name]";
+        $output .= "{$foreach_props} = array('total' => count($from), 'iteration' => 0);\n";
+        //$output .= "{$foreach_props} = array('total' => count(\$_from), 'iteration' => 0);\n";
+        $output .= "if ({$foreach_props}['total'] > 0):\n";
+        $output .= "    foreach ($from as $key_part\$this->_tpl_vars['$item']):\n";
+        //$output .= "    foreach (\$_from as $key_part\$this->_tpl_vars['$item']):\n";
+        $output .= "        {$foreach_props}['iteration']++;\n";
+    } else {
+        $output .= "if (count($from)):\n";
+        $output .= "    foreach ($from as $key_part\$this->_tpl_vars['$item']):\n";
+        //$output .= "if (count(\$_from)):\n";
+        //$output .= "    foreach (\$_from as $key_part\$this->_tpl_vars['$item']):\n";
+    }
+    //$output .= '';
+
+    return $output;
+
+}
+
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/class/smarty/plugins/compiler.includeq.php 2.2.6.src/class/smarty/plugins/compiler.includeq.php
--- 2.2.3a-Final.src/class/smarty/plugins/compiler.includeq.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/class/smarty/plugins/compiler.includeq.php	2007-09-09 00:44:27.000000000 -0500
@@ -0,0 +1,86 @@
+<?php
+/**
+ * includeq Smarty compiler plug-in
+ *
+ * See the enclosed file LICENSE for licensing information.
+ * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html
+ *
+ * @copyright   The XOOPS project http://www.xoops.org/
+ * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @author		Skalpa Keo <skalpa@xoops.org>
+ * @package		xos_opal
+ * @subpackage	xos_opal_Smarty
+ * @since       2.0.14
+ * @version		$Id: compiler.includeq.php 507 2006-05-26 23:39:35Z skalpa $
+ */
+
+/**
+ * Quick include template plug-in
+ *
+ * Like {@link smarty_compiler_foreachq() foreachq}, this plug-in has been written to provide
+ * a faster version of an already existing Smarty function. <var>includeq</var> can be used
+ * as a replacement for the Smarty 
+ * {@link http://smarty.php.net/manual/en/language.function.include.php include} function as long
+ * as you are aware of the differences between them.
+ * 
+ * Normally, when you include a template, Smarty does the following:
+ * - Backup all your template variables in an array
+ * - Include the template you specified
+ * - Restore the template variables from the previously created backup array
+ * 
+ * The advantage of this method is that it makes the main template variables <i>safe</i>: if your
+ * main template uses a variable called <var>$stuff</var> and the included template modifies it
+ * value, the main template will recover the original value automatically.
+ * 
+ * While this can be useful in some cases (for example, when you include templates you have absolutely
+ * no control over), some may consider this a limitation and it has the disadvantage of slowing down
+ * the inclusion mechanism a lot.
+ * 
+ * <var>includeq</var> fixes that: the code it generates doesn't contain the variables backup/recovery
+ * mechanism and thus makes templates inclusion faster. Note that however, this new behavior may
+ * create problems in some cases (but you can prevent them most of the times, for example by always
+ * using a <var>tmp_</var> prefix for the variables you create in included templates looping sections).
+ */
+function smarty_compiler_includeq( $tag_args, &$comp ) {
+
+	$attrs = $comp->_parse_attrs($tag_args);
+    $arg_list = array();
+
+    if (empty($attrs['file'])) {
+        $comp->_syntax_error("missing 'file' attribute in includeq tag", E_USER_ERROR, __FILE__, __LINE__);
+    }
+
+    foreach ($attrs as $arg_name => $arg_value) {
+        if ($arg_name == 'file') {
+            $include_file = $arg_value;
+            continue;
+        } else if ($arg_name == 'assign') {
+            $assign_var = $arg_value;
+            continue;
+        }
+        if (is_bool($arg_value))
+            $arg_value = $arg_value ? 'true' : 'false';
+        $arg_list[] = "'$arg_name' => $arg_value";
+    }
+
+    $output = '';
+
+    if (isset($assign_var)) {
+        $output .= "ob_start();\n";
+    }
+
+    //$output .= "\$_smarty_tpl_vars = \$this->_tpl_vars;\n";
+    $_params = "array('smarty_include_tpl_file' => " . $include_file . ", 'smarty_include_vars' => array(".implode(',', (array)$arg_list)."))";
+    $output .= "\$this->_smarty_include($_params);\n";
+    //"\$this->_tpl_vars = \$_smarty_tpl_vars;\n" .
+    //"unset(\$_smarty_tpl_vars);\n";
+
+    if (isset($assign_var)) {
+        $output .= "\$this->assign(" . $assign_var . ", ob_get_contents()); ob_end_clean();\n";
+    }
+    //$output .= '';
+    return $output;
+}
+
+    
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/class/smarty/plugins/function.xoops_link.php 2.2.6.src/class/smarty/plugins/function.xoops_link.php
--- 2.2.3a-Final.src/class/smarty/plugins/function.xoops_link.php	2005-04-08 13:06:37.000000000 -0500
+++ 2.2.6.src/class/smarty/plugins/function.xoops_link.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: function.xoops_link.php,v 1.1.26.1 2005/04/08 19:06:37 mithyt2 Exp $
+// $Id: function.xoops_link.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/smarty/Smarty.class.php 2.2.6.src/class/smarty/Smarty.class.php
--- 2.2.3a-Final.src/class/smarty/Smarty.class.php	2004-12-26 13:11:49.000000000 -0600
+++ 2.2.6.src/class/smarty/Smarty.class.php	2006-01-22 16:34:51.000000000 -0600
@@ -30,7 +30,7 @@
  * @version 2.6.5-dev
  */
 
-/* $Id: Smarty.class.php,v 1.3 2004/12/26 19:11:49 onokazu Exp $ */
+/* $Id: Smarty.class.php 184 2006-01-22 22:34:51Z skalpa $ */
 
 /**
  * DIR_SEP isn't used anymore, but third party apps might
diff -ruN 2.2.3a-Final.src/class/smarty/Smarty_Compiler.class.php 2.2.6.src/class/smarty/Smarty_Compiler.class.php
--- 2.2.3a-Final.src/class/smarty/Smarty_Compiler.class.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/smarty/Smarty_Compiler.class.php	2006-01-22 16:34:51.000000000 -0600
@@ -29,7 +29,7 @@
  * @package Smarty
  */
 
-/* $Id: Smarty_Compiler.class.php,v 1.3.6.1 2005/08/14 19:17:50 skalpa Exp $ */
+/* $Id: Smarty_Compiler.class.php 184 2006-01-22 22:34:51Z skalpa $ */
 
 /**
  * Template compiling class
diff -ruN 2.2.3a-Final.src/class/snoopy.php 2.2.6.src/class/snoopy.php
--- 2.2.3a-Final.src/class/snoopy.php	2005-07-26 01:11:47.000000000 -0500
+++ 2.2.6.src/class/snoopy.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-/// $Id: snoopy.php,v 1.3.22.2 2005/07/26 07:11:47 mithyt2 Exp $
+/// $Id: snoopy.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/tardownloader.php 2.2.6.src/class/tardownloader.php
--- 2.2.3a-Final.src/class/tardownloader.php	2003-07-08 06:38:08.000000000 -0500
+++ 2.2.6.src/class/tardownloader.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: tardownloader.php,v 1.8 2003/07/08 12:38:08 okazu Exp $
+// $Id: tardownloader.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/template.php 2.2.6.src/class/template.php
--- 2.2.3a-Final.src/class/template.php	2005-07-22 12:22:58.000000000 -0500
+++ 2.2.6.src/class/template.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: template.php,v 1.21.6.16 2005/07/22 18:22:58 mithyt2 Exp $
+// $Id: template.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/theme.php 2.2.6.src/class/theme.php
--- 2.2.3a-Final.src/class/theme.php	2005-10-29 04:50:49.000000000 -0500
+++ 2.2.6.src/class/theme.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: theme.php,v 1.1.2.17.2.4 2005/09/18 12:51:16 mithyt2 Exp $
+// $Id: theme.php 185 2006-01-22 23:49:01Z skalpa $
 /**
 * xoops.theme service definition
 *
@@ -139,45 +139,45 @@
         $GLOBALS['xoopsTpl'] =& $this->tplEngine;
         if ( $this->bufferOutput ) {
             global $xoopsConfig;
-
+            
+            /* Forced */
+            $xoopsConfig['gzip_compression'] = 0;
+            
             //if Gzip is enabled and debug is turned off
-            // DISABLED for XOOPS 2.2.3 until we figure out, why it won't work in some configurations - Mith.
-            // @TODO: Find out why gzip_compression gives blank pages
-//            if ( $xoopsConfig['gzip_compression'] == 1 && ($xoopsConfig['debug_mode'] == array(0 => 0) || $xoopsConfig['debug_mode'] == array()))
-//            {
-//                $ob_started = false;
-//                $phpver = phpversion();
-//                $useragent = ( isset( $_SERVER["HTTP_USER_AGENT"] ) ) ? $_SERVER["HTTP_USER_AGENT"] : "";
-//
-//                if ( $phpver >= '4.0.4pl1' && ( strstr( $useragent, 'compatible' ) || strstr( $useragent, 'Gecko' ) ) )
-//                {
-//                    if ( extension_loaded( 'zlib' ) ) {
-//                        ob_start( 'ob_gzhandler' );
-//                        $ob_started = true;
-//                    }
-//                }
-//                else if ( $phpver > '4.0' )
-//                {
-//                    if ( strstr( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) )
-//                    {
-//                        if ( extension_loaded( 'zlib' ) )
-//                        {
-//                            ob_start();
-//                            ob_implicit_flush( 0 );
-//                            header( 'Content-Encoding: gzip' );
-//                            $ob_started = true;
-//                        }
-//                    }
-//                }
-//                if (!$ob_started) {
-//                    ob_start();
-//                }
-//            }
-//            else
-//            {
-//                ob_start();
-//            }
-            ob_start();
+            if ( $xoopsConfig['gzip_compression'] == 1 && ($xoopsConfig['debug_mode'] == array(0 => 0) || $xoopsConfig['debug_mode'] == array()))
+            {
+                $ob_started = false;
+                $phpver = phpversion();
+                $useragent = ( isset( $_SERVER["HTTP_USER_AGENT"] ) ) ? $_SERVER["HTTP_USER_AGENT"] : "";
+
+                if ( $phpver >= '4.0.4pl1' && ( strstr( $useragent, 'compatible' ) || strstr( $useragent, 'Gecko' ) ) )
+                {
+                    if ( extension_loaded( 'zlib' ) ) {
+                        ob_start( 'ob_gzhandler' );
+                        $ob_started = true;
+                    }
+                }
+                else if ( $phpver > '4.0' )
+                {
+                    if ( strstr( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) )
+                    {
+                        if ( extension_loaded( 'zlib' ) )
+                        {
+                            ob_start();
+                            ob_implicit_flush( 0 );
+                            header( 'Content-Encoding: gzip' );
+                            $ob_started = true;
+                        }
+                    }
+                }
+                if (!$ob_started) {
+                    ob_start();
+                }
+            }
+            else
+            {
+                ob_start();
+            }
         }
 
         $this->loadGlobalVars();
@@ -413,14 +413,18 @@
         'xoops_version' => XOOPS_VERSION,
         'xoops_upload_url' => XOOPS_UPLOAD_URL));
         $this->tplEngine->assign(
-        array('xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES),
-        'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES),
-        'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
+	        array('xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES),
+	        'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES),
+	        'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
         if ($loadConfig == true) {
             // Meta tags
             $config_handler =& xoops_gethandler('config');
             $config =& $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER);
             foreach ($config as $name => $value) {
+	            // Sanitizer quote/single quote
+	            if("footer" != $name){
+	            	$value = htmlspecialchars($value, ENT_QUOTES);
+            	}
                 // prefix each tag with 'xoops_'
                 $this->tplEngine->assign('xoops_'.$name, $value);
             }
@@ -439,7 +443,7 @@
         }
         global $xoopsUser, $xoopsModule;
         // Load user variables
-        if ($xoopsUser != '') {
+        if (is_object($xoopsUser)) {
             $this->tplEngine->assign(array(   'xoops_isuser' => true,
             'xoops_userid' => $xoopsUser->getVar('uid'),
             'xoops_uname' => $xoopsUser->getVar('uname')));
@@ -496,7 +500,10 @@
         $cachegroup = isset($GLOBALS['xoopsOption']['cache_group']) ? "_".$GLOBALS['xoopsOption']['cache_group'] : "";
 
         $protocol = strtolower(substr($_SERVER['SERVER_PROTOCOL'], 0, strpos($_SERVER['SERVER_PROTOCOL'], "/", 0)));
-        return 'mod_'.$GLOBALS['xoopsModule']->getVar('dirname').'|'.md5(str_replace(XOOPS_URL, '', $protocol."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].$cachegroup));
+        //return 'mod_'.$GLOBALS['xoopsModule']->getVar('dirname').'|'.md5(str_replace(XOOPS_URL, '', $protocol."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].$cachegroup));
+        /* How could this happen? */
+        $mod_dirname = is_object($GLOBALS['xoopsModule'])? $GLOBALS['xoopsModule']->getVar('dirname'):"system";
+        return 'mod_'.$mod_dirname.'|'.md5(str_replace(XOOPS_URL, '', $protocol."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].$cachegroup));
     }
 
     /**
diff -ruN 2.2.3a-Final.src/class/tree.php 2.2.6.src/class/tree.php
--- 2.2.3a-Final.src/class/tree.php	2005-04-12 04:28:33.000000000 -0500
+++ 2.2.6.src/class/tree.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: tree.php,v 1.12.22.1 2005/04/12 10:28:33 mithyt2 Exp $
+// $Id: tree.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -219,7 +219,8 @@
             $ret .= '<option value="0"></option>';
         }
         $this->_makeSelBoxOptions($fieldName, $selected, $key, $ret, $prefix);
-        return $ret.'</select>';
+       	$ret .= '</select>';
+        return $ret;
     }
 
 
diff -ruN 2.2.3a-Final.src/class/uploader.php 2.2.6.src/class/uploader.php
--- 2.2.3a-Final.src/class/uploader.php	2005-10-27 19:42:20.000000000 -0500
+++ 2.2.6.src/class/uploader.php	2007-12-22 17:54:19.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: uploader.php,v 1.16.6.4.2.1 2005/10/28 01:42:20 skalpa Exp $
+// $Id: uploader.php 1199 2007-12-22 23:54:19Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -119,6 +119,10 @@
     var $savedFileName;
 
 	var $extensionToMime = array();
+	
+	var $extensionsToBeSanitized = array("php", "php3", "php5");
+	var $checkImageType = true;
+	
     /**
      * Constructor
      *
@@ -175,7 +179,6 @@
         } else {
             $media_name =& $_FILES[$media_name];
 			$this->mediaName = (get_magic_quotes_gpc()) ? stripslashes($media_name['name']) : $media_name['name'];
-            $this->mediaName = $media_name['name'];
             $this->mediaType = $media_name['type'];
             $this->mediaSize = $media_name['size'];
             $this->mediaTmpName = $media_name['tmp_name'];
@@ -189,13 +192,6 @@
 			}
 		}
         $this->errors = array();
-		if ( $ext && in_array( $ext, array( 'gif', 'jpg', 'jpeg', 'png', 'bmp', 'xbm' ) ) ) {
-	   		// Prevent sending of invalid images that would crash IE
-			if ( ! ( $info = getimagesize( $this->mediaTmpName ) ) ) {
-				$this->setErrors( 'Invalid file content' );
-				return false;
-			}
-		}
         if (intval($this->mediaSize) < 0) {
             $this->setErrors(_ER_UP_INVALIDFILESIZE);
             return false;
@@ -308,6 +304,8 @@
         if (!is_writeable($this->uploadDir)) {
             $this->setErrors(sprintf(_ER_UP_FAILEDOPENDIRWRITE, $this->uploadDir));
         }
+        $this->sanitizeMultipleExtensions();
+        
         if (!$this->checkMaxFileSize()) {
             $this->setErrors(sprintf(_ER_UP_FILESIZETOOLARGE, $this->mediaSize));
         }
@@ -320,11 +318,14 @@
         if (!$this->checkMimeType()) {
             $this->setErrors(sprintf(_ER_UP_MIMETYPENOTALLOWED, $this->mediaType));
         }
+        if (!$this->checkImageType()) {
+            $this->setErrors('Invalide image file');
+        }
         if (count($this->errors) > 0) {
             return false;
         }
         if (!$this->_copyFile($chmod)) {
-            $this->setErrors(sprintf(_ER_UP_FAILEDUPLOADFILE, $this->mediaName));
+            $this->setErrors(sprintf(_ER_UP_FAILEDUPLOADFILE, htmlspecialchars($this->mediaName)));
             return false;
         }
         return true;
@@ -425,6 +426,41 @@
 	}
 
     /**
+     * Check whether or not the uploaded image type is valid
+     *
+     * @return  bool
+     **/
+    function checkImageType()
+    {
+	    if(empty($this->checkImageType)) return true;
+
+        if( ("image" == substr($this->mediaType, 0, strpos($this->mediaType, "/"))) || 
+        	(!empty($this->mediaRealType) && "image" == substr($this->mediaRealType, 0, strpos($this->mediaRealType, "/")))
+        ){
+			if ( ! ( $info = @getimagesize( $this->mediaTmpName ) ) ) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+    /**
+     * Sanitize executable filename with multiple extensions
+     *
+     **/
+    function sanitizeMultipleExtensions()
+    {
+	    if(empty($this->extensionsToBeSanitized)) return;
+	    $patterns = array();
+	    $replaces = array();
+	    foreach($this->extensionsToBeSanitized as $ext){
+		    $patterns[] = "/\.".preg_quote($ext)."\./i";
+		    $replaces[] = "_".$ext.".";
+	    }
+        $this->mediaName = preg_replace($patterns, $replaces, $this->mediaName);
+	}
+
+    /**
      * Add an error
      * 
      * @param   string  $error
diff -ruN 2.2.3a-Final.src/class/xml/rpc/bloggerapi.php 2.2.6.src/class/xml/rpc/bloggerapi.php
--- 2.2.3a-Final.src/class/xml/rpc/bloggerapi.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xml/rpc/bloggerapi.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: bloggerapi.php,v 1.7.6.3 2005/08/14 19:17:50 skalpa Exp $
+// $Id: bloggerapi.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xml/rpc/metaweblogapi.php 2.2.6.src/class/xml/rpc/metaweblogapi.php
--- 2.2.3a-Final.src/class/xml/rpc/metaweblogapi.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xml/rpc/metaweblogapi.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: metaweblogapi.php,v 1.7.22.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: metaweblogapi.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xml/rpc/movabletypeapi.php 2.2.6.src/class/xml/rpc/movabletypeapi.php
--- 2.2.3a-Final.src/class/xml/rpc/movabletypeapi.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xml/rpc/movabletypeapi.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: movabletypeapi.php,v 1.6.22.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: movabletypeapi.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xml/rpc/xmlrpcapi.php 2.2.6.src/class/xml/rpc/xmlrpcapi.php
--- 2.2.3a-Final.src/class/xml/rpc/xmlrpcapi.php	2005-07-01 08:00:36.000000000 -0500
+++ 2.2.6.src/class/xml/rpc/xmlrpcapi.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xmlrpcapi.php,v 1.8.4.1.2.3 2005/07/01 14:00:36 mithyt2 Exp $
+// $Id: xmlrpcapi.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xml/rpc/xmlrpcparser.php 2.2.6.src/class/xml/rpc/xmlrpcparser.php
--- 2.2.3a-Final.src/class/xml/rpc/xmlrpcparser.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xml/rpc/xmlrpcparser.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xmlrpcparser.php,v 1.5.22.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: xmlrpcparser.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -43,7 +43,7 @@
 * @package   XOOPS
 * @copyright Copyright (c) 2001 xoops.org. All rights reserved.
 * @author    Kazumi Ono <onokazu@xoops.org>
-* @version   1.6 ($Date: 2005/08/14 19:17:50 $) $Revision: 1.5.22.1 $
+* @version   1.6 ($Date: 2006-01-22 17:34:51 -0500 (Sun, 22 Jan 2006) $) $Revision: 184 $
 * @access    public
 */
 
diff -ruN 2.2.3a-Final.src/class/xml/rpc/xmlrpctag.php 2.2.6.src/class/xml/rpc/xmlrpctag.php
--- 2.2.3a-Final.src/class/xml/rpc/xmlrpctag.php	2003-02-19 10:01:01.000000000 -0600
+++ 2.2.6.src/class/xml/rpc/xmlrpctag.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xmlrpctag.php,v 1.6 2003/02/19 16:01:01 okazu Exp $
+// $Id: xmlrpctag.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xml/rpc/xoopsapi.php 2.2.6.src/class/xml/rpc/xoopsapi.php
--- 2.2.3a-Final.src/class/xml/rpc/xoopsapi.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xml/rpc/xoopsapi.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopsapi.php,v 1.10.6.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: xoopsapi.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xml/rss/xmlrss2parser.php 2.2.6.src/class/xml/rss/xmlrss2parser.php
--- 2.2.3a-Final.src/class/xml/rss/xmlrss2parser.php	2005-09-19 18:57:43.000000000 -0500
+++ 2.2.6.src/class/xml/rss/xmlrss2parser.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xmlrss2parser.php,v 1.6.22.3.2.1 2005/09/20 00:57:43 skalpa Exp $
+// $Id: xmlrss2parser.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xml/saxparser.php 2.2.6.src/class/xml/saxparser.php
--- 2.2.3a-Final.src/class/xml/saxparser.php	2005-05-09 11:31:32.000000000 -0500
+++ 2.2.6.src/class/xml/saxparser.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: saxparser.php,v 1.9.22.4 2005/05/09 17:31:32 mithyt2 Exp $
+// $Id: saxparser.php 185 2006-01-22 23:49:01Z skalpa $
 /*******************************************************************************
     Location: <b>xml/SaxParser.class</b><br>
      <br>
@@ -160,8 +160,11 @@
     {
         xml_parser_free($this->parser);
 
-        unset($this);
-        // $this = null; // for PHP5 compatibility
+        if (!method_exists($this, '__destruct')) {
+             unset($this);
+        } else {
+            $this->__destruct();
+        }
     }
 
     /****************************************************************************
diff -ruN 2.2.3a-Final.src/class/xml/themesetparser.php 2.2.6.src/class/xml/themesetparser.php
--- 2.2.3a-Final.src/class/xml/themesetparser.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xml/themesetparser.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: themesetparser.php,v 1.5.22.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: themesetparser.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xml/xmltaghandler.php 2.2.6.src/class/xml/xmltaghandler.php
--- 2.2.3a-Final.src/class/xml/xmltaghandler.php	2003-02-12 05:34:52.000000000 -0600
+++ 2.2.6.src/class/xml/xmltaghandler.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xmltaghandler.php,v 1.5 2003/02/12 11:34:52 okazu Exp $
+// $Id: xmltaghandler.php 184 2006-01-22 22:34:51Z skalpa $
 /*******************************************************************************
     Location: <b>xml/XmlTagHandler</b><br>
      <br>
diff -ruN 2.2.3a-Final.src/class/xoopsblock.php 2.2.6.src/class/xoopsblock.php
--- 2.2.3a-Final.src/class/xoopsblock.php	2005-05-27 08:59:52.000000000 -0500
+++ 2.2.6.src/class/xoopsblock.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopsblock.php,v 1.19.20.2.2.3 2005/05/27 14:59:52 mithyt2 Exp $
+// $Id: xoopsblock.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopscomments.php 2.2.6.src/class/xoopscomments.php
--- 2.2.3a-Final.src/class/xoopscomments.php	2005-07-19 12:14:30.000000000 -0500
+++ 2.2.6.src/class/xoopscomments.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopscomments.php,v 1.13.6.4 2005/07/19 18:14:30 mithyt2 Exp $
+// $Id: xoopscomments.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -99,11 +99,19 @@
 		if ( empty($comment_id) ) {
 			$comment_id = $this->db->getInsertId();
 		}
-		if ( $isnew != false ) {
-			$sql = sprintf("UPDATE %s SET posts = posts+1 WHERE uid = %u", $this->db->prefix("users"), $user_id);
-			if (!$result = $this->db->query($sql)) {
-				echo "Could not update user posts.";
-			}
+		if ( $isnew != false && $user_id >0) {
+			if(is_object($GLOBALS["xoopsUser"]) && $user_id == $GLOBALS["xoopsUser"]->getVar("uid")){
+				$poster =& $GLOBALS["xoopsUser"];
+			}else{
+		        $member_handler =& xoops_gethandler("member");
+		        $poster =& $member_handler->getUser($user_id);
+	        }
+	        if (is_object($poster)) {
+		        $poster->setVar("posts", $poster->getVar("posts") + 1);
+		        if(!$res = $member_handler->insertUser($poster, true)){
+			        xoops_error($poster->getHtmlErrors());
+		        }
+	        }
 		}
 		return $comment_id;
 	}
@@ -126,11 +134,20 @@
 				$sql = sprintf("DELETE FROM %s WHERE comment_bid = %u", $this->ctable, $arr[$i]['comment_id']);
 				if ( !$result = $this->db->query($sql) ) {
 					echo "Could not delete comment.";
+					continue;
 				}
-				$sql = sprintf("UPDATE %s SET posts = posts-1 WHERE uid = %u", $this->db->prefix("users"), $arr[$i]['user_id']);
-				if ( !$result = $this->db->query($sql) ) {
-					echo "Could not update user posts.";
-				}
+				if(is_object($GLOBALS["xoopsUser"]) && $arr[$i]["user_id"] == $GLOBALS["xoopsUser"]->getVar("uid")){
+					$poster =& $GLOBALS["xoopsUser"];
+				}else{
+			        $member_handler =& xoops_gethandler("member");
+			        $poster =& $member_handler->getUser($arr[$i]["user_id"]);
+		        }
+		        if (is_object($poster)) {
+			        $poster->setVar("posts", $poster->getVar("posts") - 1);
+			        if(!$res = $member_handler->insertUser($poster, true)){
+				        xoops_error($poster->getHtmlErrors());
+			        }
+		        }
 			}
 		}
 		return ($size + 1);
@@ -294,12 +311,12 @@
 				$icq_image = "";
 			}
 			if ( $poster->getVar("user_aim") != "" ) {
-				$aim_image = "<a href='aim:goim?screenname=".$poster->getVar("user_aim", "E")."&message=Hi+".$poster->getVar("user_aim")."+Are+you+there?'><img src='".XOOPS_URL."/images/icons/aim.gif' alt='aim' /></a>";
+				$aim_image = "<a href='aim:goim?screenname=".$poster->getVar("user_aim", "E")."&amp;message=Hi+".$poster->getVar("user_aim")."+Are+you+there?'><img src='".XOOPS_URL."/images/icons/aim.gif' alt='aim' /></a>";
 			} else {
 				$aim_image = "";
 			}
    			if ( $poster->getVar("user_yim") != "" ) {
-				$yim_image = "<a href='http://edit.yahoo.com/config/send_webmesg?.target=".$poster->getVar("user_yim", "E")."&.src=pg'><img src='".XOOPS_URL."/images/icons/yim.gif' alt='yim' /></a>";
+				$yim_image = "<a href='http://edit.yahoo.com/config/send_webmesg?.target=".$poster->getVar("user_yim", "E")."&amp;.src=pg'><img src='".XOOPS_URL."/images/icons/yim.gif' alt='yim' /></a>";
 			} else {
 				$yim_image = "";
 			}
diff -ruN 2.2.3a-Final.src/class/xoopseditor/dhtmltextarea/dhtmltextarea.php 2.2.6.src/class/xoopseditor/dhtmltextarea/dhtmltextarea.php
--- 2.2.3a-Final.src/class/xoopseditor/dhtmltextarea/dhtmltextarea.php	2005-08-12 12:07:28.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/dhtmltextarea/dhtmltextarea.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: dhtmltextarea.php,v 1.1.2.4 2005/08/12 18:07:28 mithyt2 Exp $
+// $Id: dhtmltextarea.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopseditor/dhtmltextarea/editor_registry.php 2.2.6.src/class/xoopseditor/dhtmltextarea/editor_registry.php
--- 2.2.3a-Final.src/class/xoopseditor/dhtmltextarea/editor_registry.php	2005-06-04 07:42:05.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/dhtmltextarea/editor_registry.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: editor_registry.php,v 1.1.2.2 2005/06/04 13:42:05 phppp Exp $
+// $Id: editor_registry.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -37,9 +37,8 @@
 if ( DIRECTORY_SEPARATOR != "/" ) $current_path = str_replace( strpos( $current_path, "\\\\", 2 ) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
 $root_path = dirname($current_path);
 
-if(file_exists($root_path."/language/".$xoopsConfig['language'].".php")){
-	include_once($root_path."/language/".$xoopsConfig['language'].".php");
-}else{
+$xoopsConfig['language'] = preg_replace("/[^a-z0-9_\-]/i", "", $xoopsConfig['language']);
+if(!@include_once($root_path."/language/".$xoopsConfig['language'].".php")){
 	include_once($root_path."/language/english.php");
 }
 
diff -ruN 2.2.3a-Final.src/class/xoopseditor/dhtmltextarea/language/english.php 2.2.6.src/class/xoopseditor/dhtmltextarea/language/english.php
--- 2.2.3a-Final.src/class/xoopseditor/dhtmltextarea/language/english.php	2005-06-03 20:11:51.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/dhtmltextarea/language/english.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: english.php,v 1.1.2.1 2005/06/04 02:11:51 phppp Exp $
+// $Id: english.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopseditor/koivi/class/borderfieldset.class.php 2.2.6.src/class/xoopseditor/koivi/class/borderfieldset.class.php
--- 2.2.3a-Final.src/class/xoopseditor/koivi/class/borderfieldset.class.php	2005-06-03 20:11:51.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/koivi/class/borderfieldset.class.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: borderfieldset.class.php,v 1.1.2.1 2005/06/04 02:11:51 phppp Exp $
+// $Id: borderfieldset.class.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopseditor/koivi/class/colorpalette.class.php 2.2.6.src/class/xoopseditor/koivi/class/colorpalette.class.php
--- 2.2.3a-Final.src/class/xoopseditor/koivi/class/colorpalette.class.php	2005-06-03 20:11:51.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/koivi/class/colorpalette.class.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: colorpalette.class.php,v 1.1.2.1 2005/06/04 02:11:51 phppp Exp $
+// $Id: colorpalette.class.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopseditor/koivi/dialogs.php 2.2.6.src/class/xoopseditor/koivi/dialogs.php
--- 2.2.3a-Final.src/class/xoopseditor/koivi/dialogs.php	2005-10-01 06:50:58.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/koivi/dialogs.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: dialogs.php,v 1.1.2.2.2.1 2005/10/01 12:50:58 mithyt2 Exp $
+// $Id: dialogs.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -74,7 +74,7 @@
 	include_once(XOOPS_ROOT_PATH.''.$url.'/language/english.php');
 }
 
-echo "<!DOCTYPE html PUBLIC '//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
+echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
 echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'._LANGCODE.'" lang="'._LANGCODE.'">';
 echo '<head>';
 echo '<meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" />';
diff -ruN 2.2.3a-Final.src/class/xoopseditor/koivi/editor_registry.php 2.2.6.src/class/xoopseditor/koivi/editor_registry.php
--- 2.2.3a-Final.src/class/xoopseditor/koivi/editor_registry.php	2005-06-03 20:11:51.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/koivi/editor_registry.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: editor_registry.php,v 1.1.2.1 2005/06/04 02:11:51 phppp Exp $
+// $Id: editor_registry.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -37,9 +37,8 @@
 if ( DIRECTORY_SEPARATOR != "/" ) $current_path = str_replace( strpos( $current_path, "\\\\", 2 ) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
 $root_path = dirname($current_path);
 
-if(file_exists($root_path."/language/".$xoopsConfig['language'].".php")){
-	include_once($root_path."/language/".$xoopsConfig['language'].".php");
-}else{
+$xoopsConfig['language'] = preg_replace("/[^a-z0-9_\-]/i", "", $xoopsConfig['language']);
+if(!@include_once($root_path."/language/".$xoopsConfig['language'].".php")){
 	include_once($root_path."/language/english.php");
 }
 
diff -ruN 2.2.3a-Final.src/class/xoopseditor/koivi/formwysiwygtextarea.php 2.2.6.src/class/xoopseditor/koivi/formwysiwygtextarea.php
--- 2.2.3a-Final.src/class/xoopseditor/koivi/formwysiwygtextarea.php	2005-08-14 16:08:10.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/koivi/formwysiwygtextarea.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php 
-// $Id: formwysiwygtextarea.php,v 1.1.2.6 2005/08/14 22:08:10 phppp Exp $
+// $Id: formwysiwygtextarea.php 184 2006-01-22 22:34:51Z skalpa $
 // ------------------------------------------------------------------------ //
 // XOOPS - PHP Content Management System                      				//
 // Copyright (c) 2000 XOOPS.org                           					//
diff -ruN 2.2.3a-Final.src/class/xoopseditor/koivi/include/functions.inc.php 2.2.6.src/class/xoopseditor/koivi/include/functions.inc.php
--- 2.2.3a-Final.src/class/xoopseditor/koivi/include/functions.inc.php	2005-10-01 06:50:58.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/koivi/include/functions.inc.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: functions.inc.php,v 1.1.2.2.2.1 2005/10/01 12:50:58 mithyt2 Exp $
+// $Id: functions.inc.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -88,7 +88,7 @@
 	else return $comp;
 }*/
 
-function CheckBrowser($get_isie=true)
+function checkBrowser($get_isie=true)
 {
 	global $_SERVER;
 
diff -ruN 2.2.3a-Final.src/class/xoopseditor/koivi/language/english.php 2.2.6.src/class/xoopseditor/koivi/language/english.php
--- 2.2.3a-Final.src/class/xoopseditor/koivi/language/english.php	2005-06-03 20:11:53.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/koivi/language/english.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: english.php,v 1.1.2.1 2005/06/04 02:11:53 phppp Exp $
+// $Id: english.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopseditor/koivi/preferences.php 2.2.6.src/class/xoopseditor/koivi/preferences.php
--- 2.2.3a-Final.src/class/xoopseditor/koivi/preferences.php	2005-06-03 20:11:51.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/koivi/preferences.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: preferences.php,v 1.1.2.1 2005/06/04 02:11:51 phppp Exp $
+// $Id: preferences.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopseditor/koivi/skins/default/default.css 2.2.6.src/class/xoopseditor/koivi/skins/default/default.css
--- 2.2.3a-Final.src/class/xoopseditor/koivi/skins/default/default.css	2005-06-03 20:11:54.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/koivi/skins/default/default.css	2006-01-22 16:34:51.000000000 -0600
@@ -1,4 +1,4 @@
-/*	Samuel's Xoops XK_Editor $Id: default.css,v 1.1.2.1 2005/06/04 02:11:54 phppp Exp $*/
+/*	Samuel's Xoops XK_Editor $Id: default.css 184 2006-01-22 22:34:51Z skalpa $*/
 .defaultwIframe {width:100%;border-top:1px solid #C0C0C0;margin:0;padding:0;font:Tahoma;background:#FFF}
 .defaulteditorStatus {text-align:right;margin:2px;float:right;display:inline}
 .defaulteditorStatus img {border:1px outset #C3DAF9}
diff -ruN 2.2.3a-Final.src/class/xoopseditor/koivi/skins/xp/xp.css 2.2.6.src/class/xoopseditor/koivi/skins/xp/xp.css
--- 2.2.3a-Final.src/class/xoopseditor/koivi/skins/xp/xp.css	2005-06-03 20:11:55.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/koivi/skins/xp/xp.css	2006-01-22 16:34:51.000000000 -0600
@@ -1,4 +1,4 @@
-/*Samuel's Xoops XK_Editor $Id: xp.css,v 1.1.2.1 2005/06/04 02:11:55 phppp Exp $*/
+/*Samuel's Xoops XK_Editor $Id: xp.css 184 2006-01-22 22:34:51Z skalpa $*/
 .xpwIframe{width:100%;border:none;margin:0px;padding:0px;background:#FFFFFF}
 .xpeditorStatus{margin:1px;float:right;display:inline;text-align:right}
 .xpeditorStatus img{border:1px outset #C3DAF9}
diff -ruN 2.2.3a-Final.src/class/xoopseditor/sampleform.inc.php 2.2.6.src/class/xoopseditor/sampleform.inc.php
--- 2.2.3a-Final.src/class/xoopseditor/sampleform.inc.php	2005-07-14 10:13:31.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/sampleform.inc.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: sampleform.inc.php,v 1.1.2.4 2005/07/14 16:13:31 phppp Exp $
+// $Id: sampleform.inc.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopseditor/textarea/editor_registry.php 2.2.6.src/class/xoopseditor/textarea/editor_registry.php
--- 2.2.3a-Final.src/class/xoopseditor/textarea/editor_registry.php	2005-06-04 07:42:05.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/textarea/editor_registry.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: editor_registry.php,v 1.1.2.2 2005/06/04 13:42:05 phppp Exp $
+// $Id: editor_registry.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -37,9 +37,8 @@
 if ( DIRECTORY_SEPARATOR != "/" ) $current_path = str_replace( strpos( $current_path, "\\\\", 2 ) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
 $root_path = dirname($current_path);
 
-if(file_exists($root_path."/language/".$xoopsConfig['language'].".php")){
-	include_once($root_path."/language/".$xoopsConfig['language'].".php");
-}else{
+$xoopsConfig['language'] = preg_replace("/[^a-z0-9_\-]/i", "", $xoopsConfig['language']);
+if(!@include_once($root_path."/language/".$xoopsConfig['language'].".php")){
 	include_once($root_path."/language/english.php");
 }
 
diff -ruN 2.2.3a-Final.src/class/xoopseditor/textarea/language/english.php 2.2.6.src/class/xoopseditor/textarea/language/english.php
--- 2.2.3a-Final.src/class/xoopseditor/textarea/language/english.php	2005-06-03 20:11:55.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/textarea/language/english.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: english.php,v 1.1.2.1 2005/06/04 02:11:55 phppp Exp $
+// $Id: english.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopseditor/textarea/textarea.php 2.2.6.src/class/xoopseditor/textarea/textarea.php
--- 2.2.3a-Final.src/class/xoopseditor/textarea/textarea.php	2005-08-12 12:07:28.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/textarea/textarea.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: textarea.php,v 1.1.2.4 2005/08/12 18:07:28 mithyt2 Exp $
+// $Id: textarea.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopseditor/xoopseditor.php 2.2.6.src/class/xoopseditor/xoopseditor.php
--- 2.2.3a-Final.src/class/xoopseditor/xoopseditor.php	2005-07-15 16:55:57.000000000 -0500
+++ 2.2.6.src/class/xoopseditor/xoopseditor.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopseditor.php,v 1.1.2.4 2005/07/15 22:55:57 phppp Exp $
+// $Id: xoopseditor.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsform/formbutton.php 2.2.6.src/class/xoopsform/formbutton.php
--- 2.2.3a-Final.src/class/xoopsform/formbutton.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formbutton.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formbutton.php,v 1.8.26.2 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formbutton.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -85,10 +85,11 @@
 	/**
 	 * Get the initial value
 	 *
+	 * @param	bool    $encode To sanitizer the text?
      * @return	string
 	 */
-	function getValue(){
-		return $this->_value;
+	function getValue($encode = false) {
+		return $encode ? htmlspecialchars($this->_value, ENT_QUOTES) : $this->_value;
 	}
 
 	/**
@@ -106,7 +107,7 @@
      * @return	string
 	 */
 	function getType(){
-		return $this->_type;
+		return in_array( strtolower($this->_type), array("button", "submit", "reset") ) ? $this->_type : "button";
 	}
 
 	/**
diff -ruN 2.2.3a-Final.src/class/xoopsform/formcalendar.php 2.2.6.src/class/xoopsform/formcalendar.php
--- 2.2.3a-Final.src/class/xoopsform/formcalendar.php	2005-08-12 12:07:28.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formcalendar.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formcalendar.php,v 1.1.2.7 2005/08/12 18:07:28 mithyt2 Exp $
+// $Id: formcalendar.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsform/formcheckbox.php 2.2.6.src/class/xoopsform/formcheckbox.php
--- 2.2.3a-Final.src/class/xoopsform/formcheckbox.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formcheckbox.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formcheckbox.php,v 1.7.26.2 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formcheckbox.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -81,19 +81,27 @@
 
 	/**
 	 * Get the "value"
-	 * 
+	 *
+	 * @param	bool    $encode To sanitizer the text?
      * @return	array
 	 */
-	function getValue(){
-		return $this->_value;
+	function getValue($encode = false) {
+    	if (!$encode) {
+        	return $this->_value;
+    	}
+    	$value = array();
+    	foreach ($this->_value as $val) {
+		    $value[] = $val ? htmlspecialchars($val, ENT_QUOTES) : $val;
+    	}
+    	return $value;
 	}
 
 	/**
 	 * Set the "value"
-	 * 
+	 *
      * @param	array
 	 */
-	function setValue($value){
+	function setValue($value) {
 		$this->_value = array();
 		if (is_array($value)) {
 			foreach ($value as $v) {
@@ -106,11 +114,11 @@
 
 	/**
 	 * Add an option
-	 * 
-     * @param	string  $value  
-     * @param	string  $name   
+	 *
+     * @param	string  $value
+     * @param	string  $name
 	 */
-	function addOption($value, $name=""){
+	function addOption($value, $name = "") {
 		if ($name != "") {
 			$this->_options[$value] = $name;
 		} else {
@@ -120,12 +128,12 @@
 
 	/**
 	 * Add multiple Options at once
-	 * 
+	 *
      * @param	array   $options    Associative array of value->name pairs
 	 */
-	function addOptionArray($options){
+	function addOptionArray($options) {
 		if ( is_array($options) ) {
-			foreach ( $options as $k=>$v ) {
+			foreach ( $options as $k => $v ) {
 				$this->addOption($k, $v);
 			}
 		}
@@ -133,11 +141,19 @@
 
 	/**
 	 * Get an array with all the options
-	 * 
+	 *
+	 * @param	int     $encode     To sanitizer the text? potential values: 0 - skip; 1 - only for value; 2 - for both value and name
      * @return	array   Associative array of value->name pairs
 	 */
-	function getOptions(){
-		return $this->_options;
+	function getOptions($encode = false) {
+    	if (!$encode) {
+        	return $this->_options;
+    	}
+    	$value = array();
+    	foreach ($this->_options as $val => $name) {
+		    $value[ $encode ? htmlspecialchars($val, ENT_QUOTES) : $val ] = ($encode > 1) ? htmlspecialchars($name, ENT_QUOTES) : $name;
+    	}
+    	return $value;
 	}
 
 	/**
@@ -154,7 +170,7 @@
 		}
 		$i = 0;
 		foreach ( $this->getOptions() as $value => $name ) {
-			$ret .= "<input type='checkbox' id='".$id.$i."' name='".$this->getName()."' value='".$value."'";
+			$ret .= "<input type='checkbox' id='".$id.$i."' name='".$this->getName()."' value='".htmlspecialchars($value, ENT_QUOTES)."'";
 			if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) {
 				$ret .= " checked='checked'";
 			}
diff -ruN 2.2.3a-Final.src/class/xoopsform/formdatetime.php 2.2.6.src/class/xoopsform/formdatetime.php
--- 2.2.3a-Final.src/class/xoopsform/formdatetime.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formdatetime.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formdatetime.php,v 1.1.26.2 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formdatetime.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsform/formdhtmltextarea.php 2.2.6.src/class/xoopsform/formdhtmltextarea.php
--- 2.2.3a-Final.src/class/xoopsform/formdhtmltextarea.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formdhtmltextarea.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formdhtmltextarea.php,v 1.13.16.3 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formdhtmltextarea.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsform/formeditor.php 2.2.6.src/class/xoopsform/formeditor.php
--- 2.2.3a-Final.src/class/xoopsform/formeditor.php	2005-07-14 10:13:33.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formeditor.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formeditor.php,v 1.1.2.1 2005/07/14 16:13:33 phppp Exp $
+// $Id: formeditor.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsform/formelement.php 2.2.6.src/class/xoopsform/formelement.php
--- 2.2.3a-Final.src/class/xoopsform/formelement.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formelement.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formelement.php,v 1.11.6.2 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formelement.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -81,10 +81,10 @@
 	var $_accesskey = '';
 
 	/**
-	 * HTML class for this element
-	 * @var	string
+	 * HTML classes for this element
+	 * @var	array
 	 */
-	var $_class = '';
+	var $_class = array();
 
 	/**
 	 * hidden?
@@ -94,9 +94,9 @@
 
 	/**
 	 * extra attributes to go in the tag
-	 * @var	string
+	 * @var	array
 	 */
-	var $_extra = "";
+	var $_extra = array();
 
 	/**
 	 * required field?
@@ -145,9 +145,9 @@
 	 * @param	bool    encode?
 	 * @return	string  "name" attribute
 	 */
-	function getName($encode=true) {
+	function getName($encode = true) {
 		if (false != $encode) {
-			return str_replace("&amp;", "&", str_replace("'","&#039;",htmlspecialchars($this->_name)));
+			return str_replace("&amp;", "&", htmlspecialchars($this->_name, ENT_QUOTES));
 		}
 		return $this->_name;
 	}
@@ -177,9 +177,9 @@
 	function getAccessString( $str ) {
 		$access = $this->getAccessKey();
 		if ( !empty($access) && ( false !== ($pos = strpos($str, $access)) ) ) {
-			return substr($str, 0, $pos) . '<span style="text-decoration:underline">' . substr($str, $pos, 1) . '</span>' . substr($str, $pos+1);
+			return htmlspecialchars(substr($str, 0, $pos), ENT_QUOTES) . '<span style="text-decoration:underline">' . htmlspecialchars(substr($str, $pos, 1), ENT_QUOTES) . '</span>' . htmlspecialchars(substr($str, $pos+1), ENT_QUOTES);
 		}
-		return $str;
+		return htmlspecialchars($str, ENT_QUOTES);
 	}
 
 	/**
@@ -189,10 +189,8 @@
 	 */
 	function setClass($class) {
 		$class = trim($class);
-		if ( empty($class) ) {
-			$this->_class = '';
-		} else {
-			$this->_class .= (empty($this->_class) ? '' : ' ') . $class;
+		if ( !empty($class) ) {
+            $this->_class[] = $class;
 		}
 	}
 	/**
@@ -201,7 +199,12 @@
 	 * @return 	string  "class" attribute value
 	 */
 	function getClass() {
-		return $this->_class;
+    	if( empty($this->_class) ) return '';
+    	$class = array();
+    	foreach ($this->_class as $class) {
+        	$class[] = htmlspecialchars($class, ENT_QUOTES);
+    	}
+		return implode(" ", $class);
 	}
 
 	/**
@@ -216,10 +219,11 @@
 	/**
 	 * get the caption for the element
 	 *
+	 * @param	bool    $encode To sanitizer the text?
 	 * @return	string
 	 */
-	function getCaption() {
-		return $this->_caption;
+	function getCaption($encode = false) {
+		return $encode ? htmlspecialchars($this->_caption, ENT_QUOTES) : $this->_caption;
 	}
 	
 	/**
@@ -252,10 +256,11 @@
 	/**
 	 * get the element's description
 	 *
+	 * @param	bool    $encode To sanitizer the text?
 	 * @return	string
 	 */
-	function getDescription() {
-		return $this->_description;
+	function getDescription($encode = false) {
+		return $encode ? htmlspecialchars($this->_description, ENT_QUOTES) : $this->_description;
 	}
 
 	/**
@@ -283,13 +288,13 @@
 	 *
 	 * @param	string  $extra
 	 * @param   string  $replace If true, passed string will replace current content otherwise it will be appended to it
-	 * @return	string New content of the extra string
+	 * @return	array   New content of the extra string
 	 */
-	function setExtra($extra, $replace = false){
+	function setExtra($extra, $replace = false) {
 		if ( $replace) {
-			$this->_extra = trim($extra);
+			$this->_extra = array( trim($extra) );
 		} else {
-			$this->_extra .= " " . trim($extra);
+			$this->_extra[] = trim($extra);
 		}
 		return $this->_extra;
 	}
@@ -297,12 +302,18 @@
 	/**
 	 * Get the extra attributes for the element
 	 *
+	 * @param	bool    $encode To sanitizer the text?
 	 * @return	string
 	 */
-	function getExtra(){
-		if (isset($this->_extra)) {
-			return $this->_extra;
-		}
+	function getExtra($encode = false) {
+    	if (!$encode) {
+        	return implode(' ', $this->_extra);
+    	}
+    	$value = array();
+    	foreach ($this->_extra as $val) {
+		    $value[] = str_replace('>', '&gt;', str_replace('<', '&lt;', $val));
+    	}
+    	return empty($value) ? "" : " ".implode(' ', $value);
 	}
 
 	/**
diff -ruN 2.2.3a-Final.src/class/xoopsform/formelementtray.php 2.2.6.src/class/xoopsform/formelementtray.php
--- 2.2.3a-Final.src/class/xoopsform/formelementtray.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formelementtray.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formelementtray.php,v 1.14.16.3 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formelementtray.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -166,10 +166,11 @@
 	/**
 	 * Get the delimiter of this group
 	 * 
+	 * @param	bool    $encode To sanitizer the text?
      * @return	string  The delimiter
 	 */
-	function getDelimeter(){
-		return $this->_delimeter;
+	function getDelimeter($encode = false) {
+		return $encode ? htmlspecialchars(str_replace('&nbsp;', ' ', $this->_delimeter)) : $this->_delimeter;
 	}
 
 	/**
diff -ruN 2.2.3a-Final.src/class/xoopsform/formfile.php 2.2.6.src/class/xoopsform/formfile.php
--- 2.2.3a-Final.src/class/xoopsform/formfile.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formfile.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formfile.php,v 1.6.26.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formfile.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -86,7 +86,7 @@
 	 * @return	string	HTML
 	 */
 	function render(){
-		return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."' /><input type='file' name='".$this->getName()."' id='".$this->getName()."'".$this->getExtra()." /><input type='hidden' name='xoops_upload_file[]' id='xoops_upload_file[]' value='".$this->getName()."' />";
+		return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."' /><input type='file' name='".$this->getName()."' id='".$this->getName()."' ".$this->getExtra()." /><input type='hidden' name='xoops_upload_file[]' id='xoops_upload_file[]' value='".$this->getName()."' />";
 	}
 }
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/class/xoopsform/formhidden.php 2.2.6.src/class/xoopsform/formhidden.php
--- 2.2.3a-Final.src/class/xoopsform/formhidden.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formhidden.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formhidden.php,v 1.7.26.2 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formhidden.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -73,10 +73,11 @@
 	/**
 	 * Get the "value" attribute
 	 * 
+	 * @param	bool    $encode To sanitizer the text?
 	 * @return	string
 	 */
-	function getValue(){
-		return $this->_value;
+	function getValue($encode = false) {
+		return $encode ? htmlspecialchars($this->_value, ENT_QUOTES) : $this->_value;
 	}
 
 	/**
@@ -84,7 +85,7 @@
 	 * 
 	 * @patam  $value	string
 	 */
-	function setValue($value){
+	function setValue($value) {
 		$this->_value = $value;
 	}
 
diff -ruN 2.2.3a-Final.src/class/xoopsform/formhiddentoken.php 2.2.6.src/class/xoopsform/formhiddentoken.php
--- 2.2.3a-Final.src/class/xoopsform/formhiddentoken.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formhiddentoken.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formhiddentoken.php,v 1.1.4.3 2005/08/14 19:17:50 skalpa Exp $ //  ------------------------------------------------------------------------ //
+// $Id: formhiddentoken.php 184 2006-01-22 22:34:51Z skalpa $ //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
 //                       <http://www.xoops.org/>                             //
diff -ruN 2.2.3a-Final.src/class/xoopsform/formlabel.php 2.2.6.src/class/xoopsform/formlabel.php
--- 2.2.3a-Final.src/class/xoopsform/formlabel.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formlabel.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formlabel.php,v 1.6.26.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formlabel.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -68,12 +68,13 @@
 	}
 
 	/**
-	 * Get the text
+	 * Get the "value" attribute
 	 * 
+	 * @param	bool    $encode To sanitizer the text?
 	 * @return	string
 	 */
-	function getValue(){
-		return $this->_value;
+	function getValue($encode = false) {
+		return $encode ? htmlspecialchars($this->_value, ENT_QUOTES) : $this->_value;
 	}
 
 	/**
@@ -81,7 +82,7 @@
 	 * 
 	 * @return	string
 	 */
-	function render(){
+	function render() {
 		return $this->getValue();
 	}
 }
diff -ruN 2.2.3a-Final.src/class/xoopsform/formpassword.php 2.2.6.src/class/xoopsform/formpassword.php
--- 2.2.3a-Final.src/class/xoopsform/formpassword.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formpassword.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formpassword.php,v 1.7.26.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formpassword.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -104,17 +104,18 @@
 	 * 
 	 * @return	int
 	 */
-	function getMaxlength(){
+	function getMaxlength() {
 		return $this->_maxlength;
 	}
 
 	/**
-	 * Get the initial value
+	 * Get the "value" attribute
 	 * 
+	 * @param	bool    $encode To sanitizer the text?
 	 * @return	string
 	 */
-	function getValue(){
-		return $this->_value;
+	function getValue($encode = false) {
+		return $encode ? htmlspecialchars($this->_value, ENT_QUOTES) : $this->_value;
 	}
 
 	/**
@@ -132,7 +133,7 @@
 	 * @return	string	HTML
 	 */
 	function render(){
-		return "<input type='password' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra()." />";
+		return "<input type='password' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."' ".$this->getExtra()." />";
 	}
 }
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/class/xoopsform/form.php 2.2.6.src/class/xoopsform/form.php
--- 2.2.3a-Final.src/class/xoopsform/form.php	2005-07-19 05:37:19.000000000 -0500
+++ 2.2.6.src/class/xoopsform/form.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: form.php,v 1.16.4.2.2.8 2005/07/19 11:37:19 phppp Exp $
+// $Id: form.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -28,7 +28,7 @@
 // URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
 // Project: The XOOPS Project                                                //
 // ------------------------------------------------------------------------- //
-// public abstruct
+// public abstract
 /**
  * 
  * 
@@ -36,7 +36,8 @@
  * @subpackage  form
  * 
  * @author	    Kazumi Ono	<onokazu@xoops.org>
- * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * @author	    Taiwen Jiang    <phppp@users.sourceforge.net>
+ * @copyright	copyright (c) 2000-2007 XOOPS.org
  */
 
 
@@ -44,7 +45,8 @@
  * Abstract base class for forms
  * 
  * @author	Kazumi Ono	<onokazu@xoops.org>
- * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * @author  Taiwen Jiang    <phppp@users.sourceforge.net>
+ * @copyright	copyright (c) 2000-2007 XOOPS.org
  * 
  * @package     kernel
  * @subpackage  form
@@ -85,9 +87,9 @@
 
 	/**
      * extra information for the <form> tag
-	 * @var string  
+	 * @var array  
 	 */
-	var $_extra;
+	var $_extra = array();
 
 	/**
      * required elements
@@ -121,28 +123,33 @@
 	/**
 	 * return the title of the form
      * 
+	 * @param	bool    $encode To sanitizer the text?
      * @return	string
 	 */
-	function getTitle(){
-		return $this->_title;
+	function getTitle($encode = false) {
+		return $encode ? htmlspecialchars($this->_title, ENT_QUOTES) : $this->_title;
 	}
 
 	/**
 	 * get the "name" attribute for the <form> tag
      * 
+     * Deprecated, to be refactored
+     *
+	 * @param	bool    $encode To sanitizer the text?
 	 * @return	string
 	 */
-	function getName(){
-		return $this->_name;
+	function getName($encode = true) {
+		return $encode ? htmlspecialchars($this->_name, ENT_QUOTES) : $this->_name;
 	}
 
 	/**
 	 * get the "action" attribute for the <form> tag
 	 * 
+	 * @param	bool    $encode To sanitizer the text?
      * @return	string
 	 */
-	function getAction(){
-		return $this->_action;
+	function getAction($encode = true) {
+		return $encode ? htmlspecialchars($this->_action, ENT_QUOTES) : $this->_action;
 	}
 
 	/**
@@ -151,7 +158,7 @@
      * @return	string
 	 */
 	function getMethod(){
-		return $this->_method;
+		return ( strtolower($this->_method) == "get" ) ? "GET" : "POST";
 	}
 
 	/**
@@ -229,15 +236,16 @@
 	 * @param  string  $name	"name" attribute assigned to a {@link XoopsFormElement}
      * @return object  reference to a {@link XoopsFormElement}, false if not found
 	 */
-	function &getElementByName($name){
-		$elements =& $this->getElements(true);
+	function &getElementByName($name) {
+		$elements = $this->getElements(true);
 		$count = count($elements);
 		for ($i = 0; $i < $count; $i++) {
-			if ($name == $elements[$i]->getName()) {
+			if ($name == $elements[$i]->getName(false)) {
 				return $elements[$i];
 			}
 		}
-		return false;
+		$elt = null;
+		return $elt;
 	}
 
 	/**
@@ -264,7 +272,7 @@
 			$elements =& $this->getElements(true);
 			$count = count($elements);
 			for ($i = 0; $i < $count; $i++) {
-				$name = $elements[$i]->getName();
+				$name = $elements[$i]->getName(false);
 				if ($name && isset($values[$name]) && method_exists($elements[$i], 'setValue')) {
 					$elements[$i]->setValue($values[$name]);
 				}
@@ -276,12 +284,13 @@
 	 * Gets the "value" attribute of a form element
 	 * 
 	 * @param	string 	$name	the "name" attribute of a form element
+	 * @param	bool    $encode To sanitizer the text?
 	 * @return	string 	the "value" attribute assigned to a form element, null if not set
 	 */
-	function &getElementValue($name){
+	function getElementValue($name, $encode = false) {
 		$ele =& $this->getElementByName($name);
 		if (is_object($ele) && method_exists($ele, 'getValue')) {
-			return $ele->getValue($value);
+			return $ele->getValue($encode);
 		}
 		return;
 	}
@@ -289,39 +298,32 @@
 	/**
 	 * gets the "value" attribute of all form elements
 	 * 
+	 * @param	bool    $encode To sanitizer the text?
 	 * @return	array 	array of name/value pairs assigned to form elements
 	 */
-	function &getElementValues(){
+	function getElementValues($encode = false) {
 		// will not use getElementByName() for performance..
 		$elements =& $this->getElements(true);
 		$count = count($elements);
 		$values = array();
 		for ($i = 0; $i < $count; $i++) {
-			$name = $elements[$i]->getName();
+			$name = $elements[$i]->getName(false);
 			if ($name && method_exists($elements[$i], 'getValue')) {
-				$values[$name] =& $elements[$i]->getValue();
+				$values[$name] =& $elements[$i]->getValue($encode);
 			}
 		}
 		return $values;
 	}
 
 	/**
-	 * Add extra attributes to the form.
-	 *
-	 * This string will be inserted verbatim and unvalidated in the
-	 * element's tag. Know what you are doing!
+	 * set the extra attributes for the <form> tag
 	 *
-	 * @param	string  $extra
-	 * @param   string  $replace If true, passed string will replace current content otherwise it will be appended to it
-	 * @return	string New content of the extra string
-	 */
-	function setExtra($extra, $replace = false){
-		if ( $replace) {
-			$this->_extra = trim($extra);
-		} else {
-			$this->_extra .= " " . trim($extra);
+	 * @param	string  $extra  extra attributes for the <form> tag
+	 */
+	function setExtra($extra) {
+    	if (!empty($extra)) {
+    		$this->_extra[] = $extra;
 		}
-		return $this->_extra;
 	}
 
 	/**
@@ -329,10 +331,9 @@
 	 *
 	 * @return	string
 	 */
-	function &getExtra(){
-		if (isset($this->_extra)) {
-			return $this->_extra;
-		}
+	function &getExtra() {
+		$extra = empty($this->_extra) ? "" : " ". implode(" ", $this->_extra);
+		return $extra;
 	}
 
 	/**
@@ -389,7 +390,7 @@
 	function renderValidationJS( $withtags = true ) {
 		$js = "";
 		if ( $withtags ) {
-			$js .= "\n<!-- Start Form Vaidation JavaScript //-->\n<script type='text/javascript'>\n<!--//\n";
+			$js .= "\n<!-- Start Form Validation JavaScript //-->\n<script type='text/javascript'>\n<!--//\n";
 		}
 		$myts =& MyTextSanitizer::getInstance();
 		$formname = $this->getName();
@@ -422,13 +423,13 @@
 	function assign(&$tpl){
 		$i = 0;
 		$elements = array();
-		// Hack Herv Thouzard
+		// Hack Herv?Thouzard
 		$required =& $this->getRequired();
 		$reqnames=array();
 		foreach(array_keys($required) as $i) {
 			$reqnames[] = $required[$i]->getName();
 		}
-		// End Hack Herv Thouzard
+		// End Hack Herv?Thouzard
 		foreach ( $this->getElements() as $ele ) {
 		    $n = ($ele->getName() != "") ? $ele->getName() : $i;
 			$elements[$n]['name']	  = $ele->getName();
diff -ruN 2.2.3a-Final.src/class/xoopsform/formradio.php 2.2.6.src/class/xoopsform/formradio.php
--- 2.2.3a-Final.src/class/xoopsform/formradio.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formradio.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formradio.php,v 1.7.26.3 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formradio.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -82,12 +82,13 @@
 	}
 
 	/**
-	 * Get the pre-selected value
+	 * Get the "value" attribute
 	 * 
+	 * @param	bool    $encode To sanitizer the text?
 	 * @return	string
 	 */
-	function getValue(){
-		return $this->_value;
+	function getValue($encode = false) {
+		return ( $encode && $this->_value !== null ) ? htmlspecialchars($this->_value, ENT_QUOTES) : $this->_value;
 	}
 
 	/**
@@ -105,7 +106,7 @@
 	 * @param	string	$value	"value" attribute - This gets submitted as form-data.
 	 * @param	string	$name	"name" attribute - This is displayed. If empty, we use the "value" instead.
 	 */
-	function addOption($value, $name=""){
+	function addOption($value, $name = "") {
 		if ( $name != "" ) {
 			$this->_options[$value] = $name;
 		} else {
@@ -120,19 +121,27 @@
 	 */
 	function addOptionArray($options){
 		if ( is_array($options) ) {
-			foreach ( $options as $k=>$v ) {
+			foreach ( $options as $k => $v ) {
 				$this->addOption($k, $v);
 			}
 		}
 	}
 
 	/**
-	 * Gets the options
-	 * 
-	 * @return	array	Associative array of value->name pairs.
-	 */
-	function getOptions(){
-		return $this->_options;
+	 * Get an array with all the options
+	 *
+	 * @param	int     $encode     To sanitizer the text? potential values: 0 - skip; 1 - only for value; 2 - for both value and name
+     * @return	array   Associative array of value->name pairs
+	 */
+	function getOptions($encode = false) {
+    	if (!$encode) {
+        	return $this->_options;
+    	}
+    	$value = array();
+    	foreach ($this->_options as $val => $name) {
+		    $value[ $encode ? htmlspecialchars($val, ENT_QUOTES) : $val ] = ($encode > 1) ? htmlspecialchars($name, ENT_QUOTES) : $name;
+    	}
+    	return $value;
 	}
 
 	/**
@@ -144,7 +153,7 @@
 		$ret = "";
 		$i = 0;
 		foreach ( $this->getOptions() as $value => $name ) {
-			$ret .= "<input type='radio' id='".$this->getId().$i."' name='".$this->getName()."' value='".$value."'";
+			$ret .= "<input type='radio' id='".$this->getId().$i."' name='".$this->getName()."' value='".htmlspecialchars($value, ENT_QUOTES)."'";
 			$selected = $this->getValue();
 			if ( isset($selected) && ($value == $selected) ) {
 				$ret .= " checked='checked'";
diff -ruN 2.2.3a-Final.src/class/xoopsform/formradioyn.php 2.2.6.src/class/xoopsform/formradioyn.php
--- 2.2.3a-Final.src/class/xoopsform/formradioyn.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formradioyn.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formradioyn.php,v 1.6.26.2 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formradioyn.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsform/formselectcountry.php 2.2.6.src/class/xoopsform/formselectcountry.php
--- 2.2.3a-Final.src/class/xoopsform/formselectcountry.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formselectcountry.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formselectcountry.php,v 1.6.26.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formselectcountry.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -69,7 +69,7 @@
      *                              Legal are all 2-letter country codes (in capitals).
 	 * @param	int		$size	    Number or rows. "1" makes a drop-down-list
 	 */
-	function XoopsFormSelectCountry($caption, $name, $value=null, $size=1)
+	function XoopsFormSelectCountry($caption, $name, $value = null, $size = 1)
 	{
 		$this->XoopsFormSelect($caption, $name, $value, $size);
 		$this->addOptionArray(XoopsLists::getCountryList());
diff -ruN 2.2.3a-Final.src/class/xoopsform/formselecteditor.php 2.2.6.src/class/xoopsform/formselecteditor.php
--- 2.2.3a-Final.src/class/xoopsform/formselecteditor.php	2005-07-19 05:37:19.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formselecteditor.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formselecteditor.php,v 1.1.2.4 2005/07/19 11:37:19 phppp Exp $
+// $Id: formselecteditor.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsform/formselectgroup.php 2.2.6.src/class/xoopsform/formselectgroup.php
--- 2.2.3a-Final.src/class/xoopsform/formselectgroup.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formselectgroup.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formselectgroup.php,v 1.6.26.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formselectgroup.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -65,7 +65,7 @@
 	 * @param	int		$size	        Number or rows. "1" makes a drop-down-list.
      * @param	bool    $multiple       Allow multiple selections?
 	 */
-	function XoopsFormSelectGroup($caption, $name, $include_anon=false, $value=null, $size=1, $multiple=false)
+	function XoopsFormSelectGroup($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false)
 	{
 	    $this->XoopsFormSelect($caption, $name, $value, $size, $multiple);
 		$member_handler =& xoops_gethandler('member');
diff -ruN 2.2.3a-Final.src/class/xoopsform/formselectlang.php 2.2.6.src/class/xoopsform/formselectlang.php
--- 2.2.3a-Final.src/class/xoopsform/formselectlang.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formselectlang.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formselectlang.php,v 1.6.26.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formselectlang.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -67,7 +67,7 @@
 	 * 							Legal is any name of a XOOPS_ROOT_PATH."/language/" subdirectory.
 	 * @param	int		$size	Number of rows. "1" makes a drop-down-list.
 	 */
-	function XoopsFormSelectLang($caption, $name, $value=null, $size=1)
+	function XoopsFormSelectLang($caption, $name, $value = null, $size = 1)
 	{
 		$this->XoopsFormSelect($caption, $name, $value, $size);
 		$this->addOptionArray(XoopsLists::getLangList());
diff -ruN 2.2.3a-Final.src/class/xoopsform/formselectlist.php 2.2.6.src/class/xoopsform/formselectlist.php
--- 2.2.3a-Final.src/class/xoopsform/formselectlist.php	2005-07-04 05:08:22.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formselectlist.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formselectlist.php,v 1.1.2.2 2005/07/04 11:08:22 mithyt2 Exp $
+// $Id: formselectlist.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsform/formselectmatchoption.php 2.2.6.src/class/xoopsform/formselectmatchoption.php
--- 2.2.3a-Final.src/class/xoopsform/formselectmatchoption.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formselectmatchoption.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formselectmatchoption.php,v 1.8.26.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formselectmatchoption.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -64,7 +64,7 @@
 	 * 							{@link XOOPS_MATCH_EQUAL}, and {@link XOOPS_MATCH_CONTAIN}
 	 * @param	int		$size	Number of rows. "1" makes a drop-down-list
 	 */
-	function XoopsFormSelectMatchOption($caption, $name, $value=null, $size=1)
+	function XoopsFormSelectMatchOption($caption, $name, $value = null, $size = 1)
 	{
 		$this->XoopsFormSelect($caption, $name, $value, $size, false);
 		$this->addOption(XOOPS_MATCH_START, _STARTSWITH);
diff -ruN 2.2.3a-Final.src/class/xoopsform/formselect.php 2.2.6.src/class/xoopsform/formselect.php
--- 2.2.3a-Final.src/class/xoopsform/formselect.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formselect.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formselect.php,v 1.10.26.4 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formselect.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -119,17 +119,25 @@
 	 * 
      * @return	int
 	 */
-	function getSize(){
+	function getSize() {
 		return $this->_size;
 	}
 
 	/**
 	 * Get an array of pre-selected values
-	 * 
+	 *
+	 * @param	bool    $encode To sanitizer the text?
      * @return	array
 	 */
-	function getValue(){
-		return $this->_value;
+	function getValue($encode = false) {
+    	if (!$encode) {
+        	return $this->_value;
+    	}
+    	$value = array();
+    	foreach ($this->_value as $val) {
+		    $value[] = $val ? htmlspecialchars($val, ENT_QUOTES) : $val;
+    	}
+    	return $value;
 	}
 
 	/**
@@ -137,7 +145,7 @@
 	 * 
      * @param	$value	mixed
 	 */
-	function setValue($value){
+	function setValue($value) {
 		if (is_array($value)) {
 			foreach ($value as $v) {
 				$this->_value[] = $v;
@@ -181,12 +189,22 @@
 	}
 
 	/**
-	 * Get all options
-	 * 
+	 * Get an array with all the options
+	 *
+	 * Note: both name and value should be sanitized. However for backward compatibility, only value is sanitized for now.
+	 *
+	 * @param	int     $encode     To sanitizer the text? potential values: 0 - skip; 1 - only for value; 2 - for both value and name
      * @return	array   Associative array of value->name pairs
 	 */
-	function getOptions(){
-		return $this->_options;
+	function getOptions($encode = false) {
+    	if (!$encode) {
+        	return $this->_options;
+    	}
+    	$value = array();
+    	foreach ($this->_options as $val => $name) {
+		    $value[ $encode ? htmlspecialchars($val, ENT_QUOTES) : $val ] = ($encode > 1) ? htmlspecialchars($name, ENT_QUOTES) : $name;
+    	}
+    	return $value;
 	}
 	
 	/**
@@ -204,18 +222,20 @@
      * @return	string  HTML
 	 */
 	function render(){
-	    $ret = "<select  size='".$this->getSize()."'".$this->getExtra()."";
+		$ele_value = $this->getValue();
+		$ele_options = $this->getOptions();
+		$ret = "<select size='".$this->getSize()."'".$this->getExtra();
 	    if ($this->isMultiple() != false) {
 	        $ret .= " name='".$this->getName()."[]' id='".$this->getId()."' multiple='multiple'>\n";
 	    } else {
 	        $ret .= " name='".$this->getName()."' id='".$this->getId()."'>\n";
 	    }
 	    $disabled = $this->getDisabled();
-	    foreach ( $this->getOptions() as $value => $name ) {
+		foreach ( $ele_options as $value => $name ) {
 	        $ret .= "<option value='".htmlspecialchars($value, ENT_QUOTES)."'";
-	        if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) {
-	            $ret .= " selected='selected'";
-	        }
+			if (count($ele_value) > 0 && in_array($value, $ele_value)) {
+					$ret .= " selected='selected'";
+			}
 	        if ($disabled[$value]) {
 	            $ret .= " disabled='disabled'";
 	        }
diff -ruN 2.2.3a-Final.src/class/xoopsform/formselecttheme.php 2.2.6.src/class/xoopsform/formselecttheme.php
--- 2.2.3a-Final.src/class/xoopsform/formselecttheme.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formselecttheme.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formselecttheme.php,v 1.6.26.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formselecttheme.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -66,7 +66,7 @@
 	 * @param	mixed	$value	Pre-selected value (or array of them).
 	 * @param	int		$size	Number or rows. "1" makes a drop-down-list
 	 */
-	function XoopsFormSelectTheme($caption, $name, $value=null, $size=1)
+	function XoopsFormSelectTheme($caption, $name, $value = null, $size = 1)
 	{
 		$this->XoopsFormSelect($caption, $name, $value, $size);
 		$this->addOptionArray(XoopsLists::getThemesList());
diff -ruN 2.2.3a-Final.src/class/xoopsform/formselecttimezone.php 2.2.6.src/class/xoopsform/formselecttimezone.php
--- 2.2.3a-Final.src/class/xoopsform/formselecttimezone.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formselecttimezone.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formselecttimezone.php,v 1.6.26.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formselecttimezone.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -68,7 +68,7 @@
 	 * 							Legal values are "-12" to "12" with some ".5"s strewn in ;-)
 	 * @param	int		$size	Number of rows. "1" makes a drop-down-box.
 	 */
-	function XoopsFormSelectTimezone($caption, $name, $value=null, $size=1)
+	function XoopsFormSelectTimezone($caption, $name, $value = null, $size = 1)
 	{
 		$this->XoopsFormSelect($caption, $name, $value, $size);
 		$this->addOptionArray(XoopsLists::getTimeZoneList());
diff -ruN 2.2.3a-Final.src/class/xoopsform/formselectuser.php 2.2.6.src/class/xoopsform/formselectuser.php
--- 2.2.3a-Final.src/class/xoopsform/formselectuser.php	2005-09-19 11:10:07.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formselectuser.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formselectuser.php,v 1.1.26.12.2.1 2005/09/19 17:10:07 mithyt2 Exp $
+// $Id: formselectuser.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsform/formtextarea.php 2.2.6.src/class/xoopsform/formtextarea.php
--- 2.2.3a-Final.src/class/xoopsform/formtextarea.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formtextarea.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formtextarea.php,v 1.7.26.3 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formtextarea.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -94,7 +94,7 @@
 	 * 
      * @return	int
 	 */
-	function getRows(){
+	function getRows() {
 		return $this->_rows;
 	}
 
@@ -103,17 +103,18 @@
 	 * 
      * @return	int
 	 */
-	function getCols(){
+	function getCols() {
 		return $this->_cols;
 	}
 
 	/**
 	 * Get initial content
 	 * 
+	 * @param	bool    $encode To sanitizer the text? Default value should be "true"; however we have to set "false" for backward compat
      * @return	string
 	 */
-	function getValue(){
-		return $this->_value;
+	function getValue($encode = false) {
+		return $encode ? htmlspecialchars($this->_value) : $this->_value;
 	}
 
 	/**
diff -ruN 2.2.3a-Final.src/class/xoopsform/formtextdateselect.php 2.2.6.src/class/xoopsform/formtextdateselect.php
--- 2.2.3a-Final.src/class/xoopsform/formtextdateselect.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formtextdateselect.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formtextdateselect.php,v 1.1.26.5 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formtextdateselect.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsform/formtext.php 2.2.6.src/class/xoopsform/formtext.php
--- 2.2.3a-Final.src/class/xoopsform/formtext.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/formtext.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: formtext.php,v 1.7.26.2 2005/08/14 19:17:50 skalpa Exp $
+// $Id: formtext.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -94,7 +94,7 @@
 	 * 
      * @return	int
 	 */
-	function getSize(){
+	function getSize() {
 		return $this->_size;
 	}
 
@@ -103,17 +103,18 @@
 	 * 
      * @return	int
 	 */
-	function getMaxlength(){
+	function getMaxlength() {
 		return $this->_maxlength;
 	}
 
 	/**
-	 * Get initial text value
+	 * Get initial content
 	 * 
-     * @return  string
+	 * @param	bool    $encode To sanitizer the text? Default value should be "true"; however we have to set "false" for backward compat
+     * @return	string
 	 */
-	function getValue(){
-		return $this->_value;
+	function getValue($encode = false) {
+		return $encode ? htmlspecialchars($this->_value, ENT_QUOTES) : $this->_value;
 	}
 
 	/**
@@ -121,7 +122,7 @@
 	 * 
      * @param	$value  string
 	 */
-	function setValue($value){
+	function setValue($value) {
 		$this->_value = $value;
 	}
 
@@ -130,7 +131,7 @@
 	 * 
      * @return	string  HTML
 	 */
-	function render(){
+	function render() {
 		return "<input type='text' name='".$this->getName()."' id='".$this->getId()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra()." />";
 	}
 }
diff -ruN 2.2.3a-Final.src/class/xoopsform/grouppermform.php 2.2.6.src/class/xoopsform/grouppermform.php
--- 2.2.3a-Final.src/class/xoopsform/grouppermform.php	2005-09-18 06:55:32.000000000 -0500
+++ 2.2.6.src/class/xoopsform/grouppermform.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php 
-// $Id: grouppermform.php,v 1.14.14.2.2.1 2005/09/18 12:55:32 mithyt2 Exp $
+// $Id: grouppermform.php 1163 2007-12-08 07:10:28Z phppp $
 // ------------------------------------------------------------------------ //
 // XOOPS - PHP Content Management System                      //
 // Copyright (c) 2000-2003 XOOPS.org                           //
@@ -263,6 +263,7 @@
      */
     function render()
     {
+    	$ele_name = $this->getName();
 		$ret = '<table class="outer"><tr><td class="odd"><table><tr>';
 		$cols = 1;
 		foreach ($this->_optionTree[0]['children'] as $topitem) {
@@ -270,19 +271,19 @@
 				$ret .= '</tr><tr>';
 				$cols = 1;
 			}
-			$tree = '<td>';
+			$tree = '<td valign="top">';
 			$prefix = '';
 			$this->_renderOptionTree($tree, $this->_optionTree[$topitem], $prefix);
 			$ret .= $tree.'</td>';
 			$cols++;
 		}
-		$ret .= '</tr></table></td><td class="even">';
+		$ret .= '</tr></table></td><td class="even" valign="top">';
 		foreach (array_keys($this->_optionTree) as $id) {
 			if (!empty($id)) {
-				$option_ids[] = "'".$this->getName().'[groups]['.$this->_groupId.']['.$id.']'."'";
+				$option_ids[] = "'".$ele_name.'[groups]['.$this->_groupId.']['.$id.']'."'";
 			}
 		}
-		$checkallbtn_id = $this->getName().'[checkallbtn]['.$this->_groupId.']';
+		$checkallbtn_id = $ele_name.'[checkallbtn]['.$this->_groupId.']';
 		$option_ids_str = implode(', ', $option_ids);
 		$ret .= _ALL." <input id=\"".$checkallbtn_id."\" type=\"checkbox\" value=\"\" onclick=\"var optionids = new Array(".$option_ids_str."); xoopsCheckAllElements(optionids, '".$checkallbtn_id."');\" />";
 		$ret .= '</td></tr></table>';
@@ -300,12 +301,13 @@
      */
     function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array())
     {
-        $tree .= $prefix . "<input type=\"checkbox\" name=\"" . $this->getName() . "[groups][" . $this->_groupId . "][" . $option['id'] . "]\" id=\"" . $this->getName() . "[groups][" . $this->_groupId . "][" . $option['id'] . "]\" onclick=\""; 
+    	$ele_name = $this->getName();
+        $tree .= $prefix . "<input type=\"checkbox\" name=\"" . $ele_name . "[groups][" . $this->_groupId . "][" . $option['id'] . "]\" id=\"" . $ele_name . "[groups][" . $this->_groupId . "][" . $option['id'] . "]\" onclick=\""; 
         // If there are parent elements, add javascript that will
         // make them selecteded when this element is checked to make
         // sure permissions to parent items are added as well.
         foreach ($parentIds as $pid) {
-            $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']';
+            $parent_ele = $ele_name . '[groups][' . $this->_groupId . '][' . $pid . ']';
             $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if(ele.checked != true) {ele.checked = this.checked;}";
         } 
         // If there are child elements, add javascript that will
@@ -313,14 +315,14 @@
         // sure permissions to child items are not added when there
         // is no permission to this item.
         foreach ($option['allchild'] as $cid) {
-            $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']';
+            $child_ele = $ele_name . '[groups][' . $this->_groupId . '][' . $cid . ']';
             $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if(this.checked != true) {ele.checked = false;}";
         } 
         $tree .= '" value="1"';
         if (in_array($option['id'], $this->_value)) {
             $tree .= ' checked="checked"';
         } 
-        $tree .= " />" . $option['name'] . "<input type=\"hidden\" name=\"" . $this->getName() . "[parents][" . $option['id'] . "]\" value=\"" . implode(':', $parentIds). "\" /><input type=\"hidden\" name=\"" . $this->getName() . "[itemname][" . $option['id'] . "]\" value=\"" . htmlspecialchars($option['name']). "\" /><br />\n";
+        $tree .= " />" . $option['name'] . "<input type=\"hidden\" name=\"" . $ele_name . "[parents][" . $option['id'] . "]\" value=\"" . implode(':', $parentIds). "\" /><input type=\"hidden\" name=\"" . $ele_name . "[itemname][" . $option['id'] . "]\" value=\"" . htmlspecialchars($option['name']). "\" /><br />\n";
         if (isset($option['children'])) {
             foreach ($option['children'] as $child) {
                 array_push($parentIds, $option['id']);
diff -ruN 2.2.3a-Final.src/class/xoopsform/simpleform.php 2.2.6.src/class/xoopsform/simpleform.php
--- 2.2.3a-Final.src/class/xoopsform/simpleform.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/simpleform.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: simpleform.php,v 1.6.26.1 2005/08/14 19:17:50 skalpa Exp $
+// $Id: simpleform.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -64,7 +64,7 @@
 	 */
 	function render()
 	{
-		$ret = $this->getTitle()."\n<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n";
+		$ret = $this->getTitle()."\n<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."' ".$this->getExtra().">\n";
 		foreach ( $this->getElements() as $ele ) {
 			if ( !$ele->isHidden() ) {
 				$ret .= "<b>".$ele->getCaption()."</b><br />".$ele->render()."<br />\n";
diff -ruN 2.2.3a-Final.src/class/xoopsform/tableform.php 2.2.6.src/class/xoopsform/tableform.php
--- 2.2.3a-Final.src/class/xoopsform/tableform.php	2005-08-14 13:17:50.000000000 -0500
+++ 2.2.6.src/class/xoopsform/tableform.php	2007-12-08 01:10:28.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: tableform.php,v 1.7.26.2 2005/08/14 19:17:50 skalpa Exp $
+// $Id: tableform.php 1163 2007-12-08 07:10:28Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -66,20 +66,20 @@
 	 */
 	function render()
 	{
-	    $hidden = "";
 		$ret = $this->getTitle()."\n<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table border='0' width='100%'>\n";
+		$hidden = '';
 		foreach ( $this->getElements() as $ele ) {
 			if ( !$ele->isHidden() ) {
 				$ret .= "<tr valign='top' align='left'><td>".$ele->getCaption();
-				if ($ele->getDescription() != '') {
-					$ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
+				if ($ele_desc = $ele->getDescription()) {
+					$ret .= '<br /><br /><span style="font-weight: normal;">'.$ele_desc.'</span>';
 				}
 				$ret .= "</td><td>".$ele->render()."</td></tr>";
 			} else {
 				$hidden .= $ele->render()."\n";
 			}
 		}
-		$ret .= "</table>".$hidden."\n</form>\n";
+		$ret .= "</table>\n$hidden</form>\n";
 		return $ret;
 	}
 }
diff -ruN 2.2.3a-Final.src/class/xoopsform/themeform.php 2.2.6.src/class/xoopsform/themeform.php
--- 2.2.3a-Final.src/class/xoopsform/themeform.php	2005-09-19 11:23:04.000000000 -0500
+++ 2.2.6.src/class/xoopsform/themeform.php	2008-01-08 16:49:18.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: themeform.php,v 1.14.26.5.2.1 2005/09/19 17:23:04 mithyt2 Exp $
+// $Id: themeform.php 1233 2008-01-08 22:49:18Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -66,7 +66,7 @@
 	 */
     function insertBreak($extra = '', $class= '')
     {
-        $class = ($class != '') ? " class='$class'" : '';
+    	$class = ($class != '') ? " class='".htmlspecialchars($class, ENT_QUOTES)."'" : '';
         //Fix for $extra tag not showing
         if ($extra) {
             $extra = "<tr><td colspan='2' $class>$extra</td></tr>";
@@ -86,20 +86,19 @@
     {
         $hidden = "";
         $required =& $this->getRequired();
-        // Hack Herv Thouzard
+        // Hack Herv?Thouzard
         $reqnames=array();
         foreach(array_keys($required) as $i) {
             $reqnames[] = $required[$i]->getName();
         }
-        // End Hack Herv Thouzard
-        $ret = "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."' ".$this->getExtra().">\n";
+        // End Hack Herv?Thouzard
+        $ret = "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n";
         foreach ( $this->getElements() as $ele ) {
             if (is_object($ele) && $ele->isHidden()) {
                 $ret .= $ele->render()."\n";
             }
         }
         $ret .= "<table width='100%' class='outer' cellspacing='1'><tr><th colspan='2'>".$this->getTitle()."</th></tr>";
-        //$count = 0;
         foreach ( $this->getElements() as $ele ) {
             if (!is_object($ele)) {
                 $ret .= $ele;
@@ -110,7 +109,7 @@
                     $suppl=' *';
                 }
                 $ret .= "<tr valign='top' align='left'><td class='head'>".$ele->getCaption().$suppl;
-                // End Hack Herv Thouzard
+                // End Hack Herv?Thouzard
                 if ($ele->getDescription() != '') {
                     $ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
                 }
diff -ruN 2.2.3a-Final.src/class/xoopsformloader.php 2.2.6.src/class/xoopsformloader.php
--- 2.2.3a-Final.src/class/xoopsformloader.php	2005-07-14 10:13:30.000000000 -0500
+++ 2.2.6.src/class/xoopsformloader.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopsformloader.php,v 1.8.22.1.2.4 2005/07/14 16:13:30 phppp Exp $
+// $Id: xoopsformloader.php 184 2006-01-22 22:34:51Z skalpa $
 if (!defined('XOOPS_ROOT_PATH')) {
 	exit();
 }
diff -ruN 2.2.3a-Final.src/class/xoopslists.php 2.2.6.src/class/xoopslists.php
--- 2.2.3a-Final.src/class/xoopslists.php	2004-01-15 10:23:49.000000000 -0600
+++ 2.2.6.src/class/xoopslists.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopslists.php,v 1.11 2004/01/15 16:23:49 okazu Exp $
+// $Id: xoopslists.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -34,7 +34,7 @@
 	define("XOOPS_LISTS_INCLUDED",1);
 	class XoopsLists
 	{
-		function &getTimeZoneList()
+		function getTimeZoneList()
 		{
 			include_once XOOPS_ROOT_PATH.'/language/'.$GLOBALS['xoopsConfig']['language'].'/timezone.php';
 			$time_zone_list = array ("-12" => _TZ_GMTM12, "-11" => _TZ_GMTM11, "-10" => _TZ_GMTM10, "-9" => _TZ_GMTM9, "-8" => _TZ_GMTM8, "-7" => _TZ_GMTM7, "-6" => _TZ_GMTM6, "-5" => _TZ_GMTM5, "-4" => _TZ_GMTM4, "-3.5" => _TZ_GMTM35, "-3" => _TZ_GMTM3, "-2" => _TZ_GMTM2, "-1" => _TZ_GMTM1, "0" => _TZ_GMT0, "1" => _TZ_GMTP1, "2" => _TZ_GMTP2, "3" => _TZ_GMTP3, "3.5" => _TZ_GMTP35, "4" => _TZ_GMTP4, "4.5" => _TZ_GMTP45, "5" => _TZ_GMTP5, "5.5" => _TZ_GMTP55, "6" => _TZ_GMTP6, "7" => _TZ_GMTP7, "8" => _TZ_GMTP8, "9" => _TZ_GMTP9, "9.5" => _TZ_GMTP95, "10" => _TZ_GMTP10, "11" => _TZ_GMTP11, "12" => _TZ_GMTP12);
@@ -44,7 +44,7 @@
 		/*
 		 * gets list of themes folder from themes directory
 		 */
-		function &getThemesList()
+		function getThemesList()
 		{
 			return XoopsLists::getDirListAsArray(XOOPS_THEME_PATH.'/');
 		}
@@ -52,7 +52,7 @@
 		/*
 		 * gets a list of module folders from the modules directory
 		 */
-		function &getModulesList()
+		function getModulesList()
 		{
 			return XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH."/modules/");
 		}
@@ -60,28 +60,30 @@
 		/*
 		 * gets list of name of directories inside a directory
 		 */
-		function &getDirListAsArray($dirname)
-		{
-			$dirlist = array();
-			if (is_dir($dirname) && $handle = opendir($dirname)) {
-				while (false !== ($file = readdir($handle))) {
-					if ( !preg_match("/^[\.]{1,2}$/",$file) ) {
-						if (strtolower($file) != 'cvs' && is_dir($dirname.$file) ) {
-							$dirlist[$file]=$file;
-						}
+		function getDirListAsArray( $dirname ) {
+			$ignored = array( 'cvs', '_darcs' );
+			$list = array();
+			if ( substr( $dirname, -1 ) != '/' ) {
+				$dirname .= '/';
+			}
+			if ( $handle = opendir( $dirname ) ) {
+				while ( $file = readdir( $handle ) ) {
+					if ( substr( $file, 0, 1 ) == '.' || in_array( strtolower( $file ), $ignored ) )	continue;
+					if ( is_dir( $dirname . $file ) ) {
+						$list[$file] = $file;
 					}
 				}
-				closedir($handle);
-				asort($dirlist);
-				reset($dirlist);
+				closedir( $handle );
+				asort( $list );
+				reset( $list );
 			}
-			return $dirlist;
+			return $list;
 		}
 
 		/*
 		 *  gets list of all files in a directory
 		 */
-		function &getFileListAsArray($dirname, $prefix="")
+		function getFileListAsArray($dirname, $prefix="")
 		{
 			$filelist = array();
 			if (substr($dirname, -1) == '/') {
@@ -91,7 +93,7 @@
 				while (false !== ($file = readdir($handle))) {
 					if (!preg_match("/^[\.]{1,2}$/",$file) && is_file($dirname.'/'.$file)) {
 						$file = $prefix.$file;
-						$filelist[$file]=$file;
+						$filelist[$file] = $file;
 					}
 				}
 				closedir($handle);
@@ -104,14 +106,14 @@
 		/*
 		 *  gets list of image file names in a directory
 		 */
-		function &getImgListAsArray($dirname, $prefix="")
+		function getImgListAsArray($dirname, $prefix="")
 		{
 			$filelist = array();
 			if ($handle = opendir($dirname)) {
 				while (false !== ($file = readdir($handle))) {
-					if ( !preg_match("/^[\.]{1,2}$/",$file) && preg_match("/(\.gif|\.jpg|\.png)$/i",$file) ) {
+					if ( preg_match("/(\.gif|\.jpg|\.png)$/i", $file) ) {
 						$file = $prefix.$file;
-						$filelist[$file]=$file;
+						$filelist[$file] = $file;
 					}
 				}
 				closedir($handle);
@@ -124,18 +126,14 @@
 		/*
 		 *  gets list of html file names in a certain directory
 		*/
-		function &getHtmlListAsArray($dirname, $prefix="")
+		function getHtmlListAsArray($dirname, $prefix="")
 		{
 			$filelist = array();
 			if ($handle = opendir($dirname)) {
 				while (false !== ($file = readdir($handle))) {
-					if ( ( !preg_match( "/^[\.]{1,2}$/", $file ) && preg_match( "/(\.htm|\.html|\.xhtml)$/i", $file ) && !is_dir( $file ) ) )
-        			{
-            			if ( strtolower( $file ) != 'cvs' && !is_dir( $file ) )
-            			{
-                			$file = $prefix.$file;
-							$filelist[$file] = $prefix.$file;
-            			} 
+					if ( ( preg_match( "/(\.htm|\.html|\.xhtml)$/i", $file ) && !is_dir( $file ) ) ) {
+            			$file = $prefix.$file;
+						$filelist[$file] = $prefix.$file;
         			}
 				}
 				closedir($handle);
@@ -149,7 +147,7 @@
 		 *  gets list of avatar file names in a certain directory
 		 *  if directory is not specified, default directory will be searched
 		 */
-		function &getAvatarsList($avatar_dir="")
+		function getAvatarsList($avatar_dir="")
 		{
 			$avatars = array();
 			if ( $avatar_dir != "" ) {
@@ -163,7 +161,7 @@
 		/*
 		 *  gets list of all avatar image files inside default avatars directory
 		 */
-		function &getAllAvatarsList()
+		function getAllAvatarsList()
 		{
 			$avatars = array();
 			$dirlist = array();
@@ -182,7 +180,7 @@
 		*  gets list of subject icon image file names in a certain directory
 		*  if directory is not specified, default directory will be searched
 		*/
-		function &getSubjectsList($sub_dir="")
+		function getSubjectsList($sub_dir="")
 		{
 			$subjects = array();
 			if($sub_dir != ""){
@@ -196,14 +194,14 @@
 		/*
 		 * gets list of language folders inside default language directory
 		 */
-		function &getLangList()
+		function getLangList()
 		{
 			$lang_list = array();
 			$lang_list =& XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH."/language/");
 			return $lang_list;
 		}
 
-		function &getCountryList()
+		function getCountryList()
 		{
 			$country_list = array (
 				""   => "-",
@@ -456,7 +454,7 @@
     		return $country_list;
 		}
 
-		function &getHtmlList()
+		function getHtmlList()
 		{
 			$html_list = array (
 				"a" => "&lt;a&gt;",
@@ -516,7 +514,7 @@
     		return $html_list;
 		}
 
-		function &getUserRankList()
+		function getUserRankList()
 		{
 			$db =& Database::getInstance();
 			$myts =& MyTextSanitizer::getInstance();
diff -ruN 2.2.3a-Final.src/class/xoopsmailer.php 2.2.6.src/class/xoopsmailer.php
--- 2.2.3a-Final.src/class/xoopsmailer.php	2005-09-18 06:59:09.000000000 -0500
+++ 2.2.6.src/class/xoopsmailer.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopsmailer.php,v 1.18.6.5.2.1 2005/09/18 12:59:09 mithyt2 Exp $
+// $Id: xoopsmailer.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsmodule.php 2.2.6.src/class/xoopsmodule.php
--- 2.2.3a-Final.src/class/xoopsmodule.php	2003-03-27 08:56:17.000000000 -0600
+++ 2.2.6.src/class/xoopsmodule.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopsmodule.php,v 1.8 2003/03/27 14:56:17 okazu Exp $
+// $Id: xoopsmodule.php 184 2006-01-22 22:34:51Z skalpa $
 if (!defined('XOOPS_ROOT_PATH')) {
 	exit();
 }
diff -ruN 2.2.3a-Final.src/class/xoopsobject.php 2.2.6.src/class/xoopsobject.php
--- 2.2.3a-Final.src/class/xoopsobject.php	2003-03-27 08:56:17.000000000 -0600
+++ 2.2.6.src/class/xoopsobject.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopsobject.php,v 1.8 2003/03/27 14:56:17 okazu Exp $
+// $Id: xoopsobject.php 184 2006-01-22 22:34:51Z skalpa $
 if (!defined('XOOPS_ROOT_PATH')) {
 	exit();
 }
diff -ruN 2.2.3a-Final.src/class/xoopssecurity.php 2.2.6.src/class/xoopssecurity.php
--- 2.2.3a-Final.src/class/xoopssecurity.php	2005-09-18 07:00:39.000000000 -0500
+++ 2.2.6.src/class/xoopssecurity.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopssecurity.php,v 1.1.4.10.2.1 2005/09/18 13:00:39 mithyt2 Exp $
+// $Id: xoopssecurity.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopsstory.php 2.2.6.src/class/xoopsstory.php
--- 2.2.3a-Final.src/class/xoopsstory.php	2003-04-01 15:51:21.000000000 -0600
+++ 2.2.6.src/class/xoopsstory.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopsstory.php,v 1.10 2003/04/01 22:51:21 mvandam Exp $
+// $Id: xoopsstory.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopstopic.php 2.2.6.src/class/xoopstopic.php
--- 2.2.3a-Final.src/class/xoopstopic.php	2003-03-27 08:56:17.000000000 -0600
+++ 2.2.6.src/class/xoopstopic.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopstopic.php,v 1.8 2003/03/27 14:56:17 okazu Exp $
+// $Id: xoopstopic.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/class/xoopstree.php 2.2.6.src/class/xoopstree.php
--- 2.2.3a-Final.src/class/xoopstree.php	2004-06-14 08:22:12.000000000 -0500
+++ 2.2.6.src/class/xoopstree.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopstree.php,v 1.7 2004/06/14 14:22:12 skalpa Exp $
+// $Id: xoopstree.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -192,7 +192,7 @@
 		list($parentid,$name) = $this->db->fetchRow($result);
 		$myts =& MyTextSanitizer::getInstance();
 		$name = $myts->makeTboxData4Show($name);
-		$path = "<a href='".$funcURL."&".$this->id."=".$sel_id."'>".$name."</a>&nbsp;:&nbsp;".$path."";
+		$path = "<a href='".$funcURL."&amp;".$this->id."=".$sel_id."'>".$name."</a>&nbsp;:&nbsp;".$path."";
 		if ( $parentid == 0 ) {
 			return $path;
 		}
diff -ruN 2.2.3a-Final.src/class/xoopsuser.php 2.2.6.src/class/xoopsuser.php
--- 2.2.3a-Final.src/class/xoopsuser.php	2003-03-27 08:56:18.000000000 -0600
+++ 2.2.6.src/class/xoopsuser.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopsuser.php,v 1.8 2003/03/27 14:56:18 okazu Exp $
+// $Id: xoopsuser.php 184 2006-01-22 22:34:51Z skalpa $
 // this file is for backward compatibility only
 if (!defined('XOOPS_ROOT_PATH')) {
 	exit();
diff -ruN 2.2.3a-Final.src/class/zipdownloader.php 2.2.6.src/class/zipdownloader.php
--- 2.2.3a-Final.src/class/zipdownloader.php	2005-03-27 03:20:22.000000000 -0600
+++ 2.2.6.src/class/zipdownloader.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: zipdownloader.php,v 1.6.22.1 2005/03/27 10:20:22 mithyt2 Exp $
+// $Id: zipdownloader.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/edituser.php 2.2.6.src/edituser.php
--- 2.2.3a-Final.src/edituser.php	2005-05-06 12:47:56.000000000 -0500
+++ 2.2.6.src/edituser.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: edituser.php,v 1.24.4.1.2.4 2005/05/06 18:47:56 mithyt2 Exp $
+// $Id: edituser.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/error.php 2.2.6.src/error.php
--- 2.2.3a-Final.src/error.php	2005-08-04 15:46:47.000000000 -0500
+++ 2.2.6.src/error.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: error.php,v 1.1.2.5 2005/08/04 21:46:47 phppp Exp $
+// $Id: error.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/footer.php 2.2.6.src/footer.php
--- 2.2.3a-Final.src/footer.php	2005-09-18 07:02:13.000000000 -0500
+++ 2.2.6.src/footer.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: footer.php,v 1.13.22.1.2.14.2.1 2005/09/18 13:02:13 mithyt2 Exp $
+// $Id: footer.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/header.php 2.2.6.src/header.php
--- 2.2.3a-Final.src/header.php	2005-08-14 18:00:54.000000000 -0500
+++ 2.2.6.src/header.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: header.php,v 1.42.4.1.2.17 2005/08/15 00:00:54 skalpa Exp $
+// $Id: header.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -28,6 +28,11 @@
     die("XOOPS root path not defined");
 }
 
+// Ensure charset setting
+if (!headers_sent()) {
+	header('Content-Type:text/html; charset='._CHARSET);
+}
+
 $GLOBALS['xoopsLogger']->context = "core";
 
 // Get blocks
diff -ruN 2.2.3a-Final.src/imagemanager.php 2.2.6.src/imagemanager.php
--- 2.2.3a-Final.src/imagemanager.php	2005-06-03 19:58:07.000000000 -0500
+++ 2.2.6.src/imagemanager.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: imagemanager.php,v 1.12.6.4 2005/06/04 01:58:07 phppp Exp $
+// $Id: imagemanager.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -38,7 +38,6 @@
 }
 
 $wysiwyg = empty($_REQUEST['wysiwyg'])?0:1;
-//echo "<br />wysiwyg:".$wysiwyg;
 if (!is_object($xoopsUser)) {
     $group = array(XOOPS_GROUP_ANONYMOUS);
 } else {
@@ -124,7 +123,7 @@
                 }
                 if ($total > 10) {
                     include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
-                    $nav = new XoopsPageNav($total, 10, $start, 'start', 'target='.$target.'&amp;cat_id='.$catshow);
+                    $nav = new XoopsPageNav($total, 10, $start, 'start', 'target='.$target.'&amp;cat_id='.$catshow."&amp;wysiwyg={$wysiwyg}");
                     $xoopsTpl->assign('pagenav', $nav->renderNav());
                 }
             } else {
@@ -242,7 +241,7 @@
                 $fp = @fopen($uploader->getSavedDestination(), 'rb');
                 $fbinary = @fread($fp, filesize($uploader->getSavedDestination()));
                 @fclose($fp);
-                $image->setVar('image_body', addslashes($fbinary));
+                $image->setVar('image_body', $fbinary, true);
                 @unlink($uploader->getSavedDestination());
             }
             if (!$image_handler->insert($image)) {
diff -ruN 2.2.3a-Final.src/image.php 2.2.6.src/image.php
--- 2.2.3a-Final.src/image.php	2005-04-03 03:23:33.000000000 -0500
+++ 2.2.6.src/image.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: image.php,v 1.14.6.1 2005/04/03 09:23:33 mithyt2 Exp $
+// $Id: image.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/include/checklogin.php 2.2.6.src/include/checklogin.php
--- 2.2.3a-Final.src/include/checklogin.php	2005-09-18 07:05:03.000000000 -0500
+++ 2.2.6.src/include/checklogin.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: checklogin.php,v 1.16.8.11.2.1 2005/09/18 13:05:03 mithyt2 Exp $
+// $Id: checklogin.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -72,6 +72,8 @@
             exit();
         }
     }
+    // Regenrate a new session id and destroy old session
+    session_regenerate_id(true);
     $_SESSION = array();
     $_SESSION['xoopsUserId'] = $user->getVar('uid');
     $_SESSION['xoopsUserGroups'] = $user->getGroups();
@@ -108,7 +110,7 @@
     $notification_handler =& xoops_gethandler('notification');
     $notification_handler->doLoginMaintenance($user->getVar('uid'));
 
-    redirect_header($url, 1, sprintf(_US_LOGGINGU, $user->getVar('uname')));
+    redirect_header($url, 1, sprintf(_US_LOGGINGU, $user->getVar('uname')), false); // disable "addredirect"!!
 } else {
 
     redirect_header(XOOPS_URL.'/user.php',1,_US_INCORRECTLOGIN);
diff -ruN 2.2.3a-Final.src/include/comment_constants.php 2.2.6.src/include/comment_constants.php
--- 2.2.3a-Final.src/include/comment_constants.php	2005-04-03 04:07:19.000000000 -0500
+++ 2.2.6.src/include/comment_constants.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_constants.php,v 1.5.26.1 2005/04/03 10:07:19 mithyt2 Exp $
+// $Id: comment_constants.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/include/comment_delete.php 2.2.6.src/include/comment_delete.php
--- 2.2.3a-Final.src/include/comment_delete.php	2004-12-26 13:11:51.000000000 -0600
+++ 2.2.6.src/include/comment_delete.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_delete.php,v 1.15 2004/12/26 19:11:51 onokazu Exp $
+// $Id: comment_delete.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/include/comment_edit.php 2.2.6.src/include/comment_edit.php
--- 2.2.3a-Final.src/include/comment_edit.php	2005-04-08 13:04:02.000000000 -0500
+++ 2.2.6.src/include/comment_edit.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_edit.php,v 1.7.8.1 2005/04/08 19:04:02 mithyt2 Exp $
+// $Id: comment_edit.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/include/commentform.inc.php 2.2.6.src/include/commentform.inc.php
--- 2.2.3a-Final.src/include/commentform.inc.php	2005-08-14 13:17:51.000000000 -0500
+++ 2.2.6.src/include/commentform.inc.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: commentform.inc.php,v 1.7.8.2 2005/08/14 19:17:51 skalpa Exp $
+// $Id: commentform.inc.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/include/comment_form.php 2.2.6.src/include/comment_form.php
--- 2.2.3a-Final.src/include/comment_form.php	2005-06-25 15:36:42.000000000 -0500
+++ 2.2.6.src/include/comment_form.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_form.php,v 1.10.6.2.2.2 2005/06/25 21:36:42 mithyt2 Exp $
+// $Id: comment_form.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -76,12 +76,12 @@
 			$status_select = new XoopsFormSelect(_CM_STATUS, 'com_status', $com_status);
 			$status_select->addOptionArray(array(XOOPS_COMMENT_PENDING => _CM_PENDING, XOOPS_COMMENT_ACTIVE => _CM_ACTIVE, XOOPS_COMMENT_HIDDEN => _CM_HIDDEN));
 			$cform->addElement($status_select);
+            $button_tray->addElement(new XoopsFormButton('', 'com_dodelete', _DELETE, 'submit'));
 		}
 		$html_checkbox = new XoopsFormCheckBox('', 'dohtml', $dohtml);
 		$html_checkbox->addOption(1, _CM_DOHTML);
 		$option_tray->addElement($html_checkbox);
-		$button_tray->addElement(new XoopsFormButton('', 'com_dodelete', _DELETE, 'submit'));
-	}
+    }
 }
 $smiley_checkbox = new XoopsFormCheckBox('', 'dosmiley', $dosmiley);
 $smiley_checkbox->addOption(1, _CM_DOSMILEY);
diff -ruN 2.2.3a-Final.src/include/comment_new.php 2.2.6.src/include/comment_new.php
--- 2.2.3a-Final.src/include/comment_new.php	2004-12-26 13:11:51.000000000 -0600
+++ 2.2.6.src/include/comment_new.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_new.php,v 1.10 2004/12/26 19:11:51 onokazu Exp $
+// $Id: comment_new.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -49,8 +49,8 @@
 		}
 		$myts =& MyTextSanitizer::getInstance();
 		$com_title = $myts->htmlSpecialChars($com_replytitle);
-		if (!preg_match("/^re:/i", $com_title)) {
-			$com_title = "Re: ".xoops_substr($com_title, 0, 56);
+		if (!preg_match("/^(Re|"._CM_RE."):/i", $com_title)) {
+			$com_title = _CM_RE.": ".xoops_substr($com_title, 0, 56);
 		}
 	} else {
 		$com_title = '';
diff -ruN 2.2.3a-Final.src/include/comment_post.php 2.2.6.src/include/comment_post.php
--- 2.2.3a-Final.src/include/comment_post.php	2005-06-28 12:15:25.000000000 -0500
+++ 2.2.6.src/include/comment_post.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_post.php,v 1.33.6.4.2.3 2005/06/28 18:15:25 mithyt2 Exp $
+// $Id: comment_post.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -58,7 +58,7 @@
 	if (isset($comment_config['extraParams']) && is_array($comment_config['extraParams'])) {
 		$extra_params = '';
 		foreach ($comment_config['extraParams'] as $extra_param) {
-			$extra_params .= isset($_POST[$extra_param]) ? $extra_param.'='.$_POST[$extra_param].'&amp;' : $extra_param.'=&amp;';
+			$extra_params .= isset($_POST[$extra_param]) ? $extra_param.'='.htmlspecialchars($_POST[$extra_param]).'&amp;' : $extra_param.'=&amp;';
 		}
 		$redirect_page .= $extra_params;
 	}
@@ -121,8 +121,8 @@
 			$dohtml = 0;
 		}
 	}
-	$p_comment =& $myts->previewTarea($com_text, $dohtml, $dosmiley, $doxcode, $doimage, $dobr);
-	$com_icon = isset($com_icon) ? $com_icon : '';
+	$p_comment =& $myts->previewTarea($_POST['com_text'], $dohtml, $dosmiley, $doxcode, $doimage, $dobr);
+    $com_icon = (!empty($com_icon) && is_file(XOOPS_ROOT_PATH . "/images/subject/" . $com_icon) ) ? $com_icon : '';
 	$noname = isset($noname) ? intval($noname) : 0;
 	$com_text = $myts->htmlSpecialChars($myts->stripSlashesGPC($com_text));
 	if ($xoopsModule->getVar('dirname') != 'system') {
@@ -266,12 +266,12 @@
 	$comment->setVar('doxcode', $doxcode);
 	$comment->setVar('doimage', $doimage);
 	$comment->setVar('dobr', $dobr);
-	$icon = isset($com_icon) ? $com_icon : '';
+    $icon = (!empty($com_icon) && is_file(XOOPS_ROOT_PATH . "/images/subject/" . $com_icon) ) ? $com_icon : '';
 	$comment->setVar('com_icon', $icon);
 	$comment->setVar('com_modified', time());
 	$comment->setVar('com_modid', $com_modid);
-	if (isset($extra_params)) {
-		$comment->setVar('com_exparams', $extra_params);
+    if (!empty($extra_params)) {
+        $comment->setVar('com_exparams', str_replace('&amp;', '&', $extra_params));
 	}
 	if (false != $comment_handler->insert($comment)) {
 		$newcid = $comment->getVar('com_id');
diff -ruN 2.2.3a-Final.src/include/comment_reply.php 2.2.6.src/include/comment_reply.php
--- 2.2.3a-Final.src/include/comment_reply.php	2004-12-26 13:11:51.000000000 -0600
+++ 2.2.6.src/include/comment_reply.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_reply.php,v 1.9 2004/12/26 19:11:51 onokazu Exp $
+// $Id: comment_reply.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -55,8 +55,8 @@
 $comment =& $comment_handler->get($com_id);
 $r_name = XoopsUser::getUnameFromId($comment->getVar('com_uid'));
 $r_text = _CM_POSTER.': <b>'.$r_name.'</b>&nbsp;&nbsp;'._CM_POSTED.': <b>'.formatTimestamp($comment->getVar('com_created')).'</b><br /><br />'.$comment->getVar('com_text');$com_title = $comment->getVar('com_title', 'E');
-if (!preg_match("/^re:/i", $com_title)) {
-	$com_title = "Re: ".xoops_substr($com_title, 0, 56);
+if (!preg_match("/^(Re|"._CM_RE."):/i", $com_title)) {
+	$com_title = _CM_RE.": ".xoops_substr($com_title, 0, 56);
 }
 $com_pid = $com_id;
 $com_text = '';
diff -ruN 2.2.3a-Final.src/include/comment_view.php 2.2.6.src/include/comment_view.php
--- 2.2.3a-Final.src/include/comment_view.php	2005-07-21 00:53:48.000000000 -0500
+++ 2.2.6.src/include/comment_view.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_view.php,v 1.20.10.1 2005/07/21 06:53:48 mithyt2 Exp $
+// $Id: comment_view.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/include/common.php 2.2.6.src/include/common.php
--- 2.2.3a-Final.src/include/common.php	2005-09-29 11:04:50.000000000 -0500
+++ 2.2.6.src/include/common.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: common.php,v 1.63.4.19.2.2 2005/09/29 17:04:50 mithyt2 Exp $
+// $Id: common.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -29,8 +29,8 @@
 } else {
     //Instantiate security object
     require_once XOOPS_ROOT_PATH."/class/xoopssecurity.php";
-    $xoopsSecurity = new XoopsSecurity();
     global $xoopsSecurity;
+    $xoopsSecurity = new XoopsSecurity();
     //Check super globals
     $xoopsSecurity->checkSuperglobals();
 
@@ -122,6 +122,7 @@
     if ($_SERVER['REQUEST_METHOD'] != 'POST' || !$xoopsSecurity->checkReferer(XOOPS_DB_CHKREF)) {
         define('XOOPS_DB_PROXY', 1);
     }
+    global $xoopsDB;
     $xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection();
 
 	// ################# Load Config Settings ##############
@@ -185,22 +186,26 @@
     } elseif ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') {
         if (isset($_COOKIE[$xoopsConfig['session_name']])) {
             session_id($_COOKIE[$xoopsConfig['session_name']]);
-        } else {
-            // no custom session cookie set, destroy session if any
-            $_SESSION = array();
-            //session_destroy();
         }
         if (function_exists('session_cache_expire')) {
             session_cache_expire($xoopsConfig['session_expire']);
         }
+        @ini_set('session.gc_maxlifetime', $xoopsConfig['session_expire'] * 60);
     }
     session_set_save_handler(array(&$sess_handler, 'open'), array(&$sess_handler, 'close'), array(&$sess_handler, 'read'), array(&$sess_handler, 'write'), array(&$sess_handler, 'destroy'), array(&$sess_handler, 'gc'));
     session_start();
+    
+    // Remove expired session for xoopsUserId
+    if ( $xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '' && !isset($_COOKIE[$xoopsConfig['session_name']]) && !empty($_SESSION['xoopsUserId']) ) {
+	    unset( $_SESSION['xoopsUserId'] );
+    }
 
     if (!empty($_SESSION['xoopsUserId'])) {
         $xoopsUser =& $member_handler->getUser($_SESSION['xoopsUserId']);
         if (!is_object($xoopsUser)) {
             $xoopsUser = '';
+		    // Regenrate a new session id and destroy old session
+		    session_regenerate_id(true);
             $_SESSION = array();
         } else {
             if ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') {
diff -ruN 2.2.3a-Final.src/include/cp_functions.php 2.2.6.src/include/cp_functions.php
--- 2.2.3a-Final.src/include/cp_functions.php	2005-07-19 13:53:54.000000000 -0500
+++ 2.2.6.src/include/cp_functions.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: cp_functions.php,v 1.23.6.3.2.25 2005/07/19 19:53:54 mithyt2 Exp $
+// $Id: cp_functions.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -37,8 +37,15 @@
     //	} else {
     //  ob_start();
     //	}
+    if (!headers_sent()) {
+        header('Content-Type:text/html; charset='._CHARSET);
+        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
+        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+        header('Cache-Control: no-store, no-cache, max-age=1, s-maxage=1, must-revalidate, post-check=0, pre-check=0');
+        header("Pragma: no-cache");
+    }
     $moduleperm_handler =& xoops_gethandler('groupperm');
-    $admin_mids =& $moduleperm_handler->getItemIds('module_admin', $xoopsUser->getGroups());
+    $admin_mids = $moduleperm_handler->getItemIds('module_admin', $xoopsUser->getGroups());
 
 
     $module_handler =& xoops_gethandler('module');
@@ -55,7 +62,7 @@
     $isPrefAdmin = $moduleperm_handler->checkRight('system_admin', XOOPS_SYSTEM_PREF, $xoopsUser->getGroups());
 
     //load system items
-    $system_rights =& $moduleperm_handler->getItemIds('system_admin', $xoopsUser->getGroups());
+    $system_rights = $moduleperm_handler->getItemIds('system_admin', $xoopsUser->getGroups());
     if (count($system_rights) > 0 && is_object($mods[1])) {
         $menuitems = $mods[1]->getAdminMenu();
         if (count($menuitems) > 0) {
diff -ruN 2.2.3a-Final.src/include/cp_header.php 2.2.6.src/include/cp_header.php
--- 2.2.3a-Final.src/include/cp_header.php	2005-08-14 18:00:54.000000000 -0500
+++ 2.2.6.src/include/cp_header.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php 
-// $Id: cp_header.php,v 1.9.10.5 2005/08/15 00:00:54 skalpa Exp $
+// $Id: cp_header.php 184 2006-01-22 22:34:51Z skalpa $
 /**
  * module files can include this file for admin authorization
  * the file that will include this file must be located under xoops_url/modules/module_directory_name/admin_directory_name/
diff -ruN 2.2.3a-Final.src/include/functions.php 2.2.6.src/include/functions.php
--- 2.2.3a-Final.src/include/functions.php	2005-10-27 19:50:55.000000000 -0500
+++ 2.2.6.src/include/functions.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: functions.php,v 1.69.6.4.2.31.2.7 2005/10/28 01:50:55 skalpa Exp $
+// $Id: functions.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -48,14 +48,14 @@
     <head>
     <meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" />
     <meta http-equiv="content-language" content="'._LANGCODE.'" />
-    <meta name="robots" content="'.$xoopsConfigMetaFooter['meta_robots'].'" />
-    <meta name="keywords" content="'.$xoopsConfigMetaFooter['meta_keywords'].'" />
-    <meta name="description" content="'.$xoopsConfigMetaFooter['meta_desc'].'" />
-    <meta name="rating" content="'.$xoopsConfigMetaFooter['meta_rating'].'" />
-    <meta name="author" content="'.$xoopsConfigMetaFooter['meta_author'].'" />
-    <meta name="copyright" content="'.$xoopsConfigMetaFooter['meta_copyright'].'" />
+    <meta name="robots" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_robots']).'" />
+    <meta name="keywords" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_keywords']).'" />
+    <meta name="description" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_desc']).'" />
+    <meta name="rating" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_rating']).'" />
+    <meta name="author" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_author']).'" />
+    <meta name="copyright" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_copyright']).'" />
     <meta name="generator" content="XOOPS" />
-    <title>'.$xoopsConfig['sitename'].'</title>
+    <title>'.htmlspecialchars($xoopsConfig['sitename']).'</title>
     <script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script>
     ';
     $themecss = getcss($xoopsConfig['theme_set']);
@@ -149,8 +149,8 @@
 function xoops_load_lang_file( $filename, $module = '', $default = 'english' ) {
 	$lang = $GLOBALS['xoopsConfig']['language'];
 	$path = XOOPS_ROOT_PATH . ( empty($module) ? '/' : "/modules/$module/" ) . 'language';
-	if ( !( $ret = include_once( "$path/$lang/$filename.php" ) ) ) {
-		$ret = include_once( "$path/$default/$filename.php" );
+	if ( !( $ret = @include_once( "$path/$lang/$filename.php" ) ) ) {
+		$ret = @include_once( "$path/$default/$filename.php" );
 	}
 	return $ret;
 }
@@ -175,7 +175,8 @@
             $timeoffset = $xoopsConfig['default_TZ'];
         }
     }
-    $usertimestamp = intval($time) + (intval($timeoffset) - $xoopsConfig['server_TZ'])*3600;
+    //$usertimestamp = intval($time) + (intval($timeoffset) - $xoopsConfig['server_TZ'])*3600;
+    $usertimestamp = intval($time) + intval((floatval($timeoffset) - floatval($xoopsConfig['server_TZ']))*3600);
     return $usertimestamp;
 }
 
@@ -256,8 +257,11 @@
 */
 function OpenWaitBox()
 {
+	echo "<p align='center'><strong><big>" ._FETCHING."</big></strong><br style='clear:both' /><img src='".XOOPS_URL."/images/await.gif' alt='' style='padding:10px;' /><br style='clear:both' />" ._PLEASEWAIT."</p>";
+	return;
+
     echo "<div id='waitDiv' style='position:absolute;left:40%;top:50%;visibility:hidden;text-align: center;'>
-    <table cellpadding='6' border='2' class='bg2'>
+    <table cellpadding='6' border='0' class='bg2'>
       <tr>
         <td align='center'><b><big>" ._FETCHING."</big></b><br /><img src='".XOOPS_URL."/images/await.gif' alt='' /><br />" ._PLEASEWAIT."</td>
       </tr>
@@ -371,12 +375,12 @@
             $bannerobject = '<div><a href="'.XOOPS_URL.'/banners.php?op=click&amp;bid='.$bid.'" target="_blank">';
             if (stristr($imageurl, '.swf')) {
                 $bannerobject = $bannerobject
-                .'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="468" height="60">'
-                .'<param name=movie value="'.$imageurl.'">'
-                .'<param name=quality value=high>'
-                .'<embed src="'.$imageurl.'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"; type="application/x-shockwave-flash" width="468" height="60">'
-                .'</embed>'
-                .'</object>';
+                    .'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="468" height="60">'
+                    .'<param name="movie" value="'.$imageurl.'"></param>'
+                    .'<param name="quality" value="high"></param>'
+                    .'<embed src="'.$imageurl.'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"; type="application/x-shockwave-flash" width="468" height="60">'
+                    .'</embed>'
+                    .'</object>';
             } else {
                 $bannerobject = $bannerobject.'<img src="'.$imageurl.'" alt="" />';
             }
@@ -420,7 +424,7 @@
     $message = trim($message) != '' ? $message : _TAKINGBACK;
     $xTheme->tplEngine->assign('message', $message);
     $xTheme->tplEngine->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD, $url));
-    $xTheme->tplEngine->assign('xoops_module_header', '<meta http-equiv="Refresh" content="2; url='.$url.'" />');
+    $xTheme->tplEngine->assign('xoops_module_header', '<meta http-equiv="Refresh" content="'.$time.'; url='.$url.'" />');
     $xoopsOption['template_main'] = 'system_redirect.html';
     include XOOPS_ROOT_PATH."/footer.php";
     exit();
@@ -553,10 +557,12 @@
     if ( file_exists(XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/xoopsmailerlocal.php") ) {
         include_once XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/xoopsmailerlocal.php";
         if ( class_exists("XoopsMailerLocal") ) {
-            return new XoopsMailerLocal();
+            $mailer = new XoopsMailerLocal();
+            return $mailer;
         }
     }
-    return new XoopsMailer();
+    $mailer = new XoopsMailer();
+    return $mailer;
 }
 
 function &xoops_gethandler($name, $optional = false )
@@ -578,7 +584,8 @@
     if ( isset( $handlers[$name] ) ) {
     	return $handlers[$name];
     }
-    return false;
+    $ret = false;
+    return $ret;
 }
 
 function &xoops_getmodulehandler($name = null, $module_dir = null, $optional = false)
@@ -611,7 +618,8 @@
     if ( isset( $handlers[$module_dir][$name] ) ) {
     	return $handlers[$module_dir][$name];
     }
-    return false;
+    $ret = false;
+    return $ret;
 }
 
 function xoops_getrank($rank_id =0, $posts = 0)
@@ -644,9 +652,9 @@
 function xoops_substr($str, $start, $length, $trimmarker = '...')
 {
    	if(is_callable(array("XoopsLocal", "substr"))) {
-	   	return XoopsLocal::substr($str, $start, $length); 
+	   	return XoopsLocal::substr($str, $start, $length, $trimmarker); 
 	   	// Or
-	   	// return xoops_local("substr", $str, $start, $length);
+	   	// return xoops_local("substr", $str, $start, $length, $trimmarker);
    	}
     if ( !XOOPS_USE_MULTIBYTES ) {
         return ( strlen($str) - $start <= $length ) ? substr( $str, $start, $length ) : substr( $str, $start, $length - strlen($trimmarker) ) . $trimmarker;
@@ -736,7 +744,7 @@
     return $gperm_handler->deleteByModule($module_id, $perm_name, $item_id);
 }
 
-function &xoops_utf8_encode(&$text)
+function &xoops_utf8_encode($text)
 {
    	if(is_callable(array("XoopsLocal", "utf8_encode"))) {
 	   	return XoopsLocal::utf8_encode($text); 
@@ -750,7 +758,7 @@
     return utf8_encode($text);
 }
 
-function &xoops_convert_encoding(&$text, $to='utf-8', $from='')
+function &xoops_convert_encoding($text, $to='utf-8', $from='')
 {
    	if(is_callable(array("XoopsLocal", "convert_encoding"))) {
 	   	return XoopsLocal::convert_encoding($text, $to, $from); 
@@ -759,7 +767,7 @@
     return xoops_utf8_encode($text);
 }
 
-function xoops_getLinkedUnameFromId($userid, $usereal = 1)
+function xoops_getLinkedUnameFromId($userid, $usereal = 0)
 {
     $userid = intval($userid);
     if ($userid > 0) {
@@ -792,31 +800,18 @@
 }
 
 // calling XoopsLocal::{$func}()
-function &xoops_local($func)
+function xoops_local($func)
 {
-	$par_string = "";
 	// get parameters
-	if (func_num_args() > 1) {
-		$params = array_slice(func_get_args(),1);
-		$count = count($params);
-		$par_string .= '$params[0]';
-		for($i=1;$i<$count;$i++) {
-			$par_string .= ',$params[' . $i . ']';
-		}
-	}
+	$func_args = func_get_args();
+	$func = array_shift($func_args);
 	// local method defined
 	if(is_callable(array("XoopsLocal", $func))) {
-		$code = "return XoopsLocal::{$func}(";
-		if(!empty($par_string)) $code .= $par_string;
-		$code .= ');';
-		return eval($code);
+		return call_user_func_array(array("XoopsLocal", $func), $func_args);
 	}
 	// php function defined
 	if(function_exists($func)){
-		$code = "return {$func}(";
-		if(!empty($par_string)) $code .= $par_string;
-		$code .= ');';
-		return eval($code);
+		return call_user_func_array($func, $func_args);
 	}
 	// nothing
 	return null;
diff -ruN 2.2.3a-Final.src/include/notification_constants.php 2.2.6.src/include/notification_constants.php
--- 2.2.3a-Final.src/include/notification_constants.php	2003-03-16 16:39:46.000000000 -0600
+++ 2.2.6.src/include/notification_constants.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: notification_constants.php,v 1.2 2003/03/16 22:39:46 w4z004 Exp $
+// $Id: notification_constants.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/include/notification_functions.php 2.2.6.src/include/notification_functions.php
--- 2.2.3a-Final.src/include/notification_functions.php	2005-06-02 09:54:56.000000000 -0500
+++ 2.2.6.src/include/notification_functions.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: notification_functions.php,v 1.7.8.2 2005/06/02 15:54:56 mithyt2 Exp $
+// $Id: notification_functions.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -96,12 +96,14 @@
 	if (empty($category_name)) {
 		return $not_config['category'];
 	}
-	foreach ($not_config['category'] as $category) {
+	foreach (array_keys($not_config['category']) as $key) {
+		$category =& $not_config['category'][$key];
 		if ($category['name'] == $category_name) {
 			return $category;
 		}
 	}
-	return false;
+	$ret = false;
+	return $ret;
 }
 
 /**
@@ -119,9 +121,10 @@
  */
 function &notificationCommentCategoryInfo($module_id=null)
 {
+	$ret = false;
 	$all_categories =& notificationCategoryInfo ('', $module_id);
 	if (empty($all_categories)) {
-		return false;
+		return $ret;
 	}
 	foreach ($all_categories as $category) {
 		$all_events =& notificationEvents ($category['name'], false, $module_id);
@@ -134,7 +137,7 @@
 			}
 		}
 	}
-	return false;
+	return $ret;
 }
 
 // TODO: some way to include or exclude admin-only events...
@@ -171,7 +174,8 @@
 	$override_commentsubmit = false;
 	$override_bookmark = false;
 	
-	foreach ($not_config['event'] as $event) {
+	foreach (array_keys($not_config['event']) as $key) {
+		$event =& $not_config['event'][$key];
 		if ($event['category'] == $category_name) {
 			$event['mail_template_dir'] = XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/mail_template/';
 			if (!$enabled_only || notificationEventEnabled ($category, $event, $module)) {
@@ -306,7 +310,8 @@
 			return $event;
 		}
 	}
-	return false;
+	$ret = false;
+	return $ret;
 }
 
 
@@ -329,7 +334,8 @@
 
 	$sub_categories = array();
 
-	foreach ($all_categories as $category) {
+	foreach (array_keys($all_categories) as $key) {
+		$category =& $all_categories[$key];
 
 		// Check the script name
 
diff -ruN 2.2.3a-Final.src/include/notification_select.php 2.2.6.src/include/notification_select.php
--- 2.2.3a-Final.src/include/notification_select.php	2005-06-21 11:34:49.000000000 -0500
+++ 2.2.6.src/include/notification_select.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: notification_select.php,v 1.8.8.3 2005/06/21 17:34:49 mithyt2 Exp $
+// $Id: notification_select.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/include/notification_update.php 2.2.6.src/include/notification_update.php
--- 2.2.3a-Final.src/include/notification_update.php	2005-03-31 11:39:26.000000000 -0600
+++ 2.2.6.src/include/notification_update.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: notification_update.php,v 1.5.8.2 2005/03/31 18:39:26 mithyt2 Exp $
+// $Id: notification_update.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -118,7 +118,7 @@
         $argstring .= "?" . $arg . "=" . $redirect_args[$arg];
         $first_arg = 0;
     } else {
-        $argstring .= "&" . $arg . "=" . $redirect_args[$arg];
+		$argstring .= "&amp;" . $arg . "=" . $redirect_args[$arg];
     }
 }
 
diff -ruN 2.2.3a-Final.src/include/old_theme_functions.php 2.2.6.src/include/old_theme_functions.php
--- 2.2.3a-Final.src/include/old_theme_functions.php	2003-02-12 05:34:53.000000000 -0600
+++ 2.2.6.src/include/old_theme_functions.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: old_theme_functions.php,v 1.6 2003/02/12 11:34:53 okazu Exp $
+// $Id: old_theme_functions.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/include/registerform.php 2.2.6.src/include/registerform.php
--- 2.2.3a-Final.src/include/registerform.php	2005-08-14 13:17:51.000000000 -0500
+++ 2.2.6.src/include/registerform.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: registerform.php,v 1.10.6.1.2.2 2005/08/14 19:17:51 skalpa Exp $
+// $Id: registerform.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/include/searchform.php 2.2.6.src/include/searchform.php
--- 2.2.3a-Final.src/include/searchform.php	2005-08-14 13:17:51.000000000 -0500
+++ 2.2.6.src/include/searchform.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: searchform.php,v 1.10.10.2 2005/08/14 19:17:51 skalpa Exp $
+// $Id: searchform.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/include/version.php 2.2.6.src/include/version.php
--- 2.2.3a-Final.src/include/version.php	2005-10-28 10:41:45.000000000 -0500
+++ 2.2.6.src/include/version.php	2008-01-08 16:11:50.000000000 -0600
@@ -1,4 +1,4 @@
 <?php
-// $Id: version.php,v 1.18.4.9 2005/08/14 18:38:14 mithyt2 Exp $
-define("XOOPS_VERSION","XOOPS 2.2.3 Final");
+// $Id: version.php 1230 2008-01-08 22:11:50Z phppp $
+define("XOOPS_VERSION","XOOPS 2.2.6");
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/include/xoopscodes.php 2.2.6.src/include/xoopscodes.php
--- 2.2.3a-Final.src/include/xoopscodes.php	2005-05-01 07:45:03.000000000 -0500
+++ 2.2.6.src/include/xoopscodes.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoopscodes.php,v 1.13.8.2 2005/05/01 13:45:03 mithyt2 Exp $
+// $Id: xoopscodes.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -102,6 +102,6 @@
 		}
 	}
 	//hack for more
-	echo "&nbsp;[<a href='#moresmiley' onmouseover='style.cursor=\"hand\"' onclick='openWithSelfMain(\"".XOOPS_URL."/misc.php?action=showpopups&amp;type=smilies&amp;target=".$textarea_id."\",\"smilies\",300,475);'>"._MORE."</a>]";
+	echo "&nbsp;[<a href='#moresmiley' onmouseover='style.cursor=\"hand\"' alt='' onclick='openWithSelfMain(\"".XOOPS_URL."/misc.php?action=showpopups&amp;type=smilies&amp;target=".$textarea_id."\",\"smilies\",300,475);'>"._MORE."</a>]";
 }  //fin du hack
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/include/xoops.js 2.2.6.src/include/xoops.js
--- 2.2.3a-Final.src/include/xoops.js	2005-07-06 12:04:51.000000000 -0500
+++ 2.2.6.src/include/xoops.js	2007-09-09 00:44:27.000000000 -0500
@@ -1,13 +1,26 @@
+
+if ( typeof window.$ != 'function' ) {
+function $() {
+  var elements = new Array();
+
+  for (var i = 0; i < arguments.length; i++) {
+    var element = arguments[i];
+    if (typeof element == 'string')
+      element = document.getElementById(element);
+
+    if (arguments.length == 1)
+      return element;
+
+    elements.push(element);
+  }
+
+  return elements;
+}
+}
+
+	
 function xoopsGetElementById(id){
-	if (document.getElementById) {
-		return (document.getElementById(id));
-	} else if (document.all) {
-		return (document.all[id]);
-	} else {
-		if ((navigator.appname.indexOf("Netscape") != -1) && parseInt(navigator.appversion == 4)) {
-			return (document.layers[id]);
-		}
-	}
+	return $(id);
 }
 
 function xoopsSetElementProp(name, prop, val) {
@@ -108,8 +121,8 @@
 function appendSelectOption(selectMenuId, optionName, optionValue){
 	var selectMenu = xoopsGetElementById(selectMenuId);
 	var newoption = new Option(optionName, optionValue);
-	newoption.selected = true;
-	selectMenu.options[selectMenu.options.length] = newoption;
+	selectMenu.options[selectMenu.length] = newoption;
+	selectMenu.options[selectMenu.length].selected = true;
 }
 
 function disableElement(target){
@@ -120,26 +133,36 @@
 		targetDom.disabled = false;
 	}
 }
-function xoopsCheckAll(formname, switchid) {
-	var ele = document.forms[formname].elements;
-	var switch_cbox = xoopsGetElementById(switchid);
-	for (var i = 0; i < ele.length; i++) {
-		var e = ele[i];
-		if ( (e.name != switch_cbox.name) && (e.type == 'checkbox') ) {
-			e.checked = switch_cbox.checked;
+
+function xoopsCheckAll( form, switchId ) {
+	var eltForm = $(form);
+	var eltSwitch = $(switchId);
+	// You MUST NOT specify names, it's just kept for BC with the old lame crappy code
+	if ( !eltForm && document.forms[form] )		eltForm = document.forms[form];
+	if ( !eltSwitch && eltForm.elements[switchId] )	eltSwitch=eltForm.elements[switchId];
+	
+	var i;
+	for (i=0;i!=eltForm.elements.length;i++) {
+		if ( eltForm.elements[i] != eltSwitch && eltForm.elements[i].type == 'checkbox' ) {
+			eltForm.elements[i].checked = eltSwitch.checked;
 		}
 	}
 }
-
-function xoopsCheckGroup(formname, switchid, groupid) {
-	var ele = document.forms[formname].elements;
-	var switch_cbox = xoopsGetElementById(switchid);
-	for (var i = 0; i < ele.length; i++) {
-		var e = ele[i];
-		if ( (e.type == 'checkbox') && (e.id == groupid) ) {
-			e.checked = switch_cbox.checked;
-			e.click(); e.click();  // Click to activate subgroups
-									// Twice so we don't reverse effect
+	
+
+function xoopsCheckGroup( form, switchId, groupName ) {
+	var eltForm = $(form);
+	var eltSwitch = $(switchId);
+	// You MUST NOT specify names, it's just kept for BC with the old lame crappy code
+	if ( !eltForm && document.forms[form] )		eltForm = document.forms[form];
+	if ( !eltSwitch && eltForm.elements[switchId] )	eltSwitch=eltForm.elements[switchId];
+
+	var i;
+	for (i=0;i!=eltForm.elements.length;i++) {
+		var e=eltForm.elements[i];
+		if ( (e.type == 'checkbox') && ( e.name == groupName ) ) {
+			e.checked = eltSwitch.checked;
+			e.click(); e.click();  // Click to activate subgroups twice so we don't reverse effect
 		}
 	}
 }
@@ -207,9 +230,6 @@
 	if (enterUrlPhrase == null) {
 		enterUrlPhrase = "Enter the URL of the link you want to add:";
 	}
-	if (enterWebsitePhrase == null) {
-		enterWebsitePhrase = "Enter the web site title:";
-	}
 	var text = prompt(enterUrlPhrase, "");
 	var domobj = xoopsGetElementById(id);
 	if ( text != null && text != "" ) {
diff -ruN 2.2.3a-Final.src/index.php 2.2.6.src/index.php
--- 2.2.3a-Final.src/index.php	2005-04-03 03:59:42.000000000 -0500
+++ 2.2.6.src/index.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: index.php,v 1.8.22.1 2005/04/03 09:59:42 mithyt2 Exp $
+// $Id: index.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/install/class/cachemanager.php 2.2.6.src/install/class/cachemanager.php
--- 2.2.3a-Final.src/install/class/cachemanager.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/class/cachemanager.php	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,64 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+
+/**
+* cache_manager for XOOPS installer
+*
+* @author Haruki Setoyama  <haruki@planewave.org>
+* @version $Id: cachemanager.php 184 2006-01-22 22:34:51Z skalpa $
+* @access public
+**/
+class cache_manager {
+
+    var $s_files = array();
+    var $f_files = array();
+
+    function write($file, $source){
+        if (false != $fp = fopen(XOOPS_CACHE_PATH.'/'.$file, 'w')) {
+            fwrite($fp, $source);
+            fclose($fp);
+            $this->s_files[] = $file;
+        }else{
+            $this->f_files[] = $file;
+        }
+    }
+
+    function report(){
+        $content = "<table align='center'><tr><td align='left'>\n";
+        foreach($this->s_files as $val){
+            $content .= _OKIMG.sprintf(_INSTALL_L123, "<b>$val</b>")."<br />\n";
+        }
+        foreach($this->f_files as $val){
+            $content .= _NGIMG.sprintf(_INSTALL_L124, "<b>$val</b>")."<br />\n";
+        }
+        $content .= "</td></tr></table>\n";
+        return $content;
+    }
+
+}
+
+
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/class/dbmanager.php 2.2.6.src/install/class/dbmanager.php
--- 2.2.3a-Final.src/install/class/dbmanager.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/class/dbmanager.php	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,244 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+include_once XOOPS_ROOT_PATH.'/class/logger.php';
+include_once XOOPS_ROOT_PATH.'/class/database/databasefactory.php';
+include_once XOOPS_ROOT_PATH.'/class/database/'.XOOPS_DB_TYPE.'database.php';
+include_once XOOPS_ROOT_PATH.'/class/database/sqlutility.php';
+
+/**
+* database manager for XOOPS installer
+*
+* @author Haruki Setoyama  <haruki@planewave.org>
+* @version $Id: dbmanager.php 184 2006-01-22 22:34:51Z skalpa $
+* @access public
+**/
+class db_manager {
+
+    var $s_tables = array();
+    var $f_tables = array();
+	var $db;
+
+    function db_manager(){
+        $this->db = XoopsDatabaseFactory::getDatabase();
+        $this->db->setPrefix(XOOPS_DB_PREFIX);
+        $this->db->setLogger(XoopsLogger::instance());
+    }
+
+    function isConnectable(){
+        return ($this->db->connect(false) != false) ? true : false;
+    }
+    
+    function dbExists(){
+        return ($this->db->connect() != false) ? true : false;
+    }
+    
+    function createDB()
+    {
+        $this->db->connect(false);
+    
+        $result = $this->db->query("CREATE DATABASE ".XOOPS_DB_NAME);
+    
+        return ($result != false) ? true : false;
+    }
+
+    function queryFromFile($sql_file_path){
+        $tables = array();
+
+        if (!file_exists($sql_file_path)) {
+            return false;
+        }
+        $sql_query = trim(fread(fopen($sql_file_path, 'r'), filesize($sql_file_path)));
+        SqlUtility::splitMySqlFile($pieces, $sql_query);
+        $this->db->connect();
+        foreach ($pieces as $piece) {
+            $piece = trim($piece);
+            // [0] contains the prefixed query
+            // [4] contains unprefixed table name
+            $prefixed_query = SqlUtility::prefixQuery($piece, $this->db->prefix());
+            if ($prefixed_query != false ) {
+                $table = $this->db->prefix($prefixed_query[4]);
+                if($prefixed_query[1] == 'CREATE TABLE'){
+                    if ($this->db->query($prefixed_query[0]) != false) {
+                        if(! isset($this->s_tables['create'][$table])){
+                            $this->s_tables['create'][$table] = 1;
+                        }
+                    }else{
+                        if(! isset($this->f_tables['create'][$table])){
+                            $this->f_tables['create'][$table] = 1;
+                        }
+                    }
+                }
+                elseif($prefixed_query[1] == 'INSERT INTO'){
+                    if ($this->db->query($prefixed_query[0]) != false) {
+                        if(! isset($this->s_tables['insert'][$table])){
+                            $this->s_tables['insert'][$table] = 1;
+                        }else{
+                            $this->s_tables['insert'][$table]++;
+                        }
+                    }else{
+                        if(! isset($this->f_tables['insert'][$table])){
+                            $this->f_tables['insert'][$table] = 1;
+                        }else{
+                             $this->f_tables['insert'][$table]++;
+                        }
+                    }
+                }elseif($prefixed_query[1] == 'ALTER TABLE'){
+                    if ($this->db->query($prefixed_query[0]) != false) {
+                        if(! isset($this->s_tables['alter'][$table])){
+                            $this->s_tables['alter'][$table] = 1;
+                        }
+                    }else{
+                        if(! isset($this->s_tables['alter'][$table])){
+                            $this->f_tables['alter'][$table] = 1;
+                        }
+                    }
+                }elseif($prefixed_query[1] == 'DROP TABLE'){
+                    if ($this->db->query('DROP TABLE '.$table) != false) {
+                        if(! isset($this->s_tables['drop'][$table])){
+                            $this->s_tables['drop'][$table] = 1;
+                        }
+                    }else{
+                        if(! isset($this->s_tables['drop'][$table])){
+                            $this->f_tables['drop'][$table] = 1;
+                        }
+                    }
+                }
+            }
+        }
+        return true;
+    }
+
+    function report(){
+        $content = "<table align='center'><tr><td align='left'>\n";
+        if (isset($this->s_tables['create'])) {
+            foreach($this->s_tables['create'] as $key => $val){
+                $content .= _OKIMG.sprintf(_INSTALL_L45, "<b>$key</b>")."<br />\n";
+            }
+        }
+        if (isset($this->s_tables['insert'])) {
+            foreach($this->s_tables['insert'] as $key => $val){
+                $content .= _OKIMG.sprintf(_INSTALL_L119, $val, "<b>$key</b>")."<br />\n";
+            }
+        }
+		if (isset($this->s_tables['alter'])) {
+            foreach($this->s_tables['alter'] as $key => $val){
+                $content .= _OKIMG.sprintf(_INSTALL_L133, "<b>$key</b>")."<br />\n";
+            }
+        }
+		if (isset($this->s_tables['drop'])) {
+            foreach($this->s_tables['drop'] as $key => $val){
+                $content .= _OKIMG.sprintf(_INSTALL_L163, "<b>$key</b>")."<br />\n";
+            }
+        }
+        $content .= "<br />\n";
+        if (isset($this->f_tables['create'])) {
+            foreach($this->f_tables['create'] as $key => $val){
+                $content .= _NGIMG.sprintf(_INSTALL_L118, "<b>$key</b>")."<br />\n";
+            }
+        }
+        if (isset($this->f_tables['insert'])) {
+            foreach($this->f_tables['insert'] as $key => $val){
+                $content .= _NGIMG.sprintf(_INSTALL_L120, $val, "<b>$key</b>")."<br />\n";
+            }
+        }
+		if (isset($this->f_tables['alter'])) {
+            foreach($this->f_tables['alter'] as $key => $val){
+                $content .= _NGIMG.sprintf(_INSTALL_L134, "<b>$key</b>")."<br />\n";
+            }
+        }
+		if (isset($this->f_tables['drop'])) {
+            foreach($this->f_tables['drop'] as $key => $val){
+                $content .= _NGIMG.sprintf(_INSTALL_L164, "<b>$key</b>")."<br />\n";
+            }
+        }
+        $content .= "</td></tr></table>\n";
+        return $content;
+    }
+
+    function query($sql){
+        $this->db->connect();
+        return $this->db->query($sql);
+    }
+
+    function prefix($table){
+        $this->db->connect();
+        return $this->db->prefix($table);
+    }
+
+    function fetchArray($ret){
+        $this->db->connect();
+        return $this->db->fetchArray($ret);
+    }
+
+    function insert($table, $query){
+        $this->db->connect();
+        $table = $this->db->prefix($table);
+        $query = 'INSERT INTO '.$table.' '.$query;
+        if(!$this->db->queryF($query)){
+            if(!isset($this->f_tables['insert'][$table])){
+                $this->f_tables['insert'][$table] = 1;
+            }else{
+                $this->f_tables['insert'][$table]++;
+            }
+            return false;
+        }else{
+            if(!isset($this->s_tables['insert'][$table])){
+                $this->s_tables['insert'][$table] = 1;
+            }else{
+                $this->s_tables['insert'][$table]++;
+            }
+            return $this->db->getInsertId();
+        }
+    }
+
+    function isError(){
+        return (isset($this->f_tables)) ? true : false;
+    }
+
+    function deleteTables($tables){
+        $deleted = array();
+        $this->db->connect();
+        foreach ($tables as $key => $val) {
+            if(! $this->db->query("DROP TABLE ".$this->db->prefix($key))){
+                $deleted[] = $ct;
+            }
+        }
+        return $deleted;
+    }
+
+	function tableExists($table){
+		$table = trim($table);
+		$ret = false;
+		if ($table != '') {
+            $this->db->connect();
+			$sql = 'SELECT * FROM '.$this->db->prefix($table);
+			$ret = (false != $this->db->query($sql)) ? true : false;
+		}
+		return $ret;
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/class/mainfilemanager.php 2.2.6.src/install/class/mainfilemanager.php
--- 2.2.3a-Final.src/install/class/mainfilemanager.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/class/mainfilemanager.php	2007-09-09 00:44:27.000000000 -0500
@@ -0,0 +1,119 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+
+/**
+* mainfile manager for XOOPS installer
+*
+* @author Haruki Setoyama  <haruki@planewave.org>
+* @version $Id: mainfilemanager.php 1030 2007-09-09 05:44:27Z phppp $
+* @access public
+**/
+class mainfile_manager {
+
+    var $path = '../mainfile.php';
+    var $distfile = '../mainfile.dist.php';
+    var $rewrite = array();
+
+    var $report = '';
+    var $error = false;
+
+    function mainfile_manager(){
+        //
+    }
+
+    function setRewrite($def, $val){
+        $this->rewrite[$def] = $val;
+    }
+
+    function copyDistFile(){
+        if ( ! copy($this->distfile, $this->path) ) {
+            $this->report .= _NGIMG.sprintf(_INSTALL_L126, "<b>".$this->path."</b>")."<br />\n";
+            $this->error = true;
+            return false;
+        }
+        $this->report .= _OKIMG.sprintf(_INSTALL_L125, "<b>".$this->path."</b>", "<b>".$this->distfile."</b>")."<br />\n";
+        return true;
+    }
+
+    function doRewrite() {
+    	clearstatcache();
+        if ( ! $file = fopen($this->path,"r") ) {
+            $this->error = true;
+            return false;
+        }
+        $content = fread($file, filesize($this->path) );
+        fclose($file);
+
+        foreach($this->rewrite as $key => $val){
+            if(is_int($val) &&
+             preg_match("/(define\()([\"'])(".$key.")\\2,\s*([0-9]+)\s*\)/",$content)){
+
+                $content = preg_replace("/(define\()([\"'])(".$key.")\\2,\s*([0-9]+)\s*\)/"
+                , "define('".$key."', ".$val.")"
+                , $content);
+                $this->report .= _OKIMG.sprintf(_INSTALL_L121, "<b>$key</b>", $val)."<br />\n";
+            }
+            elseif(preg_match("/(define\()([\"'])(".$key.")\\2,\s*([\"'])(.*?)\\4\s*\)/",$content)){
+                $content = preg_replace("/(define\()([\"'])(".$key.")\\2,\s*([\"'])(.*?)\\4\s*\)/"
+                , "define('".$key."', '".$val."')"
+                , $content);
+                $this->report .= _OKIMG.sprintf(_INSTALL_L121, "<b>$key</b>", $val)."<br />\n";
+
+            }else{
+                $this->error = true;
+                $this->report .= _NGIMG.sprintf(_INSTALL_L122, "<b>$key</b>", $val)."<br />\n";
+            }
+        }
+
+        if ( !$file = fopen($this->path,"w") ) {
+            $this->error = true;
+            return false;
+        }
+
+        if ( fwrite($file,$content) == -1 ) {
+            fclose($file);
+            $this->error = true;
+            return false;
+        }
+
+        fclose($file);
+
+        return true;
+    }
+
+    function report(){
+        $content = "<table align='center'><tr><td align='left'>\n";
+        $content .= $this->report;
+        $content .= "</td></tr></table>\n";
+        return $content;
+    }
+
+    function error(){
+        return $this->error;
+    }
+}
+
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/class/settingmanager.php 2.2.6.src/install/class/settingmanager.php
--- 2.2.3a-Final.src/install/class/settingmanager.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/class/settingmanager.php	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,297 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+include_once './class/textsanitizer.php';
+
+/**
+* setting manager for XOOPS installer
+*
+* @author Haruki Setoyama  <haruki@planewave.org>
+* @version $Id: settingmanager.php 184 2006-01-22 22:34:51Z skalpa $
+* @access public
+**/
+class setting_manager {
+
+    var $database;
+    var $dbhost;
+    var $dbuname;
+    var $dbpass;
+    var $dbname;
+    var $prefix;
+    var $db_pconnect;
+    var $root_path;
+    var $xoops_url;
+
+    var $sanitizer;
+
+    function setting_manager($post=false){
+
+        $this->sanitizer =& TextSanitizer::getInstance();
+        if($post){
+            $this->readPost();
+        }else{
+            $this->database = 'mysql';
+            $this->dbhost = 'localhost';
+            $this->db_pconnect = 0;
+
+            $this->root_path = str_replace("\\","/",getcwd()); // "
+            $this->root_path = str_replace("/install", "", $this->root_path);
+
+            $filepath = (! empty($_SERVER['REQUEST_URI']))
+                            ? dirname($_SERVER['REQUEST_URI'])
+                            : dirname($_SERVER['SCRIPT_NAME']);
+
+            $filepath = str_replace("\\", "/", $filepath); // "
+            $filepath = str_replace("/install", "", $filepath);
+            if ( substr($filepath, 0, 1) == "/" ) {
+                $filepath = substr($filepath,1);
+            }
+            if ( substr($filepath, -1) == "/" ) {
+                $filepath = substr($filepath, 0, -1);
+            }
+            $protocol = isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
+            $this->xoops_url = (!empty($filepath)) ? $protocol.$_SERVER['HTTP_HOST']."/".$filepath : $protocol.$_SERVER['HTTP_HOST'];
+            //$this->xoops_url = (!empty($filepath)) ? "/".$filepath : $protocol.$_SERVER['HTTP_HOST'];
+            $this->prefix = $this->generatePrefix();
+        }
+    }
+
+    function readPost(){
+        if(isset($_POST['database']))
+            $this->database = $this->sanitizer->stripSlashesGPC($_POST['database']);
+        if(isset($_POST['dbhost']))
+            $this->dbhost = $this->sanitizer->stripSlashesGPC($_POST['dbhost']);
+        if(isset($_POST['dbuname']))
+            $this->dbuname = $this->sanitizer->stripSlashesGPC($_POST['dbuname']);
+        if(isset($_POST['dbpass']))
+            $this->dbpass = $this->sanitizer->stripSlashesGPC($_POST['dbpass']);
+        if(isset($_POST['dbname']))
+            $this->dbname = $this->sanitizer->stripSlashesGPC($_POST['dbname']);
+        if(isset($_POST['prefix']))
+            $this->prefix = $this->sanitizer->stripSlashesGPC($_POST['prefix']);
+        if(isset($_POST['db_pconnect']))
+            $this->db_pconnect = intval($_POST['db_pconnect']) > 0 ? 1 : 0;
+        if(isset($_POST['root_path']))
+            $this->root_path = $this->sanitizer->stripSlashesGPC($_POST['root_path']);
+        if(isset($_POST['xoops_url']))
+            $this->xoops_url = $this->sanitizer->stripSlashesGPC($_POST['xoops_url']);
+    }
+
+    function readConstant(){
+        if(defined('XOOPS_DB_TYPE'))
+            $this->database = XOOPS_DB_TYPE;
+        if(defined('XOOPS_DB_HOST'))
+            $this->dbhost = XOOPS_DB_HOST;
+        if(defined('XOOPS_DB_USER'))
+            $this->dbuname = XOOPS_DB_USER;
+        if(defined('XOOPS_DB_PASS'))
+            $this->dbpass = XOOPS_DB_PASS;
+        if(defined('XOOPS_DB_NAME'))
+            $this->dbname = XOOPS_DB_NAME;
+        if(defined('XOOPS_DB_PREFIX'))
+            $this->prefix = XOOPS_DB_PREFIX;
+        if(defined('XOOPS_DB_PCONNECT'))
+            $this->db_pconnect = intval(XOOPS_DB_PCONNECT) > 0 ? 1 : 0;
+        if(defined('XOOPS_ROOT_PATH'))
+            $this->root_path = XOOPS_ROOT_PATH;
+        if(defined('XOOPS_URL'))
+            $this->xoops_url = XOOPS_URL;
+    }
+
+    function checkData(){
+        $ret = '';
+        $error = array();
+
+        if ( empty($this->dbhost) ) {
+            $error[] = sprintf(_INSTALL_L57, _INSTALL_L27);
+        }
+        if ( empty($this->dbname) ) {
+            $error[] = sprintf(_INSTALL_L57, _INSTALL_L29);
+        }
+        if ( empty($this->prefix) ) {
+            $error[] = sprintf(_INSTALL_L57, _INSTALL_L30);
+        }
+        if ( empty($this->root_path) ) {
+            $error[] = sprintf(_INSTALL_L57, _INSTALL_L55);
+        }
+        if ( empty($this->xoops_url) ) {
+            $error[] = sprintf(_INSTALL_L57, _INSTALL_L56);
+        }
+
+        if (!empty($error)) {
+            foreach ( $error as $err ) {
+                $ret .=  "<p><span style='color:#ff0000;'><b>".$err."</b></span></p>\n";
+            }
+        }
+
+        return $ret;
+    }
+
+    function editform(){
+        $ret =
+            "<table width='100%' class='outer' cellspacing='5'>
+                <tr>
+                    <th colspan='2'></th>
+                </tr>
+                <tr valign='top' align='left'>
+                    <td class='head'>
+                        <b>"._INSTALL_L51."</b><br />
+                        <span style='font-size:85%;'>"._INSTALL_L66."</span>
+                    </td>
+                    <td class='even'>
+                        <select  size='1' name='database' id='database'>";
+        $dblist = $this->getDBList();
+        foreach($dblist as $val){
+            $ret .= "<option value='$val'";
+            if($val == $this->database) $ret .= " selected='selected'";
+            $ret .= "'>$val</option>";
+        }
+        $ret .=         "</select>
+                    </td>
+                </tr>
+                ";
+        $ret .= $this->editform_sub(_INSTALL_L27, _INSTALL_L67, 'dbhost', $this->sanitizer->htmlSpecialChars($this->dbhost));
+        $ret .= $this->editform_sub(_INSTALL_L28, _INSTALL_L65, 'dbuname', $this->sanitizer->htmlSpecialChars($this->dbuname));
+        $ret .= $this->editform_sub(_INSTALL_L52, _INSTALL_L68, 'dbpass', $this->sanitizer->htmlSpecialChars($this->dbpass));
+        $ret .= $this->editform_sub(_INSTALL_L29, _INSTALL_L64, 'dbname', $this->sanitizer->htmlSpecialChars($this->dbname));
+        $ret .= $this->editform_sub(_INSTALL_L30, _INSTALL_L63, 'prefix', $this->sanitizer->htmlSpecialChars($this->prefix));
+
+        $ret .= "<tr valign='top' align='left'>
+                    <td class='head'>
+                        <b>"._INSTALL_L54."</b><br />
+                        <span style='font-size:85%;'>"._INSTALL_L69."</span>
+                    </td>
+                    <td class='even'>
+                        <input type='radio' name='db_pconnect' value='1'".($this->db_pconnect == 1 ? " checked='checked'" : "" )." />"._INSTALL_L23."
+                        <input type='radio' name='db_pconnect' value='0'".($this->db_pconnect != 1 ? " checked='checked'" : "" )." />"._INSTALL_L24."
+                    </td>
+                </tr>
+                ";
+
+        $ret .= $this->editform_sub(_INSTALL_L55, _INSTALL_L59, 'root_path', $this->sanitizer->htmlSpecialChars($this->root_path));
+        $ret .= $this->editform_sub(_INSTALL_L56, _INSTALL_L58, 'xoops_url', $this->sanitizer->htmlSpecialChars($this->xoops_url));
+
+        $ret .= "</table>";
+        return $ret;
+    }
+
+    function editform_sub($title, $desc, $name, $value){
+        return  "<tr valign='top' align='left'>
+                    <td class='head'>
+                        <b>".$title."</b><br />
+                        <span style='font-size:85%;'>".$desc."</span>
+                    </td>
+                    <td class='even'>
+                        <input type='text' name='".$name."' id='".$name."' size='30' maxlength='100' value='".htmlspecialchars($value)."' />
+                    </td>
+                </tr>
+                ";
+    }
+
+    function confirmForm(){
+        $yesno = empty($this->db_pconnect) ? _INSTALL_L24 : _INSTALL_L23;
+        $ret =
+            "<table border='0' cellpadding='0' cellspacing='0' valign='top' width='90%'><tr><td class='bg2'>
+                <table width='100%' border='0' cellpadding='4' cellspacing='1'>
+                    <tr>
+                        <td class='bg3'><b>"._INSTALL_L51."</b></td>
+                        <td class='bg1'>".$this->sanitizer->htmlSpecialChars($this->database)."</td>
+                    </tr>
+                    <tr>
+                        <td class='bg3'><b>"._INSTALL_L27."</b></td>
+                        <td class='bg1'>".$this->sanitizer->htmlSpecialChars($this->dbhost)."</td>
+                    </tr>
+                    <tr>
+                        <td class='bg3'><b>"._INSTALL_L28."</b></td>
+                        <td class='bg1'>".$this->sanitizer->htmlSpecialChars($this->dbuname)."</td>
+                    </tr>
+                    <tr>
+                        <td class='bg3'><b>"._INSTALL_L52."</b></td>
+                        <td class='bg1'>".$this->sanitizer->htmlSpecialChars($this->dbpass)."</td>
+                    </tr>
+                    <tr>
+                        <td class='bg3'><b>"._INSTALL_L29."</b></td>
+                        <td class='bg1'>".$this->sanitizer->htmlSpecialChars($this->dbname)."</td>
+                    </tr>
+                    <tr>
+                        <td class='bg3'><b>"._INSTALL_L30."</b></td>
+                        <td class='bg1'>".$this->sanitizer->htmlSpecialChars($this->prefix)."</td>
+                    </tr>
+                    <tr>
+                        <td class='bg3'><b>"._INSTALL_L54."</b></td>
+                        <td class='bg1'>".$yesno."</td>
+                    </tr>
+                    <tr>
+                        <td class='bg3'><b>"._INSTALL_L55."</b></td>
+                        <td class='bg1'>".$this->sanitizer->htmlSpecialChars($this->root_path)."</td>
+                    </tr>
+                    <tr>
+                        <td class='bg3'><b>"._INSTALL_L56."</b></td>
+                        <td class='bg1'>".$this->sanitizer->htmlSpecialChars($this->xoops_url)."</td>
+                    </tr>
+                </table></td></tr>
+            </table>
+            <input type='hidden' name='database' value='".$this->sanitizer->htmlSpecialChars($this->database)."' />
+            <input type='hidden' name='dbhost' value='".$this->sanitizer->htmlSpecialChars($this->dbhost)."' />
+            <input type='hidden' name='dbuname' value='".$this->sanitizer->htmlSpecialChars($this->dbuname)."' />
+            <input type='hidden' name='dbpass' value='".$this->sanitizer->htmlSpecialChars($this->dbpass)."' />
+            <input type='hidden' name='dbname' value='".$this->sanitizer->htmlSpecialChars($this->dbname)."' />
+            <input type='hidden' name='prefix' value='".$this->sanitizer->htmlSpecialChars($this->prefix)."' />
+            <input type='hidden' name='db_pconnect' value='".intval($this->db_pconnect)."' />
+            <input type='hidden' name='root_path' value='".$this->sanitizer->htmlSpecialChars($this->root_path)."' />
+            <input type='hidden' name='xoops_url' value='".$this->sanitizer->htmlSpecialChars($this->xoops_url)."' />
+            ";
+        return $ret;
+    }
+
+
+    function getDBList()
+    {
+		return array('mysql');
+        //$dirname = '../class/database/';
+        //$dirlist = array();
+        //if (is_dir($dirname) && $handle = opendir($dirname)) {
+        //    while (false !== ($file = readdir($handle))) {
+        //        if ( !preg_match("/^[.]{1,2}$/",$file) ) {
+        //            if (strtolower($file) != 'cvs' && is_dir($dirname.$file) ) {
+        //                $dirlist[$file] = strtolower($file);
+        //            }
+        //        }
+        //   }
+        //    closedir($handle);
+        //    asort($dirlist);
+        //    reset($dirlist);
+        //}
+        //return $dirlist;
+    }
+
+    function generatePrefix() {
+        include_once $this->root_path."/include/functions.php";
+        return xoops_makepass(5);
+    }
+}
+
+
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/class/textsanitizer.php 2.2.6.src/install/class/textsanitizer.php
--- 2.2.3a-Final.src/install/class/textsanitizer.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/class/textsanitizer.php	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,253 @@
+<?php
+// $Id: textsanitizer.php 184 2006-01-22 22:34:51Z skalpa $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (http://www.myweb.ne.jp/, http://jp.xoops.org/)        //
+//         Goghs Cheng (http://www.eqiao.com, http://www.devbeez.com/)       //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+// This is subset and modified version of module.textsanitizer.php
+set_magic_quotes_runtime(0);
+
+class TextSanitizer
+{
+
+	/*
+	* Constructor of this class
+	* Gets allowed html tags from admin config settings
+	* <br> should not be allowed since nl2br will be used
+	* when storing data
+	*/
+	function TextSanitizer()
+	{
+
+	}
+
+	function &getInstance()
+	{
+		static $instance;
+		if (!isset($instance)) {
+			$instance = new TextSanitizer();
+		}
+		return $instance;
+	}
+
+	function makeClickable( $text )
+	{
+		$patterns = array("/([^]_a-z0-9-=\"'\/])([a-z]+?):\/\/([^, \r\n\"\(\)'<>]+)/i", "/([^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([^, \r\n\"\(\)'<>]+)/i", "/([^]_a-z0-9-=\"'\/])([a-z0-9\-_.]+?)@([^, \r\n\"\(\)'<>]+)/i");
+		$replacements = array("\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", "\\1<a href=\"http://www.\\2.\\3\" target=\"_blank\">www.\\2.\\3</a>", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>");
+		return preg_replace($patterns, $replacements, $text);
+	}
+
+	function nl2Br( $text )
+	{
+		return preg_replace("/(\015\012)|(\015)|(\012)/","<br />",$text);
+	}
+
+	function addSlashes( $text, $force = false )
+	{
+		if ( $force || !get_magic_quotes_gpc() ) {
+			return addslashes( $text );
+		}
+		return $text;
+	}
+
+	/*
+	* if magic_quotes_gpc is on, stirip back slashes
+	*/
+	function stripSlashesGPC($text)
+	{
+		return  ( get_magic_quotes_gpc() ? stripslashes($text) : $text );
+	}
+
+	/*
+	*  for displaying data in html textbox forms
+	*/
+	function htmlSpecialChars( $text )
+	{
+		return preg_replace("/&amp;/i", '&', htmlspecialchars($text, ENT_QUOTES));
+	}
+
+	function undoHtmlSpecialChars( $text )
+	{
+		return preg_replace(array("/&gt;/i", "/&lt;/i", "/&quot;/i", "/&#039;/i"), array(">", "<", "\"", "'"), $text);
+	}
+
+	/*
+	*  Filters textarea form data in DB for display
+	*/
+	function displayText( $text, $html = false )
+	{
+		if ( !$html ) {
+			// html not allowed
+			$text = $this->htmlSpecialChars($text);
+		}
+		$text = $this->makeClickable($text);
+		$text = $this->nl2Br($text);
+		return $text;
+	}
+
+	/*
+	*  Filters textarea form data submitted for preview
+	*/
+	function previewText($text, $html=false)
+	{
+		return $this->displayText( $this->stripSlashesGPC($text), $html);
+	}
+
+##################### Deprecated Methods ######################
+
+	function sanitizeForDisplay($text, $allowhtml = 0, $smiley = 1, $bbcode = 1)
+	{
+		if ( $allowhtml == 0 ) {
+			$text = $this->htmlSpecialChars($text);
+		} else {
+			//$config =& $GLOBALS['xoopsConfig'];
+			//$allowed = $config['allowed_html'];
+			//$text = strip_tags($text, $allowed);
+			$text = $this->makeClickable($text);
+		}
+		if ( $smiley == 1 ) {
+			$text = $this->smiley($text);
+		}
+		if ( $bbcode == 1 ) {
+			$text = $this->xoopsCodeDecode($text);
+		}
+		$text = $this->nl2Br($text);
+		return $text;
+	}
+
+	function sanitizeForPreview($text, $allowhtml = 0, $smiley = 1, $bbcode = 1)
+	{
+		$text = $this->oopsStripSlashesGPC($text);
+		if ( $allowhtml == 0 ) {
+			$text = $this->htmlSpecialChars($text);
+		} else {
+			//$config =& $GLOBALS['xoopsConfig'];
+			//$allowed = $config['allowed_html'];
+			//$text = strip_tags($text, $allowed);
+			$text = $this->makeClickable($text);
+		}
+		if ( $smiley == 1 ) {
+			$text = $this->smiley($text);
+		}
+		if ( $bbcode == 1 ) {
+			$text = $this->xoopsCodeDecode($text);
+		}
+		$text = $this->nl2Br($text);
+		return $text;
+	}
+
+	function makeTboxData4Save($text)
+	{
+		//$text = $this->undoHtmlSpecialChars($text);
+		return $this->addSlashes($text);
+	}
+
+	function makeTboxData4Show($text, $smiley=0)
+	{
+		$text = $this->htmlSpecialChars($text);
+		return $text;
+	}
+
+	function makeTboxData4Edit($text)
+	{
+		return $this->htmlSpecialChars($text);
+	}
+
+	function makeTboxData4Preview($text, $smiley=0)
+	{
+		$text = $this->stripSlashesGPC($text);
+		$text = $this->htmlSpecialChars($text);
+		return $text;
+	}
+
+	function makeTboxData4PreviewInForm($text)
+	{
+		$text = $this->stripSlashesGPC($text);
+		return $this->htmlSpecialChars($text);
+	}
+
+	function makeTareaData4Save($text)
+	{
+		return $this->addSlashes($text);
+	}
+
+	function &makeTareaData4Show(&$text, $html=1, $smiley=1, $xcode=1)
+	{
+		return $this->displayTarea($text, $html, $smiley, $xcode);
+	}
+
+	function makeTareaData4Edit($text)
+	{
+		return htmlSpecialChars($text, ENT_QUOTES);
+	}
+	
+	function &makeTareaData4Preview(&$text, $html=1, $smiley=1, $xcode=1)
+	{
+		return $this->previewTarea($text, $html, $smiley, $xcode);
+	}
+
+	function makeTareaData4PreviewInForm($text)
+	{
+		//if magic_quotes_gpc is on, do stipslashes
+		$text = $this->stripSlashesGPC($text);
+		return htmlSpecialChars($text, ENT_QUOTES);
+	}
+
+	function makeTareaData4InsideQuotes($text)
+	{
+		return $this->htmlSpecialChars($text);
+	}
+
+	function oopsStripSlashesGPC($text)
+	{
+		return $this->stripSlashesGPC($text);
+	}
+
+	function oopsStripSlashesRT($text)
+	{
+		if (get_magic_quotes_runtime()) {
+			$text = stripslashes($text);
+		}
+		return $text;
+	}
+
+	function oopsAddSlashes($text)
+	{
+		return $this->addSlashes($text);
+	}
+
+	function oopsHtmlSpecialChars($text)
+	{
+		return $this->htmlSpecialChars($text);
+	}
+
+	function oopsNl2Br($text)
+	{
+		return $this->nl2br($text);
+	}
+}
+?>
\ No newline at end of file
Binary files 2.2.3a-Final.src/install/img/bg_content_left.gif and 2.2.6.src/install/img/bg_content_left.gif differ
Binary files 2.2.3a-Final.src/install/img/bg_content_right.gif and 2.2.6.src/install/img/bg_content_right.gif differ
Binary files 2.2.3a-Final.src/install/img/bg_darkblue.gif and 2.2.6.src/install/img/bg_darkblue.gif differ
Binary files 2.2.3a-Final.src/install/img/bg_table.gif and 2.2.6.src/install/img/bg_table.gif differ
Binary files 2.2.3a-Final.src/install/img/dummy.gif and 2.2.6.src/install/img/dummy.gif differ
Binary files 2.2.3a-Final.src/install/img/hbar_installer_right.gif and 2.2.6.src/install/img/hbar_installer_right.gif differ
Binary files 2.2.3a-Final.src/install/img/hbar_left.gif and 2.2.6.src/install/img/hbar_left.gif differ
Binary files 2.2.3a-Final.src/install/img/hbar_middle.gif and 2.2.6.src/install/img/hbar_middle.gif differ
Binary files 2.2.3a-Final.src/install/img/hbar_right.gif and 2.2.6.src/install/img/hbar_right.gif differ
Binary files 2.2.3a-Final.src/install/img/logo.gif and 2.2.6.src/install/img/logo.gif differ
Binary files 2.2.3a-Final.src/install/img/no.gif and 2.2.6.src/install/img/no.gif differ
Binary files 2.2.3a-Final.src/install/img/xoops2.gif and 2.2.6.src/install/img/xoops2.gif differ
Binary files 2.2.3a-Final.src/install/img/yes.gif and 2.2.6.src/install/img/yes.gif differ
diff -ruN 2.2.3a-Final.src/install/index.php 2.2.6.src/install/index.php
--- 2.2.3a-Final.src/install/index.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/index.php	2006-01-22 17:49:01.000000000 -0600
@@ -0,0 +1,767 @@
+<?php
+// $Id: index.php 185 2006-01-22 23:49:01Z skalpa $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+
+error_reporting (E_ALL);
+
+include_once './passwd.php';
+if(INSTALL_USER != '' || INSTALL_PASSWD != ''){
+    if (!isset($_SERVER['PHP_AUTH_USER'])) {
+        header('WWW-Authenticate: Basic realm="XOOPS Installer"');
+        header('HTTP/1.0 401 Unauthorized');
+        echo 'You can not access this XOOPS installer.';
+        exit;
+    } else {
+        if(INSTALL_USER != '' && $_SERVER['PHP_AUTH_USER'] != INSTALL_USER){
+            header('HTTP/1.0 401 Unauthorized');
+            echo 'You can not access this XOOPS installer.';
+            exit;
+        }
+        if(INSTALL_PASSWD != $_SERVER['PHP_AUTH_PW']){
+            header('HTTP/1.0 401 Unauthorized');
+            echo 'You can not access this XOOPS installer.';
+            exit;
+        }
+    }
+}
+
+include_once './class/textsanitizer.php';
+$myts =& TextSanitizer::getInstance();
+
+if ( isset($_POST) ) {
+    foreach ($_POST as $k=>$v) {
+        if (!is_array($v)) {
+            $$k = $myts->stripSlashesGPC($v);
+        }
+    }
+}
+$xoopsConfig['language'] = 'english';
+if ( !empty($_POST['lang']) ) {
+    $xoopsConfig['language'] = $_POST['lang'];
+} else {
+	if (isset($_COOKIE['install_lang'])) {
+		$xoopsConfig['language'] = $_COOKIE['install_lang'];
+	} else {
+		//$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'ja,en-us;q=0.7,zh-TW;q=0.6';
+		if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+			$accept_langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+			$language_array = array('en' => 'english', 'ja' => 'japanese', 'fr' => 'french', 'de' => 'german', 'nl' => 'dutch', 'es' => 'spanish', 'tw' => 'tchinese', 'cn' => 'schinese', 'ro' => 'romanian');
+			foreach ($accept_langs as $al) {
+				$al = strtolower($al);
+				$al_len = strlen($al);
+				if ($al_len > 2) {
+					if (preg_match("/([a-z]{2});q=[0-9.]+$/", $al, $al_match)) {
+						$al = $al_match[1];
+					} else {
+						continue;
+					}
+				}
+				if (isset($language_array[$al])) {
+					$xoopsConfig['language'] = $language_array[$al];
+					break;
+				}
+			}
+		}
+	}
+}
+
+if ( file_exists("./language/".$xoopsConfig['language']."/install.php") ) {
+    include_once "./language/".$xoopsConfig['language']."/install.php";
+} elseif ( file_exists("./language/english/install.php") ) {
+    include_once "./language/english/install.php";
+    $xoopsConfig['language'] = 'english';
+} else {
+    echo 'no language file.';
+    exit();
+}
+setcookie("install_lang", $xoopsConfig['language']);
+
+//include './include/viewerrors.php';
+//include './include/functions.php';
+
+define('_OKIMG',"<img src='img/yes.gif' width='6' height='12' border='0' alt='' /> ");
+define('_NGIMG',"<img src='img/no.gif' width='6' height='12' border='0' alt='' /> ");
+
+$b_back = '';
+$b_reload = '';
+$b_next = '';
+
+// options for mainfile.php
+$xoopsOption['nocommon'] = true;
+define('XOOPS_INSTALL', 1);
+
+if(!empty($_POST['op']))
+    $op = $_POST['op'];
+elseif(!empty($_GET['op']))
+    $op = $_GET['op'];
+else
+    $op = '';
+
+///// main
+
+switch ($op) {
+
+default:
+case "langselect":
+    $title = _INSTALL_L0;
+	if (!defined('_INSTALL_L128')) {
+		define('_INSTALL_L128', 'Choose language to be used for the installation process');
+	}
+    $content = "<p>"._INSTALL_L128."</p>"
+              ."<select name='lang'>";
+
+    $langarr = getDirList("./language/");
+    foreach ($langarr as $lang) {
+        $content .= "<option value='".$lang."'";
+        if (strtolower($lang) == $xoopsConfig['language']) {
+            $content .= ' selected="selected"';
+        }
+        $content .= ">".$lang."</option>";
+    }
+    $content .= "</select>";
+
+    $b_next = array('start', _INSTALL_L80 );
+    include 'install_tpl.php';
+    break;
+
+case "start":
+    $title = _INSTALL_L0;
+    $content = "<table width='80%' align='center'><tr><td align='left'>\n";
+    include './language/'.$xoopsConfig['language'].'/welcome.php';
+    $content .= "</td></tr></table>\n";
+    $b_next = array('modcheck', _INSTALL_L81 );
+    include 'install_tpl.php';
+    break;
+
+case "modcheck":
+    $writeok = array("uploads/", "cache/", "templates_c/", "mainfile.php");
+    $title = _INSTALL_L82;
+    $content = "<table align='center'><tr><td align='left'>\n";
+    $error = false;
+    foreach ($writeok as $wok) {
+        if (!is_dir("../".$wok)) {
+            if ( file_exists("../".$wok) ) {
+                @chmod("../".$wok, 0666);
+                if (! is_writeable("../".$wok)) {
+                    $content .= _NGIMG.sprintf(_INSTALL_L83, $wok)."<br />";
+                    $error = true;
+                }else{
+                    $content .= _OKIMG.sprintf(_INSTALL_L84, $wok)."<br />";
+                }
+            }
+        } else {
+            @chmod("../".$wok, 0777);
+            if (! is_writeable("../".$wok)) {
+                $content .= _NGIMG.sprintf(_INSTALL_L85, $wok)."<br />";
+                $error = true;
+            }else{
+                $content .= _OKIMG.sprintf(_INSTALL_L86, $wok)."<br />";
+            }
+        }
+    }
+    $content .= "</td></tr></table>\n";
+
+    if(! $error) {
+        $content .= "<p>"._INSTALL_L87."</p>";
+        $b_next = array('dbform', _INSTALL_L89 );
+    }else{
+        $content .= "<p>"._INSTALL_L46."</p>";
+        $b_reload = true;
+    }
+
+    include 'install_tpl.php';
+    break;
+
+case "dbform":
+    include_once '../mainfile.php';
+    include_once 'class/settingmanager.php';
+    $sm = new setting_manager();
+    $sm->readConstant();
+    $content = $sm->editform();
+    $title = _INSTALL_L90;
+    $b_next = array('dbconfirm',_INSTALL_L91);
+    include 'install_tpl.php';
+    break;
+
+case "dbconfirm":
+    include_once 'class/settingmanager.php';
+    $sm = new setting_manager(true);
+
+    $content = $sm->checkData();
+    if (!empty($content)) {
+        $content .= $sm->editform();
+        $b_next = array('dbconfirm',_INSTALL_L91);
+        include 'install_tpl.php';
+        break;
+    }
+
+    $title = _INSTALL_L53;
+    $content = $sm->confirmForm();
+    $b_next = array('dbsave',_INSTALL_L92 );
+    $b_back = array('', _INSTALL_L93 );
+    include 'install_tpl.php';
+    break;
+
+case "dbsave":
+    include_once "./class/mainfilemanager.php";
+    $title = _INSTALL_L88;
+    $mm = new mainfile_manager("../mainfile.php");
+
+    $ret = $mm->copyDistFile();
+    if(! $ret){
+        $content = _INSTALL_L60;
+        include 'install_tpl.php';
+        exit();
+    }
+
+    $mm->setRewrite('XOOPS_ROOT_PATH', trim($myts->stripSlashesGPC($_POST['root_path'])));
+    $mm->setRewrite('XOOPS_URL', trim($myts->stripSlashesGPC($_POST['xoops_url'])));
+    $mm->setRewrite('XOOPS_DB_TYPE', trim($myts->stripSlashesGPC($_POST['database'])));
+    $mm->setRewrite('XOOPS_DB_PREFIX', trim($myts->stripSlashesGPC($_POST['prefix'])));
+    $mm->setRewrite('XOOPS_DB_HOST', trim($myts->stripSlashesGPC($_POST['dbhost'])));
+    $mm->setRewrite('XOOPS_DB_USER', trim($myts->stripSlashesGPC($_POST['dbuname'])));
+    $mm->setRewrite('XOOPS_DB_PASS', trim($myts->stripSlashesGPC($_POST['dbpass'])));
+    $mm->setRewrite('XOOPS_DB_NAME', trim($myts->stripSlashesGPC($_POST['dbname'])));
+    $mm->setRewrite('XOOPS_DB_PCONNECT', intval($_POST['db_pconnect']));
+    $mm->setRewrite('XOOPS_GROUP_ADMIN', 1);
+    $mm->setRewrite('XOOPS_GROUP_USERS', 2);
+    $mm->setRewrite('XOOPS_GROUP_ANONYMOUS', 3);
+
+	// Check if XOOPS_CHECK_PATH should be initially set or not
+	$xoopsPathTrans = isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] :  $_SERVER['SCRIPT_FILENAME'];
+	if ( DIRECTORY_SEPARATOR != '/' ) {
+	 	// IIS6 doubles the \ chars
+		$xoopsPathTrans = str_replace( strpos( $xoopsPathTrans, '\\\\', 2 ) ? '\\\\' : DIRECTORY_SEPARATOR, '/', $xoopsPathTrans);
+	}
+	$mm->setRewrite('XOOPS_CHECK_PATH', strcasecmp( substr($xoopsPathTrans, 0, strlen($_POST['root_path'])), $_POST['root_path']) ? 0 : 1 );
+
+    $ret = $mm->doRewrite();
+    if(! $ret){
+        $content = _INSTALL_L60;
+        include 'install_tpl.php';
+        exit();
+    }
+
+    $content = $mm->report();
+    $content .= "<p>"._INSTALL_L62."</p>\n";
+    $b_next = array('mainfile', _INSTALL_L94 );
+    include 'install_tpl.php';
+    break;
+
+case "mainfile":
+    // checking XOOPS_ROOT_PATH and XOOPS_URL
+    include_once "../mainfile.php";
+    $title = _INSTALL_L94;
+    $content = "<table align='center'><tr><td align='left'>\n";
+
+    $detected = str_replace("\\", "/", getcwd()); // "
+    $detected = str_replace("/install", "", $detected);
+    if ( substr($detected, -1) == "/" ) {
+        $detected = substr($detected, 0, -1);
+    }
+
+    if (empty($detected)){
+        $content .= _NGIMG._INSTALL_L95.'<br />';
+    }
+    elseif ( XOOPS_ROOT_PATH != $detected ) {
+        $content .= _NGIMG.sprintf(_INSTALL_L96,$detected). '<br />';
+    }else {
+        $content .= _OKIMG._INSTALL_L97.'<br />';
+    }
+
+    if(!is_dir(XOOPS_ROOT_PATH)){
+        $content .= _NGIMG._INSTALL_L99.'<br />';
+    }
+
+
+    if(preg_match('/^http[s]?:\/\/(.*)[^\/]+$/i',XOOPS_URL)){
+        $content .= _OKIMG._INSTALL_L100.'<br />';
+    }else{
+        $content .= _NGIMG._INSTALL_L101.'<br />';
+    }
+
+
+    $content .= "<br /></td></tr></table>\n";
+
+    $content .= "<table align='center'><tr><td align='left'>\n";
+    $content .= _INSTALL_L11."<b>".XOOPS_ROOT_PATH."</b><br />";
+    $content .= _INSTALL_L12."<b>".XOOPS_URL."</b><br />";
+    $content .= "</td></tr></table>\n";
+    $content .= "<p align='center'>"._INSTALL_L13."</p>\n";
+
+    $b_next = array('initial', _INSTALL_L102 );
+    $b_back = array('start', _INSTALL_L103 );
+    $b_reload = true;
+
+    include 'install_tpl.php';
+    //mainfile_settings();
+    break;
+
+case "initial":
+    // confirm database setting
+    include_once "../mainfile.php";
+    $content = "<table align=\"center\">\n";
+    $content .= "<tr><td align='center'>";
+    $content .= "<table align=\"center\">\n";
+    $content .= "<tr><td>"._INSTALL_L27."&nbsp;&nbsp;</td><td><b>".XOOPS_DB_HOST."</b></td></tr>\n";
+    $content .= "<tr><td>"._INSTALL_L28."&nbsp;&nbsp;</td><td><b>".XOOPS_DB_USER."</b></td></tr>\n";
+    $content .= "<tr><td>"._INSTALL_L29."&nbsp;&nbsp;</td><td><b>".XOOPS_DB_NAME."</b></td></tr>\n";
+    $content .= "<tr><td>"._INSTALL_L30."&nbsp;&nbsp;</td><td><b>".XOOPS_DB_PREFIX."</b></td></tr>\n";
+    $content .= "</table><br />\n";
+    $content .= "</td></tr><tr><td align=\"center\">";
+    $content .= _INSTALL_L13."<br /><br />\n";
+    $content .= "</td></tr></table>\n";
+    $b_next = array('checkDB', _INSTALL_L104);
+    $b_back = array('start', _INSTALL_L103);
+    $b_reload = true;
+    $title = _INSTALL_L102;
+    include 'install_tpl.php';
+    break;
+
+case "checkDB":
+    include_once "../mainfile.php";
+    include_once './class/dbmanager.php';
+    $dbm = new db_manager;
+    $title = _INSTALL_L104;
+    $content = "<table align='center'><tr><td align='left'>\n";
+
+    if (! $dbm->isConnectable()) {
+        $content .= _NGIMG._INSTALL_L106."<br />";
+        $content .= "<div style='text-align:center'><br />"._INSTALL_L107;
+        $content .= "</div></td></tr></table>\n";
+        $b_back = array('start', _INSTALL_L103);
+        $b_reload = true;
+    }else{
+        $content .= _OKIMG._INSTALL_L108."<br />";
+        if (! $dbm->dbExists()) {
+            $content .= _NGIMG.sprintf(_INSTALL_L109, XOOPS_DB_NAME)."<br />";
+            $content .= "</td></tr></table>\n";
+
+            $content .= "<p>"._INSTALL_L21."<br />"
+                        ."<b>".XOOPS_DB_NAME."</b></p>"
+                        ."<p>"._INSTALL_L22."</p>";
+
+            $b_next = array('createDB', _INSTALL_L105);
+            $b_back = array('start', _INSTALL_L103);
+            $b_reload = true;
+        }else{
+            $content .= _OKIMG.sprintf(_INSTALL_L110, XOOPS_DB_NAME)."<br />";
+            $content .= "</td></tr></table>\n";
+            $content .= "<p>"._INSTALL_L111."</p>";
+            $b_next = array('createTables', _INSTALL_L40);
+        }
+    }
+
+    include 'install_tpl.php';
+    break;
+
+case "createDB":
+    include_once "../mainfile.php";
+    include_once './class/dbmanager.php';
+    $dbm = new db_manager;
+
+    if(! $dbm->createDB()){
+        $content = "<p>"._INSTALL_L31."</p>";
+        $b_next = array('checkDB', _INSTALL_L104);
+        $b_back = array('start', _INSTALL_L103);
+    }else{
+        $content = "<p>".sprintf(_INSTALL_L43, XOOPS_DB_NAME)."</p>";
+        $b_next = array('checkDB', _INSTALL_L104);
+    }
+    include 'install_tpl.php';
+    break;
+
+case "createTables":
+    include_once "../mainfile.php";
+
+    include_once './class/dbmanager.php';
+    $dbm = new db_manager;
+
+    //$content = "<table align='center'><tr><td align='left'>\n";
+    $tables = array();
+    $result = $dbm->queryFromFile('./sql/'.XOOPS_DB_TYPE.'.structure.sql');
+    $content = $dbm->report();
+
+    if(! $result ){
+        //$deleted = $dbm->deleteTables($tables);
+        $content .= "<p>"._INSTALL_L114."</p>\n";
+        $b_back = array('start', _INSTALL_L103);
+    }else{
+        $content .= "<p>"._INSTALL_L115."</p>\n";
+        $b_next = array('siteInit', _INSTALL_L112);
+    }
+
+    include 'install_tpl.php';
+    break;
+
+case "siteInit":
+    include_once "../mainfile.php";
+
+    $content = "<table align='center' width='70%'>\n";
+    $content .= "<tr><td colspan='2' align='center'>"._INSTALL_L36."</td></tr>\n";
+    $content .= "<tr><td align='right'><b>"._INSTALL_L37."</b></td><td><input type=\"text\" name=\"adminname\" /></td></tr>\n";
+    $content .= "<tr><td align='right'><b>"._INSTALL_L167."</b></td><td><input type='text' name='loginname' value='' maxlength='25' /></td></tr>\n";
+    $content .= "<tr><td align='right'><b>"._INSTALL_L38."</b></td><td><input type='text' name='adminmail' value='' maxlength='60' /></td></tr>\n";
+    $content .= "<tr><td align='right'><b>"._INSTALL_L39."</b></td><td><input type='password' name='adminpass' /></td></tr>\n";
+    $content .= "<tr><td align='right'><b>"._INSTALL_L74."</b></td><td><input type='password' name='adminpass2' /></td></tr>\n";
+    $content .= "</table>\n";
+    $b_next = array('insertData', _INSTALL_L116);
+
+    include 'install_tpl.php';
+    break;
+
+case "insertData":
+    $adminname = $myts->stripSlashesGPC($_POST['adminname']);
+    $loginname = $myts->stripSlashesGPC($_POST['loginname']);
+    $adminpass = $myts->stripSlashesGPC($_POST['adminpass']);
+    $adminmail = $myts->stripSlashesGPC($_POST['adminmail']);
+
+    if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i",$adminmail)) {
+        $content = "<p>"._INSTALL_L73."</p>\n";
+        $b_back = array('', _INSTALL_L112 );
+        include 'install_tpl.php';
+        exit();
+    }
+    if ( !isset($adminname) || !isset($adminpass) || !isset($adminmail) || $adminmail == "" || $adminname =="" || $adminpass =="" || !isset($loginname) || $loginname == "") {
+        $content = "<p>"._INSTALL_L41."</p>\n";
+        $b_back = array('', _INSTALL_L112 );
+        include 'install_tpl.php';
+        exit();
+    }
+    if ( $adminpass != $adminpass2) {
+        $content = "<p>"._INSTALL_L48."</p>\n";
+        $b_back = array('', _INSTALL_L112 );
+        include 'install_tpl.php';
+        exit();
+    }
+    error_reporting(0);
+    include_once "../mainfile.php";
+    //include_once './include/createtables2.php';
+    include_once './makedata.php';
+    include_once './class/dbmanager.php';
+    $dbm = new db_manager;
+    include_once './class/cachemanager.php';
+    $cm = new cache_manager;
+
+    $xoopsConfig['language'] = check_language($xoopsConfig['language']);
+    if ( file_exists("./language/".$xoopsConfig['language']."/install2.php") ) {
+        include_once "./language/".$xoopsConfig['language']."/install2.php";
+    } elseif ( file_exists("./language/english/install2.php") ) {
+        include_once "./language/english/install2.php";
+        $xoopsConfig['language'] = 'english';
+    } else {
+        echo 'no language file (install2.php).';
+        exit();
+    }
+
+    if ( file_exists(XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/global.php") ) {
+        include_once XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/global.php";
+    } else {
+        include_once XOOPS_ROOT_PATH."/language/english/global.php";
+    }
+
+    if ( file_exists("../modules/system/language/".$xoopsConfig['language']."/admin/modulesadmin.php") ) {
+        include_once "../modules/system/language/".$xoopsConfig['language']."/admin/modulesadmin.php";
+    } else {
+        include_once "../modules/system/language/english/admin/modulesadmin.php";
+    }
+    $content = "";
+
+    // #################### Include API ##################
+    include_once XOOPS_ROOT_PATH.'/include/functions.php';
+    require_once XOOPS_ROOT_PATH.'/kernel/object.php';
+    require_once XOOPS_ROOT_PATH.'/class/criteria.php';
+    include_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php";
+    require_once XOOPS_ROOT_PATH.'/class/criteria.php';
+
+    $xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection();
+    define("SMARTY_DIR", XOOPS_ROOT_PATH."/class/smarty/");
+    define("XOOPS_CACHE_PATH", XOOPS_ROOT_PATH."/cache/");
+
+    $xoopsConfig['adminmail'] = $adminmail;
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->create();
+    $module->setVar('dirname', 'system');
+    $html = '<h4 style="text-align:left;margin-bottom: 0px;border-bottom: dashed 1px #000000;">Installing '.$module->getInfo('name').'</h4>';
+
+    if ($module->getInfo('image') != false && trim($module->getInfo('image')) != '') {
+        $html .='<img src="'.XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.trim($module->getInfo('image')).'" alt="" />';
+    }
+    $html .='<br /><b>Version:</b> '.$module->getInfo('version');
+    if ($module->getInfo('author') != false && trim($module->getInfo('author')) != '') {
+        $html .='<br /><b>Author:</b> '.trim($module->getInfo('author'));
+    }
+    //make sure that the profilefields.tmp cache file is NOT there
+    $profile_handler =& xoops_gethandler('profile');
+    $profile_handler->updateCache();
+
+    //$tables = array();
+    $result = $dbm->queryFromFile('./sql/'.XOOPS_DB_TYPE.'.data.sql');
+
+    $result = $dbm->queryFromFile('./language/'.$xoopsConfig['language'].'/'.XOOPS_DB_TYPE.'.lang.data.sql');
+
+    $group = make_groups($dbm);
+    $result = make_data($dbm, $cm, $adminname, $adminpass, $adminmail, $xoopsConfig['language'], $group);
+
+    //Install system module
+    $html .= $module->install(array(XOOPS_GROUP_ADMIN), array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS));
+
+
+	$member_handler =& xoops_gethandler('member');
+	$user =& $member_handler->createUser();
+	$user->setVar('uid', 1);
+	$user->setVar('uname', addslashes($adminname));
+	$user->setVar('loginname', addslashes($loginname));
+	$user->setVar('email', addslashes($adminmail));
+	$user->setVar('pass', md5($adminpass));
+	$user->setVar('user_avatar', 'blank.gif');
+	$user->setVar('rank', 7);
+	$user->setVar('level', 5);
+	$user->setVar('user_regdate', time());
+	if (!$member_handler->insertUser($user)) {
+	    echo $user->getHtmlErrors();
+	}
+
+    $block_handler =& xoops_gethandler('block');
+    $blocks_to_install =& $block_handler->getObjects(new Criteria('show_func', "(".implode(',', array("'b_system_user_show'", "'b_system_login_show'", "'b_system_main_show'")).")", "IN"));
+    //Install login, main menu and user menu blocks
+    include_once XOOPS_ROOT_PATH."/modules/system/admin/blocksadmin/blocksadmin.php";
+    if (count($blocks_to_install) > 0) {
+        foreach ($blocks_to_install as $block) {
+            if (save_block(0, 0, 1, 0, $block->getVar('name'), $block->getVar('bid'), 0, array("0-0"), array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS), array())) {
+                //success
+                $html .= "<br />".sprintf(_INSTALL_L165, $block->getVar('name'));
+            }
+            else {
+                //failure
+                $html .= "<br />".sprintf(_INSTALL_L166, $block->getVar('name'));
+            }
+        }
+    }
+    else {
+        $html .= "Blocks not inserted";
+    }
+
+    $content .= $dbm->report();
+    $content .= $cm->report();
+    include_once "./class/mainfilemanager.php";
+    $mm = new mainfile_manager("../mainfile.php");
+    foreach($group as $key => $val){
+        $mm->setRewrite($key, intval($val));
+    }
+    $result = $mm->doRewrite();
+    $content .= $mm->report();
+
+    $content .= $html;
+
+    $b_next = array('modules', _INSTALL_L129);
+    $title = _INSTALL_L116;
+    setcookie('xoops_session', '', time() - 3600);
+    include 'install_tpl.php';
+
+    break;
+
+case 'modules':
+    error_reporting(0);
+    include_once "../mainfile.php";
+    // #################### Include API ##################
+    include_once './class/dbmanager.php';
+    include_once XOOPS_ROOT_PATH.'/include/functions.php';
+    require_once XOOPS_ROOT_PATH.'/kernel/object.php';
+    require_once XOOPS_ROOT_PATH.'/class/criteria.php';
+    include_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php";
+    require_once XOOPS_ROOT_PATH.'/class/criteria.php';
+
+    $xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection();
+    define("SMARTY_DIR", XOOPS_ROOT_PATH."/class/smarty/");
+    define("XOOPS_CACHE_PATH", XOOPS_ROOT_PATH."/cache/");
+
+    $config_handler =& xoops_gethandler('config');
+    $xoopsConfig =& $config_handler->getConfigsByCat(XOOPS_CONF);
+
+    if ( file_exists(XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/global.php") ) {
+        include_once XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/global.php";
+    } else {
+        include_once XOOPS_ROOT_PATH."/language/english/global.php";
+    }
+
+    if ( file_exists("../modules/system/language/".$xoopsConfig['language']."/admin/modulesadmin.php") ) {
+        include_once "../modules/system/language/".$xoopsConfig['language']."/admin/modulesadmin.php";
+    } else {
+        include_once "../modules/system/language/english/admin/modulesadmin.php";
+    }
+
+    $module_handler =& xoops_gethandler('module');
+    $title = _INSTALL_L49;
+    $content = "<table width='80%' align='center'>\n";
+    $modules_dir = XOOPS_ROOT_PATH."/modules/";
+    $count = 0;
+    $modlist = getDirList($modules_dir);
+    $pre_specified = array("pm", "profile");
+    foreach ($modlist as $file) {
+        if ( $file != "system" ) {
+            $module =& $module_handler->create();
+            $module->loadInfo($file);
+            if ($count % 2 == 0) {
+                $class = 'even';
+            } else {
+                $class = 'odd';
+            }
+            $content .= '<tr class="'.$class.'">
+                <td><input type="checkbox" name="modules[]" value="'.$module->getInfo('dirname').'"' ;
+            if(in_array($file, $pre_specified)){
+            	$content .= ' "checked" ';
+            }else{
+            	$content .= ' "disabled" ';
+            }
+            $content .= '/></td>
+                <td align="center" valign="bottom"><img src="'.XOOPS_URL.'/modules/'.$module->getInfo('dirname').'/'.$module->getInfo('image').'" alt="'.htmlspecialchars($module->getInfo('name')).'" border="0" /></td>
+                <td>'.$module->getInfo('name').'</td>
+                <td align="center">'.round($module->getInfo('version'), 2).'</td>';
+            $content .= "</td><td>";
+            $content .= $module->getInfo("description");
+            $content .= '</td></tr>
+                ';
+            unset($module);
+            $count++;
+        }
+
+    }
+    $content .= "</table>\n";
+    $b_next = array('moduleinstall', _INSTALL_L49);
+    include 'install_tpl.php';
+    break;
+
+case "moduleinstall":
+    if (isset($_REQUEST['modules'])) {
+        error_reporting(0);
+        $content = "";
+        include_once "../mainfile.php";
+        // #################### Include API ##################
+        include_once './class/dbmanager.php';
+        include_once XOOPS_ROOT_PATH.'/include/functions.php';
+        require_once XOOPS_ROOT_PATH.'/kernel/object.php';
+        require_once XOOPS_ROOT_PATH.'/class/criteria.php';
+        include_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php";
+        require_once XOOPS_ROOT_PATH.'/class/criteria.php';
+
+        $xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection();
+        define("SMARTY_DIR", XOOPS_ROOT_PATH."/class/smarty/");
+        define("XOOPS_CACHE_PATH", XOOPS_ROOT_PATH."/cache/");
+        define("XOOPS_UPLOAD_URL", XOOPS_URL."/uploads/");
+        define("XOOPS_THEME_PATH", XOOPS_ROOT_PATH."/themes");
+        define("XOOPS_COMPILE_PATH", XOOPS_ROOT_PATH."/templates_c");
+
+	    if ( file_exists(XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/global.php") ) {
+	        include_once XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/global.php";
+	    } else {
+	        include_once XOOPS_ROOT_PATH."/language/english/global.php";
+	    }
+
+	    if ( file_exists(XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/local.php") ) {
+	        include_once XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/local.php";
+	    } else {
+	        include_once XOOPS_ROOT_PATH."/language/english/local.php";
+	    }
+
+        if ( file_exists("../modules/system/language/".$xoopsConfig['language']."/admin/modulesadmin.php") ) {
+            include_once "../modules/system/language/".$xoopsConfig['language']."/admin/modulesadmin.php";
+        } else {
+            include_once "../modules/system/language/english/admin/modulesadmin.php";
+        }
+
+        $module_handler =& xoops_gethandler('module');
+        foreach ($_REQUEST['modules'] as $dirname) {
+            $module =& $module_handler->create();
+            $module->setVar('dirname', $dirname);
+            $content .= $module->install(array(XOOPS_GROUP_ADMIN), array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS));
+            unset($module);
+        }
+        $title = _INSTALL_L49;
+
+        $b_next = array('finish', _INSTALL_L117);
+        include 'install_tpl.php';
+        break;
+    }
+
+    case 'finish':
+
+    $title = _INSTALL_L32;
+    $content = "<table width='60%' align='center'><tr><td align='left'>\n";
+    include './language/'.$xoopsConfig['language'].'/finish.php';
+    $content .= "</td></tr></table>\n";
+    include 'install_tpl.php';
+    break;
+}
+
+/*
+ * gets list of name of directories inside a directory
+ */
+function getDirList($dirname)
+{
+    $dirlist = array();
+    if (is_dir($dirname) && $handle = opendir($dirname)) {
+        while (false !== ($file = readdir($handle))) {
+            if ( !preg_match("/^[.]{1,2}$/",$file) ) {
+                if (strtolower($file) != 'cvs' && is_dir($dirname.$file) ) {
+                    $dirlist[$file]=$file;
+                }
+            }
+        }
+        closedir($handle);
+        asort($dirlist);
+        reset($dirlist);
+    }
+    return $dirlist;
+}
+
+/*
+ * gets list of name of files within a directory
+ */
+function getImageFileList($dirname)
+{
+    $filelist = array();
+    if (is_dir($dirname) && $handle = opendir($dirname)) {
+        while (false !== ($file = readdir($handle))) {
+            if (!preg_match("/^[.]{1,2}$/",$file) && preg_match("/[.gif|.jpg|.png]$/i",$file) ) {
+                    $filelist[$file]=$file;
+            }
+        }
+        closedir($handle);
+        asort($filelist);
+        reset($filelist);
+    }
+    return $filelist;
+}
+
+function check_language($language){
+     if ( file_exists('../modules/system/language/'.$language.'/modinfo.php') ) {
+        return $language;
+    } else {
+        return 'english';
+    }
+}
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/install_tpl.php 2.2.6.src/install/install_tpl.php
--- 2.2.3a-Final.src/install/install_tpl.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/install_tpl.php	2006-01-22 17:49:01.000000000 -0600
@@ -0,0 +1,102 @@
+<?php
+	if (!headers_sent()) {
+		header('Content-Type:text/html; charset='._INSTALL_CHARSET);
+	}
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+  <title>XOOPS Custom Installation</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _INSTALL_CHARSET ?>" />
+  <style type="text/css" media="all"><!-- @import url(../xoops.css); --></style>
+  <link rel="stylesheet" type="text/css" media="all" href="style.css" />
+</head>
+<body style="margin: 0; padding: 0;">
+<form action='index.php' method='post'>
+<table width="778" align="center" cellpadding="0" cellspacing="0" background="img/bg_table.gif">
+  <tr>
+    <td width="150"><img src="img/hbar_left.gif" width="100%" height="23" alt="" /></td>
+    <td width="478" background="img/hbar_middle.gif">&nbsp;</td>
+    <td width="150"><img src="img/hbar_right.gif" width="100%" height="23" alt="" /></td>
+  </tr>
+  <tr>
+    <td width="150"><a href="index.php"><img src="img/logo.gif" width="150" height="80" alt="" /></a></td>
+    <td width="478" background="img/bg_darkblue.gif">&nbsp;</td>
+    <td width="150"><img src="img/xoops2.gif" width="100%" height="80" /></td>
+  </tr>
+  <tr>
+    <td width="150"><img src="img/hbar_left.gif" width="100%" height="23" alt="" /></td>
+    <td width="478" background="img/hbar_middle.gif">&nbsp;</td>
+    <td width="150"><img src="img/hbar_right.gif" width="100%" height="23" alt="" /></td>
+  </tr>
+</table>
+
+<table width="778" align="center" cellspacing="0" cellpadding="0" background="img/bg_table.gif">
+  <tr>
+    <td width='5%'>&nbsp;</td>
+    <td colspan="3"><?php if(!empty($title)) echo '<h4 style="margin-top: 10px; margin-bottom: 5px; padding: 10px;">'.$title.'</h4>'; echo '<div style="padding: 10px;">'.$content.'</div>'; ?></td>
+    <td width='5%'>&nbsp;</td>
+  </tr>
+  <tr>
+    <td width='5%'>&nbsp;</td>
+    <td width='35%' align='left'><?php echo b_back($b_back); ?></td>
+    <td width='20%' align='center'><?php echo b_reload($b_reload); ?></td>
+    <td width='35%' align='right'><?php echo b_next($b_next); ?></td>
+    <td width='5%'>&nbsp;</td>
+  </tr>
+  <tr>
+    <td colspan="5">&nbsp;</td>
+  </tr>
+</table>
+
+<table width="778" cellspacing="0" cellpadding="0" align="center" background="img/bg_table.gif">
+  <tr>
+    <td width="150"><img src="img/hbar_left.gif" width="100%" height="23" alt="" /></td>
+    <td width="478" background="img/hbar_middle.gif">&nbsp;</td>
+    <td width="150"><img src="img/hbar_installer_right.gif" width="100%" height="23" alt="" /></td>
+  </tr>
+</table>
+</form>
+</body>
+</html>
+<?php
+function b_back($option = null)
+{
+    if(!isset($option) || !is_array($option)) return '';
+    $content = '';
+    if(isset($option[0]) && $option[0] != ''){
+        $content .= "<input type='button' value='"
+            ._INSTALL_L42."' onclick=\"location='index.php?op="
+            .htmlspecialchars($option[0])."'\" /> ";
+    }else{
+        $content .= "<input type='button' value='"
+            ._INSTALL_L42."' onclick=\"javascript:history.back();\" /> ";
+    }
+    if(isset($option[1]) && $option[1] != ''){
+        $content .= "<span style='font-size:85%;'><< "
+                .htmlspecialchars($option[1])."</span> ";
+    }
+    return $content;
+}
+
+function b_reload($option=''){
+    if(empty($option)) return '';
+	if (!defined('_INSTALL_L200')) {
+		define('_INSTALL_L200', 'Reload');
+	}
+    return  "<input type='button' value='"._INSTALL_L200."' onclick=\"location.reload();\" /> ";
+}
+
+function b_next($option=null){
+    if(!isset($option) || !is_array($option)) return '';
+    $content = '';
+    if(isset($option[1]) && $option[1] != ''){
+        $content .= "<span style='font-size:85%;'>"
+                .htmlspecialchars($option[1])." >></span>";
+    }
+    $content .= "<input type='hidden' name='op' value='"
+                .htmlspecialchars($option[0])."' />\n";
+    $content .= "<input type='submit' name='submit' value='"._INSTALL_L47."' />\n";
+    return $content;
+}
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/language/english/finish.php 2.2.6.src/install/language/english/finish.php
--- 2.2.3a-Final.src/install/language/english/finish.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/language/english/finish.php	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,11 @@
+<?php
+// $Id: finish.php 184 2006-01-22 22:34:51Z skalpa $
+$content .=
+"<u><b>Your site</b></u>
+<p>Click <a href='../user.php'>HERE</a> to see the home page of your site.</p>
+<u><b>Way to use</b></u>
+<p>[not yet]</p>
+<u><b>Support</b></u>
+<p>Visit <a href='http://www.xoops.org/' target='_blank'>XOOPS.org</a></p>
+";
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/language/english/install2.php 2.2.6.src/install/language/english/install2.php
--- 2.2.3a-Final.src/install/language/english/install2.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/language/english/install2.php	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,38 @@
+<?php
+// $Id: install2.php 184 2006-01-22 22:34:51Z skalpa $
+define("_INSTALL_WEBMASTER","Webmasters");
+define("_INSTALL_WEBMASTERD","Webmasters of this site");
+define("_INSTALL_REGUSERS","Registered Users");
+define("_INSTALL_REGUSERSD","Registered Users Group");
+define("_INSTALL_ANONUSERS","Anonymous Users");
+define("_INSTALL_ANONUSERSD","Anonymous Users Group");
+
+define("_INSTALL_DISCLMR", "While the administrators and moderators of this site will attempt to remove
+or edit any generally objectionable material as quickly as possible, it is
+impossible to review every message. Therefore you acknowledge that all posts
+made to this site express the views and opinions of the author and not the
+administrators, moderators or webmaster (except for posts by these people)
+and hence will not be held liable. 
+
+You agree not to post any abusive, obscene, vulgar, slanderous, hateful,
+threatening, sexually-orientated or any other material that may violate any
+applicable laws. Doing so may lead to you being immediately and permanently
+banned (and your service provider being informed). The IP address of all
+posts is recorded to aid in enforcing these conditions. Creating multiple
+accounts for a single user is not allowed. You agree that the webmaster,
+administrator and moderators of this site have the right to remove, edit,
+move or close any topic at any time should they see fit. As a user you agree
+to any information you have entered above being stored in a database. While
+this information will not be disclosed to any third party without your
+consent the webmaster, administrator and moderators cannot be held
+responsible for any hacking attempt that may lead to the data being
+compromised. 
+
+This site system uses cookies to store information on your local computer.
+These cookies do not contain any of the information you have entered above,
+they serve only to improve your viewing pleasure. The email address is used
+only for confirming your registration details and password (and for sending
+new passwords should you forget your current one). 
+
+By clicking Register below you agree to be bound by these conditions.");
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/language/english/install.php 2.2.6.src/install/language/english/install.php
--- 2.2.3a-Final.src/install/language/english/install.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/language/english/install.php	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,190 @@
+<?php
+// $Id: install.php 184 2006-01-22 22:34:51Z skalpa $
+define("_INSTALL_L0","Welcome to the Install Wizard for XOOPS 2.2");
+define("_INSTALL_L70","Please change the file permission for mainfile.php so that it is writeable by the server (i.e. chmod 777 mainfile.php on a UNIX/LINUX server, or check the properties of the file and make sure the read-only flag is not set on a Windows server ). Reload this page once you have changed the permission setting.");
+//define("_INSTALL_L71","Click on the button below to begin the installation.");
+define("_INSTALL_L1","Open mainfile.php with your text editor and find the following codes on line 31:");
+define("_INSTALL_L2","Now, change this line to:");
+define("_INSTALL_L3","Next, on line 35, change %s to %s");
+define("_INSTALL_L4","OK, I have set the above setings, let me try again!");
+define("_INSTALL_L5","WARNING!");
+define("_INSTALL_L6","There is a mismatch between your XOOPS_ROOT_PATH configuration on line 31 of mainfile.php and the root path info we have detected.");
+define("_INSTALL_L7","Your setting: ");
+define("_INSTALL_L8","We detected: ");
+define("_INSTALL_L9","( On MS platforms, you may receive this error message even when your configuration is correct. If that is the case, please press the button below to continue)");
+define("_INSTALL_L10","Plesae press the button below to continue if this is really ok.");
+define("_INSTALL_L11","The server path to your XOOPS root directory: ");
+define("_INSTALL_L12","URL to your XOOPS root directory: ");
+define("_INSTALL_L13","If the above setting is correct, press the button below to continue.");
+define("_INSTALL_L14","Next");
+define("_INSTALL_L15","Please open mainfile.php and enter required DB settings data");
+define("_INSTALL_L16","%s is the hostname of your database server.");
+define("_INSTALL_L17","%s is the username of your database account.");
+define("_INSTALL_L18","%s is the password required to access your database.");
+define("_INSTALL_L19","%s is the name of your database in which XOOPS tables will be created.");
+define("_INSTALL_L20","%s is the prefix for tables that will be made during the installation.");
+define("_INSTALL_L21","The following database was not found on the server:");
+define("_INSTALL_L22","Attempt to create it?");
+define("_INSTALL_L23","Yes");
+define("_INSTALL_L24","No");
+define("_INSTALL_L25","We have detected the following database information from your configuration in mainfile.php. Please fix it now if this is not correct.");
+define("_INSTALL_L26","Database Configuration");
+define("_INSTALL_L51","Database");
+define("_INSTALL_L66","Choose the database to be used");
+define("_INSTALL_L27","Database Hostname");
+define("_INSTALL_L67","Hostname of the database server. If you are unsure, 'localhost' works in most cases.");
+define("_INSTALL_L28","Database Username");
+define("_INSTALL_L65","Your database user account on the host");
+define("_INSTALL_L29","Database Name");
+define("_INSTALL_L64","The name of database on the host. The installer will attempt to create the database if not exist");
+define("_INSTALL_L52","Database Password");
+define("_INSTALL_L68","Password for your database user account");
+define("_INSTALL_L30","Table Prefix");
+define("_INSTALL_L63","This prefix will be added to all new tables created to avoid name conflict in the database. If you are unsure, just use the default 'xoops'.");
+define("_INSTALL_L54","Use persistent connection?");
+define("_INSTALL_L69","Default is 'NO'. Choose 'NO' if you are unsure.");
+define("_INSTALL_L55","XOOPS Physical Path");
+define("_INSTALL_L59","Physical path to your main XOOPS directory WITHOUT trailing slash");
+define("_INSTALL_L56","XOOPS Virtual Path (URL)");
+define("_INSTALL_L58","Virtual path to your main XOOPS directory WITHOUT trailing slash");
+
+define("_INSTALL_L31","Could not create database. Contact the server administrator for details.");
+define("_INSTALL_L32","Installation Complete");
+define("_INSTALL_L33","Click <a href='../index.php'>HERE</a> to see the home page of your site.");
+define("_INSTALL_L35","If you had any errors, please contact the dev team at <a href='http://www.xoops.org/' target='_blank'>XOOPS.org</a>");
+define("_INSTALL_L36","Please choose your site admin's name and password.");
+define("_INSTALL_L37","Admin Displayname");
+define("_INSTALL_L167", "Admin Login name");
+define("_INSTALL_L38","Admin Email");
+define("_INSTALL_L39","Admin Password");
+define("_INSTALL_L74","Confirm Password");
+define("_INSTALL_L40","Create Tables");
+define("_INSTALL_L41","Please go back and type in all the required info.");
+define("_INSTALL_L42","Back");
+define("_INSTALL_L57","Please enter %s");
+
+// %s is database name
+define("_INSTALL_L43","Database %s created!");
+
+// %s is table name
+define("_INSTALL_L44","Unable to make %s");
+define("_INSTALL_L45","Table %s created.");
+
+define("_INSTALL_L46","In order for the modules included in the package to work correctly, the following files must be writeable by the server. Please change the permission setting for these files. (i.e. 'chmod 666 file_name' and 'chmod 777 dir_name' on a UNIX/LINUX server, or check the properties of the file and make sure the read-only flag is not set on a Windows server)");
+define("_INSTALL_L47","Next");
+
+define("_INSTALL_L53","Please confirm the following submitted data:");
+
+define("_INSTALL_L60","Could not write into mainfile.php. Please check the file permission and try again.");
+define("_INSTALL_L61","Could not write to mainfile.php. Contact the server administrator for details.");
+define("_INSTALL_L62","Configuration data has been saved successfully to mainfile.php.");
+define("_INSTALL_L72","The following directories must be created with the write permission by the server. (i.e. 'chmod 777 directory_name' on a UNIX/LINUX server)");
+define("_INSTALL_L73","Invalid Email");
+
+// add by haruki
+define("_INSTALL_L80","introduction");
+define("_INSTALL_L81","check file permissions");
+define("_INSTALL_L82","Checking file and directory permissions..");
+define("_INSTALL_L83","File %s is NOT writable.");
+define("_INSTALL_L84","File %s is writable.");
+define("_INSTALL_L85","Directory %s is NOT writable.");
+define("_INSTALL_L86","Directory %s is writable.");
+define("_INSTALL_L87","No errors detected.");
+define("_INSTALL_L89","general settings");
+define("_INSTALL_L90","General configuration");
+define("_INSTALL_L91","confirm");
+define("_INSTALL_L92","save settings");
+define("_INSTALL_L93","modify settings");
+define("_INSTALL_L88","Saving configuration data..");
+define("_INSTALL_L94","check path & URL");
+define("_INSTALL_L127","Checking file path & URL settings..");
+define("_INSTALL_L95","Could not detect the physical path to your XOOPS directory.");
+define("_INSTALL_L96","There is a conflict between the detected physical path (%s) and the one you input.");
+define("_INSTALL_L97","<b>Physical path</b> is correct.");
+
+define("_INSTALL_L99","<b>Physical path</b> must be a directory.");
+define("_INSTALL_L100","<b>Virtual path</b> is a valid URL.");
+define("_INSTALL_L101","<b>Virtual path</b> is not a valid URL.");
+define("_INSTALL_L102","confirm database settings");
+define("_INSTALL_L103","restart from the beginning");
+define("_INSTALL_L104","check database");
+define("_INSTALL_L105","atempt to create database");
+define("_INSTALL_L106","Could not connect to the database server.");
+define("_INSTALL_L107","Please check the database server and its configuration.");
+define("_INSTALL_L108","Connection to database server is OK.");
+define("_INSTALL_L109","Database %s does not exists.");
+define("_INSTALL_L110","Database %s exists and connectable.");
+define("_INSTALL_L111","Database connection is OK.<br />Press the button below to create database tables.");
+define("_INSTALL_L112","admin user setting");
+define("_INSTALL_L113","Table %s deleted.");
+define("_INSTALL_L114","Failed creating database tables.");
+define("_INSTALL_L115","Database tables created.");
+define("_INSTALL_L116","insert data");
+define("_INSTALL_L117","finish");
+
+define("_INSTALL_L118","Failed creating table %s.");
+define("_INSTALL_L119","%d entries inserted to table %s.");
+define("_INSTALL_L120","Failed inserting %d entries to table %s.");
+
+define("_INSTALL_L121","Constant %s written to %s.");
+define("_INSTALL_L122","Failed writing constant %s to %s.");
+
+define("_INSTALL_L123","File %s stored in cache/ directory.");
+define("_INSTALL_L124","Failed storing file %s to cache/ directory.");
+
+define("_INSTALL_L125","File %s overwritten by %s.");
+define("_INSTALL_L126","Could not write to file %s.");
+
+define("_INSTALL_L130","The installer has detected tables for XOOPS 1.3.x in your database.<br />The installer will now attempt to upgrade your database to XOOPS2.");
+define("_INSTALL_L131","Tables for XOOPS2 already exist in your database.");
+define("_INSTALL_L132","update tables");
+define("_INSTALL_L133","Table %s updated.");
+define("_INSTALL_L134","Failed updating table %s.");
+define("_INSTALL_L135","Failed updating database tables.");
+define("_INSTALL_L136","Database tables updated.");
+define("_INSTALL_L137","update modules");
+define("_INSTALL_L138","update comments");
+define("_INSTALL_L139","update avatars");
+define("_INSTALL_L140","update smilies");
+define("_INSTALL_L141","The installer will now update each module to work with XOOPS2.<br />Make sure that you have uploaded all files in XOOPS2 package to your server.<br />This may take a while to complete.");
+define("_INSTALL_L142","Updating modules..");
+define("_INSTALL_L143","The installer will now update configuration data of XOOPS 1.3.x to be used with XOOPS2.");
+define("_INSTALL_L144","update config");
+define("_INSTALL_L145","Comment (ID: %s) inserted to the database.");
+define("_INSTALL_L146","Could not insert comment (ID: %s) to the database.");
+define("_INSTALL_L147","Updating comments..");
+define("_INSTALL_L148","Update complete.");
+define("_INSTALL_L149","The installer will now update comment posts in XOOPS 1.3.x to be used in XOOPS2.<br />This may take a while to complete.");
+define("_INSTALL_L150","The installer will now update the smiley and user rank images to be used with XOOPS2.<br />This may take a while to complete.");
+define("_INSTALL_L151","The installer will now update the user avatar images to be used in XOOPS2.<br />This may take a while to complete.");
+define("_INSTALL_L155","Updating smiley/rank images..");
+define("_INSTALL_L156","Updating user avatar images..");
+define("_INSTALL_L157","Select the default user group for each group type");
+define("_INSTALL_L158","Groups in 1.3.x");
+define("_INSTALL_L159","Webmasters");
+define("_INSTALL_L160","Register Users");
+define("_INSTALL_L161","Anonymous Users");
+define("_INSTALL_L162","You must select a default group for each group type.");
+define("_INSTALL_L163","Table %s dropped.");
+define("_INSTALL_L164","Failed deleting table %s.");
+
+// %s is filename
+define("_INSTALL_L152","Could not open %s.");
+define("_INSTALL_L153","Could not update %s.");
+define("_INSTALL_L154","%s updated.");
+
+define('_INSTALL_L128', 'Choose language to be used for the installation process');
+define('_INSTALL_L200', 'Reload');
+
+
+define('_INSTALL_CHARSET','ISO-8859-1');
+
+//added in XOOPS 2.1.0
+define("_INSTALL_L48", "Admin Passwords Differ");
+
+define("_INSTALL_L49", "Module Installation");
+define("_INSTALL_L129", "Modules");
+
+define("_INSTALL_L165", "%s Created Successfully");
+define("_INSTALL_L166", "%s Could not be created");
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/language/english/mysql.lang.data.sql 2.2.6.src/install/language/english/mysql.lang.data.sql
--- 2.2.3a-Final.src/install/language/english/mysql.lang.data.sql	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/language/english/mysql.lang.data.sql	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,33 @@
+#
+# Dumping data for table `ranks`
+#
+
+INSERT INTO ranks VALUES (1, 'Just popping in', 0, 20, 0, 'rank3e632f95e81ca.gif');
+INSERT INTO ranks VALUES (2, 'Not too shy to talk', 21, 40, 0, 'rank3dbf8e94a6f72.gif');
+INSERT INTO ranks VALUES (3, 'Quite a regular', 41, 70, 0, 'rank3dbf8e9e7d88d.gif');
+INSERT INTO ranks VALUES (4, 'Just can\'t stay away', 71, 150, 0, 'rank3dbf8ea81e642.gif');
+INSERT INTO ranks VALUES (5, 'Home away from home', 151, 10000, 0, 'rank3dbf8eb1a72e7.gif');
+INSERT INTO ranks VALUES (6, 'Moderator', 0, 0, 1, 'rank3dbf8edf15093.gif');
+INSERT INTO ranks VALUES (7, 'Webmaster', 0, 0, 1, 'rank3dbf8ee8681cd.gif');
+
+#
+# Dumping data for table `smiles`
+#
+
+INSERT INTO smiles VALUES (1, ':-D', 'smil3dbd4d4e4c4f2.gif', 'Very Happy', 1);
+INSERT INTO smiles VALUES (2, ':-)', 'smil3dbd4d6422f04.gif', 'Smile', 1);
+INSERT INTO smiles VALUES (3, ':-(', 'smil3dbd4d75edb5e.gif', 'Sad', 1);
+INSERT INTO smiles VALUES (4, ':-o', 'smil3dbd4d8676346.gif', 'Surprised', 1);
+INSERT INTO smiles VALUES (5, ':-?', 'smil3dbd4d99c6eaa.gif', 'Confused', 1);
+INSERT INTO smiles VALUES (6, '8-)', 'smil3dbd4daabd491.gif', 'Cool', 1);
+INSERT INTO smiles VALUES (7, ':lol:', 'smil3dbd4dbc14f3f.gif', 'Laughing', 1);
+INSERT INTO smiles VALUES (8, ':-x', 'smil3dbd4dcd7b9f4.gif', 'Mad', 1);
+INSERT INTO smiles VALUES (9, ':-P', 'smil3dbd4ddd6835f.gif', 'Razz', 1);
+INSERT INTO smiles VALUES (10, ':oops:', 'smil3dbd4df1944ee.gif', 'Embaressed', 0);
+INSERT INTO smiles VALUES (11, ':cry:', 'smil3dbd4e02c5440.gif', 'Crying (very sad)', 0);
+INSERT INTO smiles VALUES (12, ':evil:', 'smil3dbd4e1748cc9.gif', 'Evil or Very Mad', 0);
+INSERT INTO smiles VALUES (13, ':roll:', 'smil3dbd4e29bbcc7.gif', 'Rolling Eyes', 0);
+INSERT INTO smiles VALUES (14, ';-)', 'smil3dbd4e398ff7b.gif', 'Wink', 0);
+INSERT INTO smiles VALUES (15, ':pint:', 'smil3dbd4e4c2e742.gif', 'Another pint of beer', 0);
+INSERT INTO smiles VALUES (16, ':hammer:', 'smil3dbd4e5e7563a.gif', 'ToolTimes at work', 0);
+INSERT INTO smiles VALUES (17, ':idea:', 'smil3dbd4e7853679.gif', 'I have an idea', 0);
diff -ruN 2.2.3a-Final.src/install/language/english/welcome.php 2.2.6.src/install/language/english/welcome.php
--- 2.2.3a-Final.src/install/language/english/welcome.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/language/english/welcome.php	2007-12-22 17:02:44.000000000 -0600
@@ -0,0 +1,36 @@
+<?php
+// $Id: welcome.php 1198 2007-12-22 23:02:44Z phppp $
+$content .=
+"<u><b>What is it?</b></u>
+<p>
+<b>XOOPS</b> is a dynamic OO (Object Oriented) based open source portal script written in PHP.
+XOOPS supports a number of databases,
+making XOOPS an ideal tool for developing small to large dynamic community websites,
+intra company portals, corporate portals, weblogs and much more.
+</p>
+<p>
+XOOPS is released under the terms of the <a href='http://www.gnu.org/copyleft/gpl.html' target='_blank'>GNU General Public License (GPL)</a> and is free to use and modify.
+It is free to redistribute as long as you abide by the distribution terms of the GPL.
+</p>
+<u><b>Requirements</b></u>
+<p>
+<ul>
+<li>Web Server: Any server supporting the required PHP version (<a href='http://www.apache.org' target='_blank' title='Apache'>Apache</a> highly recommended)</li>
+<li><a href='http://www.php.net' target='_blank' title='PHP'>PHP</a>: Any PHP version >= 4.3 (PHP 4.2.x may work but is not officially supported)</li>
+<li><a href='http://www.mysql.com' target='_blank' title='MySQL'>MySQL</a>: MySQL server 3.23+</li>
+</ul>
+</p>
+<u><b>Before you install</b></u>
+<ul>
+<li>Setup WWW server, PHP and database server properly.</li>
+<li>Prepare a database for your XOOPS site.</li>
+<li>Prepare user account and grant the user the access to the database.</li>
+<li>Make the directories of uploads/, cache/ and templates_c/ and the files of mainfile.php writabale.</li>
+<li>Turn cookie and JavaScript of your browser on.</li>
+</ul>
+<u><b>Installation</b></u>
+<p>
+Follow this install wizard.
+</p>
+"
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/makedata.php 2.2.6.src/install/makedata.php
--- 2.2.3a-Final.src/install/makedata.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/makedata.php	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,131 @@
+<?php
+// $Id: makedata.php 184 2006-01-22 22:34:51Z skalpa $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+
+include_once './class/dbmanager.php';
+
+// RMV
+// TODO: Shouldn't we insert specific field names??  That way we can use
+// the defaults specified in the database...!!!! (and don't have problem
+// of missing fields in install file, when add new fields to database)
+
+function make_groups(&$dbm){
+    $gruops['XOOPS_GROUP_ADMIN'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_WEBMASTER)."', '".addslashes(_INSTALL_WEBMASTERD)."', 'Admin')");
+    $gruops['XOOPS_GROUP_USERS'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_REGUSERS)."', '".addslashes(_INSTALL_REGUSERSD)."', 'User')");
+    $gruops['XOOPS_GROUP_ANONYMOUS'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_ANONUSERS)."', '".addslashes(_INSTALL_ANONUSERSD)."', 'Anonymous')");
+
+    if(!$gruops['XOOPS_GROUP_ADMIN'] || !$gruops['XOOPS_GROUP_USERS'] || !$gruops['XOOPS_GROUP_ANONYMOUS']){
+        return false;
+    }
+
+    return $gruops;
+}
+
+function make_data(&$dbm, &$cm, $adminname, $adminpass, $adminmail, $language, $gruops){
+
+    $myts =& textSanitizer::getInstance();
+    //$xoopsDB =& Database::getInstance();
+    //$dbm = new db_manager;
+
+    $tables = array();
+
+    // data for table 'groups_users_link'
+
+    $dbm->insert('groups_users_link', " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 1)");
+    $dbm->insert('groups_users_link', " VALUES (0, ".$gruops['XOOPS_GROUP_USERS'].", 1)");
+
+    // data for table 'group_permission'
+
+    $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_ADMIN'].",1,1,'module_admin')");
+    $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_ADMIN'].",1,1, 'module_read')");
+    $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_USERS'].",1,1,'module_read')");
+    $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_ANONYMOUS'].",1,1,'module_read')");
+
+	$dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",1,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",2,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",3,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",4,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",5,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",6,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",7,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",8,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",9,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",10,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",11,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",12,1,'system_admin')");
+   $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",13,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",14,1,'system_admin')");
+    $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",15,1,'system_admin')");
+
+    // data for table 'banner'
+
+    $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (1, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/xoops_banner.gif', 'http://www.xoops.org/', 1008813250)");
+    $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (2, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/xoops_banner_2.gif', 'http://www.xoops.org/', 1008813250)");
+    $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (3, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/banner.swf', 'http://www.xoops.org/', 1008813250)");
+
+    // default theme
+
+    $time = time();
+    $dbm->insert('tplset', " VALUES (1, 'default', 'XOOPS Default Template Set', '', ".$time.")");
+
+    // system modules
+
+    if ( file_exists('../modules/system/language/'.$language.'/modinfo.php') ) {
+        include '../modules/system/language/'.$language.'/modinfo.php';
+    } else {
+        include '../modules/system/language/english/modinfo.php';
+        $language = 'english';
+    }
+
+    $modversion = array();
+    include_once '../modules/system/xoops_version.php';
+    $time = time();
+
+    // data for table 'users'
+
+    /*
+    $temp = md5($adminpass);
+    $regdate = time();
+    //$dbadminname= addslashes($adminname);
+	// RMV-NOTIFY (updated for extra columns in user table)
+	$member_handler =& xoops_gethandler('member');
+	$user =& $member_handler->createUser();
+	$user->setVar('uid', 1);
+	$user->setVar('uname', addslashes($adminname));
+	$user->setVar('name', addslashes($adminname)); //set real name to username for now
+	$user->setVar('email', addslashes($adminmail));
+	$user->setVar('user_avatar', 'blank.gif');
+	$user->setVar('pass', $temp);
+	$user->setVar('rank', 7);
+	$user->setVar('level', 5);
+	if (!$member_handler->insertUser($user)) {
+	    echo $user->getHtmlErrors();
+	}
+	*/
+
+    return $gruops;
+}
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/passwd.php 2.2.6.src/install/passwd.php
--- 2.2.3a-Final.src/install/passwd.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/passwd.php	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,6 @@
+<?php
+//  If you use HTTP authentication for XOOPS installer,
+//  put user name and passward in the define statement below.
+define('INSTALL_USER', '');
+define('INSTALL_PASSWD', '');
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/sql/mysql.data.sql 2.2.6.src/install/sql/mysql.data.sql
--- 2.2.3a-Final.src/install/sql/mysql.data.sql	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/sql/mysql.data.sql	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,67 @@
+# phpMyAdmin MySQL-Dump
+# version 2.3.2
+# http://www.phpmyadmin.net/ (download page)
+#
+# Host: localhost
+# Generation Time: Jan 09, 2003 at 12:37 AM
+# Server version: 3.23.54
+# PHP Version: 4.2.2
+# Database : `xoops2`
+
+
+#
+# Dumping data for table `bannerclient`
+#
+
+INSERT INTO bannerclient VALUES (0, 'XOOPS', 'XOOPS Dev Team', 'webmaster@xoops.org', '', '', '');
+
+#
+# Dumping data for table `bannerfinish`
+#
+
+#
+# Dumping data for table `configoption`
+#
+
+
+
+#
+# Dumping data for table `image`
+#
+
+
+#
+# Dumping data for table `imagebody`
+#
+
+
+#
+# Dumping data for table `imagecategory`
+#
+
+
+#
+# Dumping data for table `imgset`
+#
+
+INSERT INTO imgset VALUES (1, 'default', 0);
+
+#
+# Dumping data for table `imgset_tplset_link`
+#
+
+INSERT INTO imgset_tplset_link VALUES (1, 'default');
+
+#
+# Dumping data for table `online`
+#
+
+
+#
+# Dumping data for table `priv_msgs`
+#
+
+
+#
+# Dumping data for table `session`
+#
diff -ruN 2.2.3a-Final.src/install/sql/mysql.structure.sql 2.2.6.src/install/sql/mysql.structure.sql
--- 2.2.3a-Final.src/install/sql/mysql.structure.sql	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/sql/mysql.structure.sql	2007-09-09 00:44:27.000000000 -0500
@@ -0,0 +1,558 @@
+# phpMyAdmin MySQL-Dump
+# version 2.3.2
+# http://www.phpmyadmin.net/ (download page)
+#
+# Host: localhost
+# Generation Time: Jan 09, 2003 at 12:35 AM
+# Server version: 3.23.54
+# PHP Version: 4.2.2
+# Database : `xoops2`
+# --------------------------------------------------------
+
+#
+# Table structure for table `avatar`
+#
+
+CREATE TABLE avatar (
+  avatar_id mediumint(8) unsigned NOT NULL auto_increment,
+  avatar_file varchar(30) NOT NULL default '',
+  avatar_name varchar(100) NOT NULL default '',
+  avatar_mimetype varchar(30) NOT NULL default '',
+  avatar_created int(10) NOT NULL default '0',
+  avatar_display tinyint(1) unsigned NOT NULL default '0',
+  avatar_weight smallint(5) unsigned NOT NULL default '0',
+  avatar_type char(1) NOT NULL default '',
+  PRIMARY KEY  (avatar_id),
+  KEY avatar_type (avatar_type,avatar_display)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `avatar_user_link`
+#
+
+CREATE TABLE avatar_user_link (
+  avatar_id mediumint(8) unsigned NOT NULL default '0',
+  user_id mediumint(8) unsigned NOT NULL default '0',
+  KEY avatar_user_id (avatar_id,user_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `banner`
+#
+
+CREATE TABLE banner (
+  bid smallint(5) unsigned NOT NULL auto_increment,
+  cid tinyint(3) unsigned NOT NULL default '0',
+  imptotal mediumint(8) unsigned NOT NULL default '0',
+  impmade mediumint(8) unsigned NOT NULL default '0',
+  clicks mediumint(8) unsigned NOT NULL default '0',
+  imageurl varchar(255) NOT NULL default '',
+  clickurl varchar(255) NOT NULL default '',
+  date int(10) NOT NULL default '0',
+  htmlbanner tinyint(1) NOT NULL default '0',
+  htmlcode text NOT NULL,
+  PRIMARY KEY  (bid),
+  KEY idxbannercid (cid),
+  KEY idxbannerbidcid (bid,cid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `bannerclient`
+#
+
+CREATE TABLE bannerclient (
+  cid smallint(5) unsigned NOT NULL auto_increment,
+  name varchar(60) NOT NULL default '',
+  contact varchar(60) NOT NULL default '',
+  email varchar(60) NOT NULL default '',
+  login varchar(10) NOT NULL default '',
+  passwd varchar(10) NOT NULL default '',
+  extrainfo text NOT NULL,
+  PRIMARY KEY  (cid),
+  KEY login (login)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `bannerfinish`
+#
+
+CREATE TABLE bannerfinish (
+  bid smallint(5) unsigned NOT NULL auto_increment,
+  cid smallint(5) unsigned NOT NULL default '0',
+  impressions mediumint(8) unsigned NOT NULL default '0',
+  clicks mediumint(8) unsigned NOT NULL default '0',
+  datestart int(10) unsigned NOT NULL default '0',
+  dateend int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (bid),
+  KEY cid (cid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `block_module_link`
+#
+
+CREATE TABLE block_module_link (
+  block_id mediumint(8) unsigned NOT NULL default '0',
+  module_id smallint(5) NOT NULL default '0',
+  pageid smallint(5) NOT NULL default '0',
+  PRIMARY KEY (block_id, module_id, pageid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `comments`
+#
+
+CREATE TABLE xoopscomments (
+  com_id mediumint(8) unsigned NOT NULL auto_increment,
+  com_pid mediumint(8) unsigned NOT NULL default '0',
+  com_rootid mediumint(8) unsigned NOT NULL default '0',
+  com_modid smallint(5) unsigned NOT NULL default '0',
+  com_itemid mediumint(8) unsigned NOT NULL default '0',
+  com_icon varchar(25) NOT NULL default '',
+  com_created int(10) unsigned NOT NULL default '0',
+  com_modified int(10) unsigned NOT NULL default '0',
+  com_uid mediumint(8) unsigned NOT NULL default '0',
+  com_ip varchar(15) NOT NULL default '',
+  com_title varchar(255) NOT NULL default '',
+  com_text text NOT NULL,
+  com_sig tinyint(1) unsigned NOT NULL default '0',
+  com_status tinyint(1) unsigned NOT NULL default '0',
+  com_exparams varchar(255) NOT NULL default '',
+  dohtml tinyint(1) unsigned NOT NULL default '0',
+  dosmiley tinyint(1) unsigned NOT NULL default '0',
+  doxcode tinyint(1) unsigned NOT NULL default '0',
+  doimage tinyint(1) unsigned NOT NULL default '0',
+  dobr tinyint(1) unsigned NOT NULL default '0',
+  PRIMARY KEY  (com_id),
+  KEY com_pid (com_pid),
+  KEY com_itemid (com_itemid),
+  KEY com_uid (com_uid),
+  KEY com_title (com_title(40))
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+# RMV-NOTIFY
+# Table structure for table `notifications`
+#
+
+CREATE TABLE xoopsnotifications (
+  not_id mediumint(8) unsigned NOT NULL auto_increment,
+  not_modid smallint(5) unsigned NOT NULL default '0',
+  not_itemid mediumint(8) unsigned NOT NULL default '0',
+  not_category varchar(30) NOT NULL default '',
+  not_event varchar(30) NOT NULL default '',
+  not_uid mediumint(8) unsigned NOT NULL default '0',
+  not_mode tinyint(1) NOT NULL default 0,
+  PRIMARY KEY (not_id),
+  KEY not_modid (not_modid),
+  KEY not_itemid (not_itemid),
+  KEY not_class (not_category),
+  KEY not_uid (not_uid),
+  KEY not_event (not_event)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `config`
+#
+
+CREATE TABLE config (
+  conf_id mediumint(8) unsigned NOT NULL auto_increment,
+  conf_modid smallint(5) unsigned NOT NULL default '0',
+  conf_catid smallint(5) unsigned NOT NULL default '0',
+  conf_name varchar(25) NOT NULL default '',
+  conf_title varchar(255) NOT NULL default '',
+  conf_value text NOT NULL,
+  conf_desc varchar(50) NOT NULL default '',
+  conf_formtype varchar(15) NOT NULL default '',
+  conf_valuetype varchar(10) NOT NULL default '',
+  conf_order smallint(5) unsigned NOT NULL default '0',
+  PRIMARY KEY  (conf_id),
+  KEY conf_mod_cat_id (conf_modid,conf_catid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `configcategory`
+#
+
+CREATE TABLE configcategory (
+  confcat_id smallint(5) unsigned NOT NULL,
+  confcat_modid smallint(5) unsigned NOT NULL default '0',
+  confcat_name varchar(255) NOT NULL default '',
+  confcat_order smallint(5) unsigned NOT NULL default '0',
+  confcat_nameid varchar(255) NOT NULL default '',
+  confcat_description text NOT NULL,
+  PRIMARY KEY  (`confcat_id`, `confcat_modid`),
+  KEY module (`confcat_modid`)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `configoption`
+#
+
+CREATE TABLE configoption (
+  confop_id mediumint(8) unsigned NOT NULL auto_increment,
+  confop_name varchar(255) NOT NULL default '',
+  confop_value varchar(255) NOT NULL default '',
+  conf_id smallint(5) unsigned NOT NULL default '0',
+  PRIMARY KEY  (confop_id),
+  KEY conf_id (conf_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `groups`
+#
+
+CREATE TABLE groups (
+  groupid smallint(5) unsigned NOT NULL auto_increment,
+  name varchar(50) NOT NULL default '',
+  description text NOT NULL,
+  group_type varchar(10) NOT NULL default '',
+  PRIMARY KEY  (groupid),
+  KEY group_type (group_type)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `group_permission`
+#
+
+CREATE TABLE group_permission (
+  gperm_id int(10) unsigned NOT NULL auto_increment,
+  gperm_groupid smallint(5) unsigned NOT NULL default '0',
+  gperm_itemid mediumint(8) unsigned NOT NULL default '0',
+  gperm_modid mediumint(5) unsigned NOT NULL default '0',
+  gperm_name varchar(50) NOT NULL default '',
+  PRIMARY KEY  (gperm_id),
+  KEY groupid (gperm_groupid),
+  KEY itemid (gperm_itemid),
+  KEY gperm_modid (gperm_modid,gperm_name(10))
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+
+#
+# Table structure for table `groups_users_link`
+#
+
+CREATE TABLE groups_users_link (
+  linkid mediumint(8) unsigned NOT NULL auto_increment,
+  groupid smallint(5) unsigned NOT NULL default '0',
+  uid mediumint(8) unsigned NOT NULL default '0',
+  PRIMARY KEY  (linkid),
+  KEY groupid_uid (groupid,uid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `image`
+#
+
+CREATE TABLE image (
+  image_id mediumint(8) unsigned NOT NULL auto_increment,
+  image_name varchar(30) NOT NULL default '',
+  image_nicename varchar(255) NOT NULL default '',
+  image_mimetype varchar(30) NOT NULL default '',
+  image_created int(10) unsigned NOT NULL default '0',
+  image_display tinyint(1) unsigned NOT NULL default '0',
+  image_weight smallint(5) unsigned NOT NULL default '0',
+  imgcat_id smallint(5) unsigned NOT NULL default '0',
+  PRIMARY KEY  (image_id),
+  KEY imgcat_id (imgcat_id),
+  KEY image_display (image_display)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `imagebody`
+#
+
+CREATE TABLE imagebody (
+  image_id mediumint(8) unsigned NOT NULL default '0',
+  image_body mediumblob,
+  KEY image_id (image_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `imagecategory`
+#
+
+CREATE TABLE imagecategory (
+  imgcat_id smallint(5) unsigned NOT NULL auto_increment,
+  imgcat_name varchar(100) NOT NULL default '',
+  imgcat_maxsize int(8) unsigned NOT NULL default '0',
+  imgcat_maxwidth smallint(3) unsigned NOT NULL default '0',
+  imgcat_maxheight smallint(3) unsigned NOT NULL default '0',
+  imgcat_display tinyint(1) unsigned NOT NULL default '0',
+  imgcat_weight smallint(3) unsigned NOT NULL default '0',
+  imgcat_type char(1) NOT NULL default '',
+  imgcat_storetype varchar(5) NOT NULL default '',
+  PRIMARY KEY  (imgcat_id),
+  KEY imgcat_display (imgcat_display)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+
+#
+# Table structure for table `imgset`
+#
+
+CREATE TABLE imgset (
+  imgset_id smallint(5) unsigned NOT NULL auto_increment,
+  imgset_name varchar(50) NOT NULL default '',
+  imgset_refid mediumint(8) unsigned NOT NULL default '0',
+  PRIMARY KEY  (imgset_id),
+  KEY imgset_refid (imgset_refid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `imgset_tplset_link`
+#
+
+CREATE TABLE imgset_tplset_link (
+  imgset_id smallint(5) unsigned NOT NULL default '0',
+  tplset_name varchar(50) NOT NULL default '',
+  KEY tplset_name (tplset_name(10))
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `imgsetimg`
+#
+
+CREATE TABLE imgsetimg (
+  imgsetimg_id mediumint(8) unsigned NOT NULL auto_increment,
+  imgsetimg_file varchar(50) NOT NULL default '',
+  imgsetimg_body blob NOT NULL,
+  imgsetimg_imgset smallint(5) unsigned NOT NULL default '0',
+  PRIMARY KEY  (imgsetimg_id),
+  KEY imgsetimg_imgset (imgsetimg_imgset)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `modules`
+#
+
+CREATE TABLE modules (
+  mid smallint(5) unsigned NOT NULL auto_increment,
+  name varchar(150) NOT NULL default '',
+  version smallint(5) unsigned NOT NULL default '100',
+  last_update int(10) unsigned NOT NULL default '0',
+  weight smallint(3) unsigned NOT NULL default '0',
+  isactive tinyint(1) unsigned NOT NULL default '0',
+  dirname varchar(25) NOT NULL default '',
+  hasmain tinyint(1) unsigned NOT NULL default '0',
+  hasadmin tinyint(1) unsigned NOT NULL default '0',
+  hassearch tinyint(1) unsigned NOT NULL default '0',
+  hasconfig tinyint(1) unsigned NOT NULL default '0',
+  hascomments tinyint(1) unsigned NOT NULL default '0',
+  hasnotification tinyint(1) unsigned NOT NULL default '0',
+  PRIMARY KEY  (mid),
+  KEY hasmain (hasmain),
+  KEY hasadmin (hasadmin),
+  KEY hassearch (hassearch),
+  KEY hasnotification (hasnotification),
+  KEY dirname (dirname),
+  KEY name (name(15))
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `newblocks`
+#
+
+CREATE TABLE newblocks (
+  bid mediumint(8) unsigned NOT NULL auto_increment,
+  mid smallint(5) unsigned NOT NULL default '0',
+  options varchar(255) NOT NULL default '',
+  name varchar(255) NOT NULL default '',
+  c_type char(1) NOT NULL default '',
+  isactive tinyint(1) unsigned NOT NULL default '0',
+  dirname varchar(50) NOT NULL default '',
+  func_file varchar(50) NOT NULL default '',
+  show_func varchar(50) NOT NULL default '',
+  edit_func varchar(50) NOT NULL default '',
+  template varchar(50) NOT NULL default '',
+  last_modified int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (bid),
+  KEY mid (mid),
+  KEY `active` (`bid`, `isactive`)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `online`
+#
+
+CREATE TABLE online (
+  online_uid mediumint(8) unsigned NOT NULL default '0',
+  online_uname varchar(25) NOT NULL default '',
+  online_updated int(10) unsigned NOT NULL default '0',
+  online_module smallint(5) unsigned NOT NULL default '0',
+  online_ip varchar(15) NOT NULL default '',
+  KEY online_module (online_module)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `ranks`
+#
+
+CREATE TABLE ranks (
+  rank_id smallint(5) unsigned NOT NULL auto_increment,
+  rank_title varchar(50) NOT NULL default '',
+  rank_min mediumint(8) unsigned NOT NULL default '0',
+  rank_max mediumint(8) unsigned NOT NULL default '0',
+  rank_special tinyint(1) unsigned NOT NULL default '0',
+  rank_image varchar(255) default NULL default '',
+  PRIMARY KEY  (rank_id),
+  KEY rank_min (rank_min),
+  KEY rank_max (rank_max),
+  KEY rankminrankmaxranspecial (rank_min,rank_max,rank_special),
+  KEY rankspecial (rank_special)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `session`
+#
+
+CREATE TABLE session (
+  sess_id varchar(32) NOT NULL default '',
+  sess_updated int(10) unsigned NOT NULL default '0',
+  sess_ip varchar(15) NOT NULL default '',
+  sess_data MEDIUMBLOB NOT NULL,
+  PRIMARY KEY  (sess_id),
+  KEY updated (sess_updated)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `smiles`
+#
+
+CREATE TABLE smiles (
+  id smallint(5) unsigned NOT NULL auto_increment,
+  code varchar(50) NOT NULL default '',
+  smile_url varchar(100) NOT NULL default '',
+  emotion varchar(75) NOT NULL default '',
+  display tinyint(1) NOT NULL default '0',
+  PRIMARY KEY  (id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `tplset`
+#
+
+CREATE TABLE tplset (
+  tplset_id int(7) unsigned NOT NULL auto_increment,
+  tplset_name varchar(50) NOT NULL default '',
+  tplset_desc varchar(255) NOT NULL default '',
+  tplset_credits text NOT NULL,
+  tplset_created int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (tplset_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `tplfile`
+#
+
+CREATE TABLE tplfile (
+  tpl_id mediumint(7) unsigned NOT NULL auto_increment,
+  tpl_refid smallint(5) unsigned NOT NULL default '0',
+  tpl_module varchar(25) NOT NULL default '',
+  tpl_tplset varchar(50) NOT NULL default '',
+  tpl_file varchar(50) NOT NULL default '',
+  tpl_desc varchar(255) NOT NULL default '',
+  tpl_lastmodified int(10) unsigned NOT NULL default '0',
+  tpl_lastimported int(10) unsigned NOT NULL default '0',
+  tpl_type varchar(20) NOT NULL default '',
+  PRIMARY KEY  (tpl_id),
+  KEY tpl_refid (tpl_refid,tpl_type),
+  KEY tpl_tplset (tpl_tplset,tpl_file(10))
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `tplsource`
+#
+
+CREATE TABLE tplsource (
+  tpl_id mediumint(7) unsigned NOT NULL default '0',
+  tpl_source mediumtext NOT NULL,
+  KEY tpl_id (tpl_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+# Table structure for table `users`
+#
+
+CREATE TABLE `users` (
+  `uid` mediumint(8) unsigned NOT NULL auto_increment,
+  `uname` varchar(55) NOT NULL default '',
+  `loginname` varchar(25) NOT NULL default '',
+  `name` varchar(75) NOT NULL default '',
+  `email` varchar(60) NOT NULL default '',
+  `user_avatar` varchar(30) NOT NULL default 'blank.gif',
+  `pass` varchar(32) NOT NULL default '',
+  `rank` smallint(5) unsigned NOT NULL default '0',
+  `level` tinyint(3) NOT NULL default '1',
+  PRIMARY KEY  (`uid`),
+  KEY uname (`uname`),
+  KEY email (`email`),
+  KEY uiduname (`uid`,`uname`),
+  KEY unamepass (`uname`,`pass`)
+) TYPE=MyISAM;
+
+CREATE TABLE `user_profile` (
+  `profileid` int(12) unsigned NOT NULL auto_increment,
+  PRIMARY KEY  (`profileid`)
+) TYPE=MyISAM;
+
+CREATE TABLE `user_profile_field` (
+  `fieldid` int(12) unsigned NOT NULL auto_increment,
+  `field_type` varchar(30) NOT NULL default '',
+  `field_valuetype` tinyint(2) unsigned NOT NULL default '0',
+  `field_name` varchar(255) NOT NULL default '',
+  `field_title` varchar(255) NOT NULL default '',
+  `field_description` text NOT NULL,
+  `field_required` tinyint(2) unsigned NOT NULL default '0',
+  `field_maxlength` tinyint(6) unsigned NOT NULL default '0',
+  `field_default` text NOT NULL,
+  `field_moduleid` int(12) unsigned NOT NULL default '0',
+  `field_notnull` tinyint(2) unsigned NOT NULL default '0',
+  `field_edit` tinyint(2) unsigned NOT NULL default '0',
+  `field_show` tinyint(2) unsigned NOT NULL default '0',
+  `field_config` tinyint(2) unsigned NOT NULL default '0',
+  `field_options` text NOT NULL default '',
+  `field_register` tinyint(2) unsigned NOT NULL default '0',
+  PRIMARY KEY  (`fieldid`),
+  UNIQUE KEY `field_name` (`field_name`)
+) TYPE=MyISAM;
+
+CREATE TABLE `block_instance` (
+  `instanceid` int(12) unsigned NOT NULL auto_increment,
+  `bid` int(12) unsigned NOT NULL default '0',
+  `options` text NOT NULL default '',
+  `title` varchar(255) NOT NULL default '',
+  `side` tinyint(1) unsigned NOT NULL default '0',
+  `weight` smallint(5) unsigned NOT NULL default '0',
+  `visible` tinyint(1) unsigned NOT NULL default '0',
+  `bcachetime` int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY (`instanceid`),
+  KEY `joinkeys` (`instanceid`, `visible`, `weight`)
+) TYPE=MyISAM;
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/install/style.css 2.2.6.src/install/style.css
--- 2.2.3a-Final.src/install/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/install/style.css	2006-01-22 16:34:51.000000000 -0600
@@ -0,0 +1,62 @@
+body		{	
+    font-family : tahoma, osaka,taipei,verdana, arial, helvetica, sans-serif;
+	color;#000000;
+	font-size: 12px;
+	margin: 0;
+	padding: 0;
+}
+
+a		{	
+    text-decoration: none;
+	color: #666666;font-weight: bold;
+	background-color: transparent;
+}
+
+a:hover		{	
+    text-decoration: none;
+    	color: #ff9966;
+    	font-weight: bold;
+    	background-color: transparent;
+}
+
+td		{	
+    font-family : tahoma, osaka,taipei,verdana, arial, helvetica, sans-serif;
+	color: #000000;
+	font-size: 12px;
+	border-top-width : 1px;
+	border-right-width : 1px;
+	border-bottom-width : 1px;
+	border-left-width : 1px;
+}
+
+img		{	border:0;			}
+div		{	text-align: center;		}
+.bg1        {        background-color: #f7f7f7; color: #000000;       }
+.bg2        {        background-color: #000000; color: #ffffff;       }
+.bg3        {        background-color: #2f5376; color: #f9b743;       }
+.bg4        {        background-color: #f5f5f5; color: #000000;       }
+.bg5        {        background-color: #f5f5f5; color: #000000;       }
+.fg1        {        color: #f9b743;                                  }
+.fg2        {        color: #000000;                                  }
+
+input		{
+    border-right: #000000 1px solid;
+	border-top: #000000 1px solid;
+	font: 8pt verdana, arial, helvetica;
+	border-left: #000000 1px solid;
+	color: #000000;
+	border-bottom: #000000 1px solid;
+	background-color: #f7f7f7
+}
+
+select {
+    border-right: #000000 1px solid;
+	border-top: #000000 1px solid; background: #f7f7f7;
+	font: 8pt verdana, arial, helvetica;
+	border-left: #000000 1px solid;
+	color: #000000;
+	border-bottom: #000000 1px solid
+}
+table {
+    border : 0;
+}
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/kernel/avatar.php 2.2.6.src/kernel/avatar.php
--- 2.2.3a-Final.src/kernel/avatar.php	2005-09-19 18:34:48.000000000 -0500
+++ 2.2.6.src/kernel/avatar.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: avatar.php,v 1.4.6.2.2.1 2005/09/20 00:34:48 skalpa Exp $
+// $Id: avatar.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/blockinstance.php 2.2.6.src/kernel/blockinstance.php
--- 2.2.3a-Final.src/kernel/blockinstance.php	2005-09-18 07:15:21.000000000 -0500
+++ 2.2.6.src/kernel/blockinstance.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: blockinstance.php,v 1.1.2.13.2.1 2005/09/18 13:15:21 mithyt2 Exp $
+// $Id: blockinstance.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -108,13 +108,13 @@
                 // execute the function
                 $block = $show_func($options);
                 if ( !$block ) {
-                    return false;
+                    return $block;
                 }
             } else {
-                return false;
+                return $block;
             }
         } else {
-            return false;
+            return $block;
         }
 
         return $block;
@@ -166,7 +166,7 @@
     function getLinkedObjects($groupid, $module_id=0, $pageid=0, $visible=null, $orderby='i.weight,i.instanceid', $isactive=1) {
         $ret = array();
         $groupperm_handler =& xoops_gethandler('groupperm');
-        $instanceids =& $groupperm_handler->getItemIds('block_read', $groupid);
+        $instanceids = $groupperm_handler->getItemIds('block_read', $groupid);
         if (!empty($instanceids)) {
             $block_handler =& xoops_gethandler('block');
             $sql = 'SELECT DISTINCT i.instanceid, b.*, i.* FROM '.$this->table.' i, '.$block_handler->table.' b, '.$this->db->prefix('block_module_link').' m WHERE m.block_id=i.instanceid';
diff -ruN 2.2.3a-Final.src/kernel/block.php 2.2.6.src/kernel/block.php
--- 2.2.3a-Final.src/kernel/block.php	2005-09-23 06:58:20.000000000 -0500
+++ 2.2.6.src/kernel/block.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: block.php,v 1.4.6.12.2.5 2005/09/23 12:58:20 mithyt2 Exp $
+// $Id: block.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -136,9 +136,12 @@
         }
         if ($block->getVar('template') != '') {
             $tplfile_handler =& xoops_gethandler('tplfile');
-            $btemplate = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block->getVar('bid'));
-            if (count($btemplate) > 0) {
-                $tplfile_handler->delete($btemplate[0]);
+            $btemplate = $tplfile_handler->find(null, 'block', $block->getVar('bid'));
+            $btcount = count( $btemplate );
+            if ($btcount > 0) {
+                for ($j = 0; $j < $btcount; $j++) {
+                	$tplfile_handler->delete($btemplate[$j]);
+                }
             }
         }
         return parent::delete($block, $force);
diff -ruN 2.2.3a-Final.src/kernel/comment.php 2.2.6.src/kernel/comment.php
--- 2.2.3a-Final.src/kernel/comment.php	2005-09-19 18:35:35.000000000 -0500
+++ 2.2.6.src/kernel/comment.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment.php,v 1.5.6.5.2.1 2005/09/20 00:35:35 skalpa Exp $
+// $Id: comment.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/configcategory.php 2.2.6.src/kernel/configcategory.php
--- 2.2.3a-Final.src/kernel/configcategory.php	2005-07-15 11:07:19.000000000 -0500
+++ 2.2.6.src/kernel/configcategory.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: configcategory.php,v 1.4.6.5 2005/07/15 17:07:19 phppp Exp $
+// $Id: configcategory.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/configitem.php 2.2.6.src/kernel/configitem.php
--- 2.2.3a-Final.src/kernel/configitem.php	2005-09-19 18:37:58.000000000 -0500
+++ 2.2.6.src/kernel/configitem.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: configitem.php,v 1.8.6.10.2.2 2005/09/20 00:37:58 skalpa Exp $
+// $Id: configitem.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/configoption.php 2.2.6.src/kernel/configoption.php
--- 2.2.3a-Final.src/kernel/configoption.php	2005-07-15 11:07:19.000000000 -0500
+++ 2.2.6.src/kernel/configoption.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: configoption.php,v 1.6.6.3 2005/07/15 17:07:19 phppp Exp $
+// $Id: configoption.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/config.php 2.2.6.src/kernel/config.php
--- 2.2.3a-Final.src/kernel/config.php	2005-09-19 18:37:21.000000000 -0500
+++ 2.2.6.src/kernel/config.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: config.php,v 1.6.6.4.2.1 2005/09/20 00:37:21 skalpa Exp $
+// $Id: config.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -196,7 +196,7 @@
      * 
      * @return	array   Array of {@link XoopsConfigItem} objects
      */
-    function getConfigs($criteria = null, $id_as_key = false, $with_options = false)
+    function &getConfigs($criteria = null, $id_as_key = false, $with_options = false)
     {
         $confs = $this->_cHandler->getObjects($criteria, $id_as_key);
         if ($with_options == true) {
diff -ruN 2.2.3a-Final.src/kernel/editor.php 2.2.6.src/kernel/editor.php
--- 2.2.3a-Final.src/kernel/editor.php	2005-06-03 20:01:00.000000000 -0500
+++ 2.2.6.src/kernel/editor.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: editor.php,v 1.1.2.1 2005/06/04 02:01:00 phppp Exp $
+// $Id: editor.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/groupperm.php 2.2.6.src/kernel/groupperm.php
--- 2.2.3a-Final.src/kernel/groupperm.php	2005-07-15 11:07:19.000000000 -0500
+++ 2.2.6.src/kernel/groupperm.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: groupperm.php,v 1.10.6.5 2005/07/15 17:07:19 phppp Exp $
+// $Id: groupperm.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/group.php 2.2.6.src/kernel/group.php
--- 2.2.3a-Final.src/kernel/group.php	2005-09-19 18:38:24.000000000 -0500
+++ 2.2.6.src/kernel/group.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: group.php,v 1.5.6.5.2.1 2005/09/20 00:38:24 skalpa Exp $
+// $Id: group.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/handlerregistry.php 2.2.6.src/kernel/handlerregistry.php
--- 2.2.3a-Final.src/kernel/handlerregistry.php	2003-03-12 15:02:42.000000000 -0600
+++ 2.2.6.src/kernel/handlerregistry.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: handlerregistry.php,v 1.9 2003/03/12 21:02:42 okazu Exp $
+// $Id: handlerregistry.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/imagecategory.php 2.2.6.src/kernel/imagecategory.php
--- 2.2.3a-Final.src/kernel/imagecategory.php	2005-09-19 18:41:05.000000000 -0500
+++ 2.2.6.src/kernel/imagecategory.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: imagecategory.php,v 1.3.16.1 2005/09/20 00:41:05 skalpa Exp $
+// $Id: imagecategory.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/image.php 2.2.6.src/kernel/image.php
--- 2.2.3a-Final.src/kernel/image.php	2005-09-19 18:40:12.000000000 -0500
+++ 2.2.6.src/kernel/image.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: image.php,v 1.8.16.1 2005/09/20 00:40:12 skalpa Exp $
+// $Id: image.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/imagesetimg.php 2.2.6.src/kernel/imagesetimg.php
--- 2.2.3a-Final.src/kernel/imagesetimg.php	2005-09-19 18:41:42.000000000 -0500
+++ 2.2.6.src/kernel/imagesetimg.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: imagesetimg.php,v 1.3.16.1 2005/09/20 00:41:42 skalpa Exp $
+// $Id: imagesetimg.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/imageset.php 2.2.6.src/kernel/imageset.php
--- 2.2.3a-Final.src/kernel/imageset.php	2005-09-19 18:41:23.000000000 -0500
+++ 2.2.6.src/kernel/imageset.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: imageset.php,v 1.3.16.1 2005/09/20 00:41:23 skalpa Exp $
+// $Id: imageset.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/member.php 2.2.6.src/kernel/member.php
--- 2.2.3a-Final.src/kernel/member.php	2005-09-19 18:43:18.000000000 -0500
+++ 2.2.6.src/kernel/member.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: member.php,v 1.10.24.7.2.1 2005/09/20 00:43:18 skalpa Exp $
+// $Id: member.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -276,7 +276,7 @@
      */
     function getUsersByGroup($group_id, $asobject = false, $limit = 0, $start = 0)
     {
-        $user_ids =& $this->_mHandler->getUsersByGroup($group_id, $limit, $start);
+        $user_ids = $this->_mHandler->getUsersByGroup($group_id, $limit, $start);
         if (!$asobject) {
            return $user_ids;
         } else {
@@ -301,7 +301,7 @@
      */
     function getGroupsByUser($user_id, $asobject = false)
     {
-        $group_ids =& $this->_mHandler->getGroupsByUser($user_id);
+        $group_ids = $this->_mHandler->getGroupsByUser($user_id);
         if (!$asobject) {
            return $group_ids;
         } else {
diff -ruN 2.2.3a-Final.src/kernel/module.php 2.2.6.src/kernel/module.php
--- 2.2.3a-Final.src/kernel/module.php	2005-10-30 15:19:08.000000000 -0600
+++ 2.2.6.src/kernel/module.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: module.php,v 1.12.6.42.2.11 2005/09/29 17:04:50 mithyt2 Exp $
+// $Id: module.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -142,7 +142,7 @@
      * @param   mix  	$value
      * @return  bool
      **/
-    function &setInfo($name, $value)
+    function setInfo($name, $value)
     {
         if(empty($name)) {
 	        $this->modinfo = $value;
@@ -369,7 +369,7 @@
         global $xoopsConfig, $xoopsOption;
 
         $relative_url = XOOPS_URL;
-        if (preg_match('!^http://!i', $relative_url)) {
+        if (preg_match('!^https?://!i', $relative_url)) {
             $uri_parts = parse_url($relative_url);
             $relative_url = empty($uri_parts['path'])?"":$uri_parts['path'];
         }
@@ -386,7 +386,7 @@
             }
         }
         elseif ($this->getvar('dirname') != "system") {
-            if (preg_match("/[^\?]*index\.php$/i", $_SERVER['REQUEST_URI']) && $xoopsConfig['startpage'] == $this->getVar('dirname')) {
+            if (preg_match("/[^\?]*index\.php[\?]*$/i", $_SERVER['REQUEST_URI']) && $xoopsConfig['startpage'] == $this->getVar('dirname')) {
                 //on top page
                 $moduleid = 0;
                 $pageid = 1;
@@ -500,18 +500,21 @@
             return;
         }
 
-        echo $this->insert();
+        $this->insert();
 
         $this->executeScript('onUpdate');
         //@todo: what if it fails? Roll back update?
 
         //re-set version to new version while keeping custom name
-        $this->setVar('version', $new_version);
+        $this->setVar('version', $new_version, true);
         $module_handler =& xoops_gethandler('module');
         $module_handler->insert($this);
         foreach ($this->getMessages() as $msg) {
             echo '<code>'.$msg.'</code><br />';
         }
+        foreach ($this->getErrors() as $msg) {
+            echo '<code>'.$msg.'</code><br />';
+        }
         echo "<p>".sprintf(_MD_AM_OKUPD, "<b>".$this->getVar('name')."</b>")."</p>";
     }
 
@@ -1183,7 +1186,7 @@
             unset($existing_fields_arr);
         }
         else {
-            echo "No Profile fields found";
+            //echo "No Profile fields found";
         }
     }
 
@@ -1333,9 +1336,10 @@
         if (!empty($_cachedModule_dirname[$dirname])) {
             return $_cachedModule_dirname[$dirname];
         } else {
+	        $module = false;
             $sql = "SELECT * FROM ".$this->db->prefix('modules')." WHERE dirname = '".trim($dirname)."'";
             if (!$result = $this->db->query($sql)) {
-                return false;
+                return $module;
             }
             $numrows = $this->db->getRowsNum($result);
             if ($numrows == 1) {
@@ -1346,7 +1350,7 @@
                 $_cachedModule_mid[$module->getVar('mid')] =& $module;
                 return $module;
             }
-            return false;
+            return $module;
         }
     }
 
@@ -1444,9 +1448,9 @@
         $modules = $this->getObjects($criteria, true);
         foreach (array_keys($modules) as $i) {
             if (!$dirname_as_key) {
-                $ret[$i] =& $modules[$i]->getVar('name');
+                $ret[$i] = $modules[$i]->getVar('name');
             } else {
-                $ret[$modules[$i]->getVar('dirname')] =& $modules[$i]->getVar('name');
+                $ret[$modules[$i]->getVar('dirname')] = $modules[$i]->getVar('name');
             }
         }
         return $ret;
@@ -1457,7 +1461,7 @@
     *
     * @return object
     */
-    function loadModule() {
+    function &loadModule() {
         $url_arr = explode('/',strstr($_SERVER['REQUEST_URI'],'/modules/'));
         if (isset($url_arr[2])) {
             $xoopsModule =& $this->getByDirname($url_arr[2]);
diff -ruN 2.2.3a-Final.src/kernel/notification.php 2.2.6.src/kernel/notification.php
--- 2.2.3a-Final.src/kernel/notification.php	2005-07-26 01:11:51.000000000 -0500
+++ 2.2.6.src/kernel/notification.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: notification.php,v 1.19.6.3 2005/07/26 07:11:51 mithyt2 Exp $
+// $Id: notification.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/object.php 2.2.6.src/kernel/object.php
--- 2.2.3a-Final.src/kernel/object.php	2005-10-06 10:30:41.000000000 -0500
+++ 2.2.6.src/kernel/object.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: object.php,v 1.10.6.20.2.4 2005/10/06 16:30:41 mithyt2 Exp $
+// $Id: object.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -416,6 +416,8 @@
             include_once XOOPS_ROOT_PATH."/language/english/error.php";
         }
         $ts =& MyTextSanitizer::getInstance();
+        $existing_errors = $this->getErrors();
+        $this->_errors = array();
         foreach ($this->vars as $k => $v) {
             $cleanv = $v['value'];
             if (!$v['changed']) {
@@ -507,8 +509,10 @@
             unset($cleanv);
         }
         if (count($this->_errors) > 0) {
+	        $this->_errors = array_merge($existing_errors, $this->_errors);
             return false;
         }
+        $this->_errors = array_merge($existing_errors, $this->_errors);
         $this->unsetDirty();
         return true;
     }
@@ -723,13 +727,13 @@
     *
     * @return void
     */
-    function XoopsPersistableObjectHandler(&$db, $tablename, $classname, $keyname, $idenfierName = false) {
+    function XoopsPersistableObjectHandler(&$db, $tablename, $classname, $keyname, $identifierName = false) {
         $this->XoopsObjectHandler($db);
         $this->table = $db->prefix($tablename);
         $this->keyName = $keyname;
         $this->className = $classname;
-        if ($idenfierName != false) {
-            $this->identifierName = $idenfierName;
+        if ($identifierName != false) {
+            $this->identifierName = $identifierName;
         }
     }
 
@@ -782,7 +786,7 @@
      *
      * @return array
      */
-    function getObjects($criteria = null, $id_as_key = false, $as_object = true)
+    function &getObjects($criteria = null, $id_as_key = false, $as_object = true)
     {
         $ret = array();
         $limit = $start = 0;
@@ -800,7 +804,8 @@
             return $ret;
         }
 
-        return $this->convertResultSet($result, $id_as_key, $as_object);
+        $ret = $this->convertResultSet($result, $id_as_key, $as_object);
+        return $ret;
     }
 
     /**
@@ -994,6 +999,7 @@
             }
         }
         if (!$obj->cleanVars()) {
+	        $obj->setErrors("clean vars failed");
             return false;
         }
 
@@ -1045,6 +1051,7 @@
             $result = $this->db->query($sql);
         }
         if (!$result) {
+	        $obj->setErrors("insert failed: ".$sql);
             return false;
         }
         if ($obj->isNew() && !is_array($this->keyName)) {
diff -ruN 2.2.3a-Final.src/kernel/online.php 2.2.6.src/kernel/online.php
--- 2.2.3a-Final.src/kernel/online.php	2005-09-19 18:43:38.000000000 -0500
+++ 2.2.6.src/kernel/online.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: online.php,v 1.3.34.1 2005/09/20 00:43:38 skalpa Exp $
+// $Id: online.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -143,7 +143,7 @@
             $limit = $criteria->getLimit();
             $start = $criteria->getStart();
         }
-        $result =& $this->db->query($sql, $limit, $start);
+        $result = $this->db->query($sql, $limit, $start);
         if (!$result) {
             return false;
         }
@@ -165,7 +165,7 @@
         if (is_object($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
             $sql .= ' '.$criteria->renderWhere();
         }
-        if (!$result =& $this->db->query($sql)) {
+        if (!$result = $this->db->query($sql)) {
             return false;
         }
         list($ret) = $this->db->fetchRow($result);
diff -ruN 2.2.3a-Final.src/kernel/privmessage.php 2.2.6.src/kernel/privmessage.php
--- 2.2.3a-Final.src/kernel/privmessage.php	2005-09-19 18:44:05.000000000 -0500
+++ 2.2.6.src/kernel/privmessage.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: privmessage.php,v 1.4.16.1 2005/09/20 00:44:05 skalpa Exp $
+// $Id: privmessage.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -39,7 +39,7 @@
  * @author		Kazumi Ono	<onokazu@xoops.org>
  * @copyright	copyright (c) 2000-2003 The XOOPS Project (http://www.xoops.org)
  *
- * @version		$Revision: 1.4.16.1 $ - $Date: 2005/09/20 00:44:05 $
+ * @version		$Revision: 184 $ - $Date: 2006-01-22 17:34:51 -0500 (Sun, 22 Jan 2006) $
  */
 class XoopsPrivmessage extends XoopsObject
 {
@@ -72,7 +72,7 @@
  * @author		Kazumi Ono	<onokazu@xoops.org>
  * @copyright	copyright (c) 2000-2003 The XOOPS Project (http://www.xoops.org)
  *
- * @version		$Revision: 1.4.16.1 $ - $Date: 2005/09/20 00:44:05 $
+ * @version		$Revision: 184 $ - $Date: 2006-01-22 17:34:51 -0500 (Sun, 22 Jan 2006) $
  */
 class XoopsPrivmessageHandler extends XoopsObjectHandler
 {
diff -ruN 2.2.3a-Final.src/kernel/profilefield.php 2.2.6.src/kernel/profilefield.php
--- 2.2.3a-Final.src/kernel/profilefield.php	2005-10-06 10:14:14.000000000 -0500
+++ 2.2.6.src/kernel/profilefield.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: profilefield.php,v 1.1.2.24.2.3 2005/10/06 16:14:14 mithyt2 Exp $
+// $Id: profilefield.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -151,6 +151,12 @@
             case 'theme':
             $element = new XoopsFormSelect($caption, $name, $value);
             $element->addOption("0", _SITEDEFAULT);
+            $theme_list = XoopsLists::getThemesList();
+            foreach($theme_list as $key=>$val){
+	            if(!in_array($key, $GLOBALS['xoopsConfig']['theme_set_allowed'])) continue;
+            	$element->addOption($key, $val);
+            }
+            /*
             $handle = opendir(XOOPS_THEME_PATH.'/');
             $dirlist = array();
             while (false !== ($file = readdir($handle))) {
@@ -165,6 +171,7 @@
                 asort($dirlist);
                 $element->addOptionArray($dirlist);
             }
+            */
             break;
         }
         if ($this->getVar('field_description') != "") {
@@ -192,13 +199,13 @@
             case 'theme':
             case "language":
             case "list":
-            return $value;
+            //return $value;
             break;
 
             case "select":
             case "radio":
             $options = $this->getVar('field_options');
-            return isset($options[$value]) ? htmlspecialchars($options[$value]) : "";
+            $value = isset($options[$value]) ? htmlspecialchars($options[$value]) : "";
             break;
 
             case "select_multi":
@@ -212,12 +219,12 @@
                     }
                 }
             }
-            return $ret;
+            $value = $ret;
             break;
 
             case "group":
             //change to retrieve groups and return name of group
-            return $value;
+            //return $value;
             break;
 
             case "group_multi":
@@ -231,16 +238,19 @@
             
             case "date":
             if ($value > 0) {
-                return formatTimestamp($value, 's');
+                $value = formatTimestamp($value, 's');
+            }else{
+	            $value = "";
             }
-            return "";
             break;
             
             case "datetime":
             if ($value > 0) {
-                return formatTimestamp($value, 'm');
+                $value = formatTimestamp($value, 'm');
+            }else{
+	            $value = "";
             }
-            return "";
+            //return "";
             break;
 
             case "autotext":
@@ -248,9 +258,21 @@
 			$value = str_replace("{X_UID}", $user->getVar("uid"), $value );
 			$value = str_replace("{X_URL}", XOOPS_URL, $value );
 			$value = str_replace("{X_UNAME}", $user->getVar("uname"), $value );
-            return $value;
+            //return $value;
             break;
         }
+        
+        switch ($this->getVar('field_valuetype')) {
+	        case XOBJ_DTYPE_URL:
+	        if(!empty($value)){
+	        	$value = "<a href=\"".$value."\" target=\"_blank\">".$value."</a>";
+        	}
+	        break;
+	        default:
+	        break;
+        }
+        return $value;
+        
     }
     
     /**
@@ -313,16 +335,42 @@
     *
     * @return array
     */
-    function loadFields($force_update = false) {
+    function loadFields($force_update = false, $asObject = true) {
         static $fields = array();
-        if (!empty($force_update) || count($fields) == 0) {
+        
+        $type = !empty($asObject);
+        if (!empty($force_update) || !isset($fields[$type])) {
             if (!empty($force_update) || !file_exists(XOOPS_CACHE_PATH."/profilefields.tmp")) {
                 $this->updateCache();
             }
             $s = implode("", @file(XOOPS_CACHE_PATH."/profilefields.tmp"));
-            $fields = unserialize($s);
+            //$fields = unserialize($s);
+            /**/
+            $_fields_data = unserialize($s);
+	        $pseudo_obj =& $this->create();
+	        $keys = array_keys($pseudo_obj->vars);
+	        $fields_data = array();
+            foreach($_fields_data as $key => $field_data){
+	            for($i=0;$i<count($keys);$i++){
+		            $fields_data[$key][$keys[$i]] = $field_data[$i];
+	            }
+            }
+            
+            if(empty($asObject)):
+            $fields_out =& $fields_data;
+            else:
+            foreach($fields_data as $key => $field_data){
+	            $field =& $this->create(false);
+	            $field->assignvars($field_data);
+	            $fields_out[$key] = $field;
+	            unset($field);
+            }
+            endif;
+            $fields[$type] = $fields_out;
+            unset($fields_out);
+            /**/
         }
-        return $fields;
+        return $fields[$type];
     }
     
     /**
@@ -362,7 +410,7 @@
                 
             case "textbox":
             	if($obj->getVar('field_valuetype')!=XOBJ_DTYPE_INT){
-                	$obj->setVar('field_valuetype', XOBJ_DTYPE_TXTBOX);
+                	//$obj->setVar('field_valuetype', XOBJ_DTYPE_TXTBOX);
             	}
                 break;
                 
@@ -428,7 +476,8 @@
         $notnullstring = " NOT NULL";
         
         $sql = "ALTER TABLE ".$profile_handler->table." ".$changetype." ".$obj->cleanVars['field_name']." ".$type.$maxlengthstring.$notnullstring.$defaultstring;
-        if ($this->db->query($sql)) {
+        $func = empty($force)?"query":"queryF";
+        if ($this->db->{$func}($sql)) {
             //change this to also update the cached field information storage
             $obj->setDirty();
             if (!parent::insert($obj, $force)) {
@@ -469,7 +518,8 @@
         $profile_handler =& xoops_gethandler('profile');
         // remove column from table
         $sql = "ALTER TABLE ".$profile_handler->table." DROP ".$obj->getVar('field_name', 'n')."";
-        if ($this->db->query($sql)) {
+        $func = empty($force)?"query":"queryF";
+        if ($this->db->{$func}($sql)) {
             //change this to update the cached field information storage
             if (!parent::delete($obj, $force)) {
                 return false;
@@ -503,10 +553,19 @@
         $criteria = new Criteria('fieldid', 0, "!=");
         $criteria->setSort('field_weight');
         $field_objs =& $this->getObjects(null);
+        $fields = array();
+        $pseudo_obj =& $this->create();
         foreach (array_keys($field_objs) as $i) {
-            $fields[$field_objs[$i]->getVar('field_name')] = $field_objs[$i];
+            //$fields[$field_objs[$i]->getVar('field_name')] = $field_objs[$i];
+            /**/
+            $field = array();
+            foreach(array_keys($pseudo_obj->vars) as $key){
+	            $field[] = @$field_objs[$i]->getVar($key, "n");
+            }
+            $fields[$field_objs[$i]->getVar('field_name')] = $field;
+            unset($filed);
         }
-        $s = serialize($fields);
+        $s = serialize($fields); // shall we do some character escaping?
         $fp = fopen(XOOPS_CACHE_PATH."/profilefields.tmp", "w");
         if (!fputs($fp, $s)) {
             fclose($fp);
diff -ruN 2.2.3a-Final.src/kernel/profile.php 2.2.6.src/kernel/profile.php
--- 2.2.3a-Final.src/kernel/profile.php	2005-09-19 18:44:36.000000000 -0500
+++ 2.2.6.src/kernel/profile.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: profile.php,v 1.1.2.5.2.1 2005/09/20 00:44:36 skalpa Exp $
+// $Id: profile.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -46,7 +46,11 @@
     function init($fields) {
         if (is_array($fields) && count($fields) > 0) {
             foreach (array_keys($fields) as $key) {
-                $this->initVar($key, $fields[$key]->getVar('field_valuetype'), $fields[$key]->getVar('field_default', 'n'), $fields[$key]->getVar('field_required'), $fields[$key]->getVar('field_maxlength'));
+	            if(!is_object($fields[$key])){
+                	$this->initVar($key, $fields[$key]['field_valuetype'], $fields[$key]['field_default'], $fields[$key]['field_required'], $fields[$key]['field_maxlength']);
+            	}else{
+                	$this->initVar($key, $fields[$key]->getVar('field_valuetype'), $fields[$key]->getVar('field_default', 'n'), $fields[$key]->getVar('field_required'), $fields[$key]->getVar('field_maxlength'));
+            	}
             }
         }
     }
@@ -89,9 +93,16 @@
     *
     * @return array
     */
-    function loadFields() {
+    function &loadFields($asObject = true) {
+        static $type;
+        
+        if(isset($type) && $type != $asObject){
+	        $this->_fields = array();
+        }
+        $type = !empty($asObject);
+        
         if (count($this->_fields) == 0) {
-            $this->_fields =& $this->_fHandler->loadFields();
+            $this->_fields = $this->_fHandler->loadFields(false, $asObject);
         }
         return $this->_fields;
     }
diff -ruN 2.2.3a-Final.src/kernel/rank.php 2.2.6.src/kernel/rank.php
--- 2.2.3a-Final.src/kernel/rank.php	2005-07-22 02:43:45.000000000 -0500
+++ 2.2.6.src/kernel/rank.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: rank.php,v 1.1.2.3 2005/07/22 08:43:45 mithyt2 Exp $
+// $Id: rank.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/session.php 2.2.6.src/kernel/session.php
--- 2.2.3a-Final.src/kernel/session.php	2005-04-08 11:01:47.000000000 -0500
+++ 2.2.6.src/kernel/session.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: session.php,v 1.3.24.1 2005/04/08 17:01:47 mithyt2 Exp $
+// $Id: session.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -53,7 +53,21 @@
      * @access	private
      */
     var $db;
-
+    
+    /**
+     * Security checking level
+     * Possible value: 
+     *	0 - no check;
+     *	1 - check browser characteristics (HTTP_USER_AGENT/HTTP_ACCEPT_LANGUAGE), to be implemented in the future now;
+     *	2 - check browser and IP A.B;
+     *	3 - check browser and IP A.B.C;
+     *	4 - check browser and IP A.B.C.D;
+     * 
+     * @var	int
+     * @access	public
+     */
+    var $securityLevel = 3;
+    
     /**
      * Constructor
      * 
@@ -85,6 +99,7 @@
      */
     function close()
 	{
+		$this->gc_force();
         return true;
     }
 
@@ -97,10 +112,16 @@
      */
     function read($sess_id)
 	{
-        $sql = sprintf('SELECT sess_data FROM %s WHERE sess_id = %s', $this->db->prefix('session'), $this->db->quoteString($sess_id));
+        $sql = sprintf('SELECT sess_data, sess_ip FROM %s WHERE sess_id = %s', $this->db->prefix('session'), $this->db->quoteString($sess_id));
         if (false != $result = $this->db->query($sql)) {
-            if (list($sess_data) = $this->db->fetchRow($result)) {
-                return $sess_data;
+            if (list($sess_data, $sess_ip) = $this->db->fetchRow($result)) {
+	            if ($this->securityLevel > 1) {
+		            $pos = strpos($sess_ip, ".", $this->securityLevel - 1);
+		            if (strncmp($sess_ip, $_SERVER['REMOTE_ADDR'], $pos)) {
+			            $sess_data = '';
+		            }
+	            }
+            	return $sess_data;
             }
         }
         return '';
@@ -119,7 +140,7 @@
 		$sess_id = $this->db->quoteString($sess_id);
 		$sql = sprintf('UPDATE %s SET sess_updated = %u, sess_data = %s WHERE sess_id = %s', $this->db->prefix('session'), time(), $this->db->quoteString($sess_data), $sess_id);
 		$this->db->queryF($sql);
-		if ($this->db->getAffectedRows() != 1) {
+		if (!$this->db->getAffectedRows()) {
 			$sql = sprintf('INSERT INTO %s (sess_id, sess_updated, sess_ip, sess_data) VALUES (%s, %u, %s, %s)', $this->db->prefix('session'), $sess_id, time(), $this->db->quoteString($_SERVER['REMOTE_ADDR']), $this->db->quoteString($sess_data));
 			return $this->db->queryF($sql);
         }
@@ -150,9 +171,25 @@
      **/
     function gc($expire)
     {
+	    if (empty($expire)) {
+		    return true;
+	    }
+	    
         $mintime = time() - intval($expire);
 		$sql = sprintf('DELETE FROM %s WHERE sess_updated < %u', $this->db->prefix('session'), $mintime);
         return $this->db->queryF($sql);
     }
+    
+    /**
+     * Force gc for situations where gc is registered but not executed
+     **/
+    function gc_force()
+    {
+	    if (rand(1, 100) < 11) {
+		    $expiration = empty($GLOBALS["xoopsConfig"]["session_expire"]) ? @ini_get('session.gc_maxlifetime') : $GLOBALS["xoopsConfig"]["session_expire"] * 60;
+	        $this->gc($expiration);
+	    }
+    }
+    
 }
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/kernel/tplfile.php 2.2.6.src/kernel/tplfile.php
--- 2.2.3a-Final.src/kernel/tplfile.php	2005-09-19 18:45:53.000000000 -0500
+++ 2.2.6.src/kernel/tplfile.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: tplfile.php,v 1.3.16.1 2005/09/20 00:45:53 skalpa Exp $
+// $Id: tplfile.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -258,7 +258,7 @@
     function getModuleTplCount($tplset)
     {
         $ret = array();
-        $sql = "SELECT tpl_module, COUNT(tpl_id) AS count FROM ".$this->db->prefix('tplfile')." WHERE tpl_tplset='".$tplset."' GROUP BY tpl_module";
+        $sql = "SELECT tpl_module, COUNT(tpl_id) AS count FROM ".$this->db->prefix('tplfile')." WHERE tpl_tplset=".$this->db->quoteString($tplset)." GROUP BY tpl_module";
         $result = $this->db->query($sql);
         if (!$result) {
             return $ret;
diff -ruN 2.2.3a-Final.src/kernel/tplset.php 2.2.6.src/kernel/tplset.php
--- 2.2.3a-Final.src/kernel/tplset.php	2005-09-19 18:49:01.000000000 -0500
+++ 2.2.6.src/kernel/tplset.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: tplset.php,v 1.3.6.1.2.1 2005/09/20 00:49:01 skalpa Exp $
+// $Id: tplset.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/kernel/user.php 2.2.6.src/kernel/user.php
--- 2.2.3a-Final.src/kernel/user.php	2005-09-28 13:16:22.000000000 -0500
+++ 2.2.6.src/kernel/user.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: user.php,v 1.11.6.22.2.4 2005/09/28 19:16:22 mithyt2 Exp $
+// $Id: user.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/language/english/admin.php 2.2.6.src/language/english/admin.php
--- 2.2.3a-Final.src/language/english/admin.php	2005-04-05 09:59:41.000000000 -0500
+++ 2.2.6.src/language/english/admin.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: admin.php,v 1.5.22.1 2005/04/05 15:59:41 mithyt2 Exp $
+// $Id: admin.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	File Name  admin.php 	%%%%%
 define("_AD_NORIGHT","You don't have the right to access this area");
 define("_AD_ACTION","Action");
diff -ruN 2.2.3a-Final.src/language/english/calendar.php 2.2.6.src/language/english/calendar.php
--- 2.2.3a-Final.src/language/english/calendar.php	2003-02-20 08:14:24.000000000 -0600
+++ 2.2.6.src/language/english/calendar.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: calendar.php,v 1.2 2003/02/20 14:14:24 w4z004 Exp $
+// $Id: calendar.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%		Time Zone	%%%%
 define("_CAL_SUNDAY", "Sunday");
 define("_CAL_MONDAY", "Monday");
diff -ruN 2.2.3a-Final.src/language/english/comment.php 2.2.6.src/language/english/comment.php
--- 2.2.3a-Final.src/language/english/comment.php	2003-02-12 05:35:45.000000000 -0600
+++ 2.2.6.src/language/english/comment.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment.php,v 1.7 2003/02/12 11:35:45 okazu Exp $
+// $Id: comment.php 1030 2007-09-09 05:44:27Z phppp $
 define('_CM_TITLE','Title');
 define('_CM_MESSAGE','Message');
 define('_CM_DOSMILEY','Enable Smiley Icons');
@@ -37,4 +37,5 @@
 define('_CM_COMAPPROVEADMIN','All comments need to be approved by administrator');
 define('_CM_COMANONPOST','Allow anonymous post in comments?');
 define('_CM_COMNOCOM','Disable comments');
+define('_CM_RE','Re');
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/language/english/global.php 2.2.6.src/language/english/global.php
--- 2.2.3a-Final.src/language/english/global.php	2005-07-13 10:47:06.000000000 -0500
+++ 2.2.6.src/language/english/global.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: global.php,v 1.15.14.6 2005/07/13 16:47:06 mithyt2 Exp $
+// $Id: global.php 1030 2007-09-09 05:44:27Z phppp $
 //%%%%%%	File Name mainfile.php 	%%%%%
 define("_PLEASEWAIT","Please Wait");
 define("_FETCHING","Loading...");
@@ -162,8 +162,8 @@
 define("_SHORTDATESTRING","Y/n/j");
 // !!IMPORTANT!! insert '\' before any char among reserved chars: "a", "A","B","c","d","D","F","g","G","h","H","i","I","j","l","L","m","M","n","O","r","s","S","t","T","U","w","W","Y","y","z","Z"	
 // insert double '\' before 't', 'r', 'n'
-define("_TODAY", "\To\d\a\y G:i:s");
-define("_YESTERDAY", "\Ye\s\\te\\r\d\a\y G:i:s");
+define("_TODAY", "\T\o\d\a\y G:i:s");
+define("_YESTERDAY", "\Y\e\s\\t\e\\r\d\a\y G:i:s");
 define("_MONTHDAY", "n/j G:i:s");
 define("_YEARMONTHDAY", "Y/n/j G:i");
 /*
diff -ruN 2.2.3a-Final.src/language/english/local.php 2.2.6.src/language/english/local.php
--- 2.2.3a-Final.src/language/english/local.php	2005-09-18 07:49:06.000000000 -0500
+++ 2.2.6.src/language/english/local.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,11 +1,27 @@
 <?php
-// $Id: local.php,v 1.1.2.3.2.1 2005/09/18 13:49:06 mithyt2 Exp $
+/**
+ * Xoops multi-language string and encoding handling class
+ *
+ * @copyright	 The XOOPS project http://www.xoops.org/
+ * @license      http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @package      language
+ * @version      $Id: local.php 1030 2007-09-09 05:44:27Z phppp $
+ * @author       D.J. (phppp)
+ * @since        2.2
+ */
+ 
+/**
+ * The class should be an abstract one using PHP embedded functions
+ * based on which, 
+ * each local language defines its own equalient methods
+ *
+ * A comprehensive handler is expected in Xoops 2.3 or 2.4
+ */
 
-// Local handler for string and encoding
 class XoopsLocal
 {	
 	// localized substr
-	function &substr($str, $start, $length, $trimmarker = '...')
+	function substr($str, $start, $length, $trimmarker = '...')
 	{
 	    if ( !XOOPS_USE_MULTIBYTES ) {
 	        return ( strlen($str) - $start <= $length ) ? substr( $str, $start, $length ) : substr( $str, $start, $length - strlen($trimmarker) ) . $trimmarker;
@@ -16,13 +32,13 @@
 	    }
 	}
 	
-	function &utf8_encode(&$text)
+	// Each local language should define its own equalient utf8_encode 
+	function utf8_encode($text)
 	{
-		$text = XoopsLocal::convert_encoding($text, 'utf-8');
-	        return $text;
-	    }
+		return utf8_encode($text);
+    }
 	
-	function &convert_encoding(&$text, $to='utf-8', $from='')
+	function convert_encoding($text, $to='utf-8', $from='')
 	{
 		if(empty($text)) {		
 			return $text;
@@ -38,9 +54,10 @@
 	    return $text;
 	}
 
-	function &trim($text)
+	function trim($text)
 	{
-	    return trim($text);
+	    $ret = trim($text);
+	    return $ret;
 	}
 	
 	/*
@@ -49,6 +66,17 @@
 	function formatTimestamp($time, $format="l", $timeoffset="")
 	{
 	    global $xoopsConfig, $xoopsUser;
+	    if(strtolower($format) == "rss" ||strtolower($format) == "r"){
+        	$TIME_ZONE = "";
+        	if(!empty($GLOBALS['xoopsConfig']['server_TZ'])){
+				$server_TZ = abs(intval($GLOBALS['xoopsConfig']['server_TZ']*3600.0));
+				$prefix = ($GLOBALS['xoopsConfig']['server_TZ']<0)?" -":" +";
+				$TIME_ZONE = $prefix.date("Hi",$server_TZ);
+			}
+			$date = gmdate("D, d M Y H:i:s", intval($time)).$TIME_ZONE;
+			return $date;
+    	}
+    	
 	    $usertimestamp = xoops_getUserTimestamp($time, $timeoffset);
 	    switch (strtolower($format)) {
 	        case 's':
@@ -68,15 +96,27 @@
 	        break;
 	        case 'c':
 	        case 'custom':	        
-	        if(date("Ymd", $usertimestamp) == date("Ymd")){
+		    static $current_timestamp, $today_timestamp, $monthy_timestamp;
+        	if(!isset($current_timestamp)) {
+		    	$current_timestamp = xoops_getUserTimestamp(time(), $timeoffset);
+	    	}
+	    	if(!isset($today_timestamp)) {
+		    	$today_timestamp = mktime(0, 0, 0, date("m", $current_timestamp), date("d", $current_timestamp), date("Y", $current_timestamp));
+	    	}
+	        if($usertimestamp >= $today_timestamp) {
 				$datestring = _TODAY;
-			}elseif(date("Ymd", $usertimestamp+24*60*60) == date("Ymd")){
+			}elseif($usertimestamp >= $today_timestamp - 24*60*60) {
 				$datestring = _YESTERDAY;
-			}elseif(date("Y", $usertimestamp) == date("Y")){
-				$datestring = _MONTHDAY;
-			}else{
-				$datestring = _YEARMONTHDAY;
-			}			
+			}else {
+		    	if(!isset($monthy_timestamp)) {
+			    	$monthy_timestamp = mktime(0, 0, 0, 0, 0, date("Y", $current_timestamp));
+		    	}
+		        if($usertimestamp >= $monthy_timestamp) {
+					$datestring = _MONTHDAY;
+				}else{
+					$datestring = _YEARMONTHDAY;
+				}
+			}
 	        break;
 	        default:
 	        if ($format != '') {
@@ -94,9 +134,10 @@
 	// calling the function:
 	// Method 1: echo xoops_local("hello", "Some greeting words");
 	// Method 2: echo XoopsLocal::hello("Some greeting words");
-	function &hello($text)
+	function hello($text)
 	{
-		return "<div>Hello, ".$text."</div>";
+		$ret = "<div>Hello, ".$text."</div>";
+		return $ret;
 	}
 }
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/language/english/misc.php 2.2.6.src/language/english/misc.php
--- 2.2.3a-Final.src/language/english/misc.php	2003-02-12 05:36:33.000000000 -0600
+++ 2.2.6.src/language/english/misc.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: misc.php,v 1.6 2003/02/12 11:36:33 okazu Exp $
+// $Id: misc.php 184 2006-01-22 22:34:51Z skalpa $
 define("_MSC_YOURNAMEC","Your Name: ");
 define("_MSC_YOUREMAILC","Your Email: ");
 define("_MSC_FRIENDNAMEC","Friend Name: ");
diff -ruN 2.2.3a-Final.src/language/english/notification.php 2.2.6.src/language/english/notification.php
--- 2.2.3a-Final.src/language/english/notification.php	2005-06-06 08:49:44.000000000 -0500
+++ 2.2.6.src/language/english/notification.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: notification.php,v 1.6.22.1 2005/06/06 14:49:44 mithyt2 Exp $
+// $Id: notification.php 184 2006-01-22 22:34:51Z skalpa $
 
 // RMV-NOTIFY
 
diff -ruN 2.2.3a-Final.src/language/english/search.php 2.2.6.src/language/english/search.php
--- 2.2.3a-Final.src/language/english/search.php	2003-10-02 01:41:48.000000000 -0500
+++ 2.2.6.src/language/english/search.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: search.php,v 1.7 2003/10/02 07:41:48 okazu Exp $
+// $Id: search.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	File Name search.php 	%%%%%
 define("_SR_SEARCH","Search");
 define("_SR_PLZENTER","Please enter all required data!");
diff -ruN 2.2.3a-Final.src/language/english/timezone.php 2.2.6.src/language/english/timezone.php
--- 2.2.3a-Final.src/language/english/timezone.php	2003-02-12 05:36:33.000000000 -0600
+++ 2.2.6.src/language/english/timezone.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: timezone.php,v 1.6 2003/02/12 11:36:33 okazu Exp $
+// $Id: timezone.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%		Time Zone	%%%%
 define("_TZ_GMTM12", "(GMT-12:00) Eniwetok, Kwajalein");
 define("_TZ_GMTM11", "(GMT-11:00) Midway Island, Samoa");
diff -ruN 2.2.3a-Final.src/language/english/user.php 2.2.6.src/language/english/user.php
--- 2.2.3a-Final.src/language/english/user.php	2005-06-19 08:50:16.000000000 -0500
+++ 2.2.6.src/language/english/user.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: user.php,v 1.11.6.3 2005/06/19 14:50:16 mithyt2 Exp $
+// $Id: user.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%		File Name user.php 		%%%%%
 define('_US_NOTREGISTERED','Not registered?  Click <a href="register.php">here</a>.');
 define('_US_LOSTPASSWORD','Lost your Password?');
diff -ruN 2.2.3a-Final.src/language/english/xoopsmailerlocal.php 2.2.6.src/language/english/xoopsmailerlocal.php
--- 2.2.3a-Final.src/language/english/xoopsmailerlocal.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/language/english/xoopsmailerlocal.php	2007-09-09 00:44:27.000000000 -0500
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Localize the mail functions
+ *
+ * The English localization is solely for demonstration
+ */
+// Do not change the class name
+class XoopsMailerLocal extends XoopsMailer {
+
+	function XoopsMailerLocal(){
+		$this->XoopsMailer();
+		// It is supposed no need to change the charset
+		$this->charSet = strtolower( _CHARSET );
+		// You MUST specify the language code value so that the file exists: XOOPS_ROOT_PAT/class/mail/phpmailer/language/lang-["your-language-code"].php
+	    $this->multimailer->SetLanguage("en");
+	}
+	
+	// Multibyte languages are encouraged to make their proper method for encoding FromName
+	function encodeFromName($text)
+	{
+		// Activate the following line if needed
+		// $text = "=?{$this->charSet}?B?".base64_encode($text)."?=";
+		return $text;
+	}
+
+	// Multibyte languages are encouraged to make their proper method for encoding Subject
+	function encodeSubject($text)
+	{
+		// Activate the following line if needed
+		// $text = "=?{$this->charSet}?B?".base64_encode($text)."?=";
+		return $text;
+	}
+}
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/lostpass.php 2.2.6.src/lostpass.php
--- 2.2.3a-Final.src/lostpass.php	2005-09-18 07:54:17.000000000 -0500
+++ 2.2.6.src/lostpass.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: lostpass.php,v 1.9.6.10.2.1 2005/09/18 13:54:17 mithyt2 Exp $
+// $Id: lostpass.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -60,16 +60,17 @@
         $xoopsMailer->assign("LOGINNAME", $getuser[0]->getVar('loginname'));
         if ( !$xoopsMailer->send() ) {
             echo $xoopsMailer->getErrors();
+	        redirect_header("user.php", 3, $xoopsMailer->getErrors(), false);
+        }else{
+	        $getuser[0]->setVar('pass', md5($newpass));
+	        if (!$member_handler->insertUser($getuser[0], true)) {
+	            include XOOPS_ROOT_PATH."/header.php";
+	            echo _US_MAILPWDNG;
+	            include XOOPS_ROOT_PATH."/footer.php";
+	            exit();
+	        }
+	        redirect_header("user.php", 3, sprintf(_US_PWDMAILED,$getuser[0]->getVar("uname")), false);
         }
-
-        $getuser[0]->setVar('pass', md5($newpass));
-        if (!$member_handler->insertUser($getuser[0], true)) {
-            include XOOPS_ROOT_PATH."/header.php";
-            echo _US_MAILPWDNG;
-            include XOOPS_ROOT_PATH."/footer.php";
-            exit();
-        }
-        redirect_header("user.php", 3, sprintf(_US_PWDMAILED,$getuser[0]->getVar("uname")), false);
         exit();
         // If no Code, send it
     } else {
@@ -82,10 +83,11 @@
         include XOOPS_ROOT_PATH."/header.php";
         if ( !$xoopsMailer->send() ) {
             echo $xoopsMailer->getErrors();
+        }else{
+	        echo "<h4>";
+	        printf(_US_CONFMAIL,$getuser[0]->getVar("uname"));
+	        echo "</h4>";
         }
-        echo "<h4>";
-        printf(_US_CONFMAIL,$getuser[0]->getVar("uname"));
-        echo "</h4>";
         include XOOPS_ROOT_PATH."/footer.php";
     }
 }
diff -ruN 2.2.3a-Final.src/mainfile.dist.php 2.2.6.src/mainfile.dist.php
--- 2.2.3a-Final.src/mainfile.dist.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/mainfile.dist.php	2008-01-17 08:12:50.000000000 -0600
@@ -0,0 +1,98 @@
+<?php
+// $Id: mainfile.dist.php 184 2006-01-22 22:34:51Z skalpa $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+
+if ( !defined("XOOPS_MAINFILE_INCLUDED") ) {
+	define("XOOPS_MAINFILE_INCLUDED",1);
+
+	// XOOPS Physical Path
+	// Physical path to your main XOOPS directory WITHOUT trailing slash
+	// Example: define('XOOPS_ROOT_PATH', '/path/to/xoops/directory');
+	define('XOOPS_ROOT_PATH', '');
+
+	// XOOPS Virtual Path (URL)
+	// Virtual path to your main XOOPS directory WITHOUT trailing slash
+	// Example: define('XOOPS_URL', 'http://url_to_xoops_directory');
+	define('XOOPS_URL', 'http://');
+
+	define('XOOPS_CHECK_PATH', "0");
+	// Protect against external scripts execution if safe mode is not enabled
+	if ( XOOPS_CHECK_PATH && !@ini_get('safe_mode') ) {
+		if ( function_exists('debug_backtrace') ) {
+			$xoopsScriptPath = debug_backtrace();
+			if ( !count($xoopsScriptPath) ) {
+			 	die("XOOPS path check: this file cannot be requested directly");
+			}
+			$xoopsScriptPath = $xoopsScriptPath[0]['file'];
+		} else {
+			$xoopsScriptPath = isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] :  $_SERVER['SCRIPT_FILENAME'];
+		}
+		if ( DIRECTORY_SEPARATOR != '/' ) {
+			// IIS6 may double the \ chars
+			$xoopsScriptPath = str_replace( strpos( $xoopsScriptPath, '\\\\', 2 ) ? '\\\\' : DIRECTORY_SEPARATOR, '/', $xoopsScriptPath);
+		}
+		if ( strcasecmp( substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace( DIRECTORY_SEPARATOR, '/', XOOPS_ROOT_PATH)) ) {
+		 	exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
+		}
+	}
+
+	// Database
+	// Choose the database to be used
+	define('XOOPS_DB_TYPE', 'mysql');
+
+	// Table Prefix
+	// This prefix will be added to all new tables created to avoid name conflict in the database. Please change this to something different than 'xoops'.
+	define('XOOPS_DB_PREFIX', 'xoops');
+
+	// Database Hostname
+	// Hostname of the database server. If you are unsure, 'localhost' works in most cases.
+	define('XOOPS_DB_HOST', 'localhost');
+
+	// Database Username
+	// Your database user account on the host
+	define('XOOPS_DB_USER', '');
+
+	// Database Password
+	// Password for your database user account
+	define('XOOPS_DB_PASS', '');
+
+	// Database Name
+	// The name of database on the host. The installer will attempt to create the database if not exist
+	define('XOOPS_DB_NAME', '');
+
+	// Use persistent connection? (Yes=1 No=0)
+	// Default is 'No'. Choose 'No' if you are unsure.
+	define('XOOPS_DB_PCONNECT', "0");
+
+	define("XOOPS_GROUP_ADMIN", "1");
+	define("XOOPS_GROUP_USERS", "2");
+	define("XOOPS_GROUP_ANONYMOUS", "3");
+
+	if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
+		require XOOPS_ROOT_PATH."/include/common.php";
+	}
+}
+?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/mainfile.php 2.2.6.src/mainfile.php
--- 2.2.3a-Final.src/mainfile.php	2005-11-30 14:53:32.000000000 -0600
+++ 2.2.6.src/mainfile.php	2008-01-17 08:19:49.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: mainfile.dist.php,v 1.7.6.3 2005/05/21 15:38:20 mithyt2 Exp $
+// $Id: mainfile.dist.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -30,15 +30,15 @@
 
 	// XOOPS Physical Path
 	// Physical path to your main XOOPS directory WITHOUT trailing slash
-	// Example: define('XOOPS_ROOT_PATH', '/path/to/xoops/directory');
+	// Example: define('XOOPS_ROOT_PATH', '/home/public_html/xoops');
 	define('XOOPS_ROOT_PATH', '[% installdir %]');
 
 	// XOOPS Virtual Path (URL)
 	// Virtual path to your main XOOPS directory WITHOUT trailing slash
-	// Example: define('XOOPS_URL', 'http://url_to_xoops_directory');
+	// Example: define('XOOPS_URL', '');
 	define('XOOPS_URL', '[% url_to_install_without_trailing_slash %]');
 
-	define('XOOPS_CHECK_PATH', "0");
+	define('XOOPS_CHECK_PATH', '1');
 	// Protect against external scripts execution if safe mode is not enabled
 	if ( XOOPS_CHECK_PATH && !@ini_get('safe_mode') ) {
 		if ( function_exists('debug_backtrace') ) {
@@ -85,11 +85,11 @@
 
 	// Use persistent connection? (Yes=1 No=0)
 	// Default is 'No'. Choose 'No' if you are unsure.
-	define('XOOPS_DB_PCONNECT', "[% input_use_persistent %]");
+	define('XOOPS_DB_PCONNECT', '[% input_use_persistent %]');
 
-	define("XOOPS_GROUP_ADMIN", "1");
-	define("XOOPS_GROUP_USERS", "2");
-	define("XOOPS_GROUP_ANONYMOUS", "3");
+	define('XOOPS_GROUP_ADMIN', '1');
+	define('XOOPS_GROUP_USERS', '2');
+	define('XOOPS_GROUP_ANONYMOUS', '3');
 
 	if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
 		require XOOPS_ROOT_PATH."/include/common.php";
diff -ruN 2.2.3a-Final.src/mainfile.php.new 2.2.6.src/mainfile.php.new
--- 2.2.3a-Final.src/mainfile.php.new	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/mainfile.php.new	2008-01-17 08:02:49.000000000 -0600
@@ -0,0 +1,98 @@
+<?php
+// $Id: mainfile.dist.php 184 2006-01-22 22:34:51Z skalpa $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+
+if ( !defined("XOOPS_MAINFILE_INCLUDED") ) {
+	define("XOOPS_MAINFILE_INCLUDED",1);
+
+	// XOOPS Physical Path
+	// Physical path to your main XOOPS directory WITHOUT trailing slash
+	// Example: define('XOOPS_ROOT_PATH', '/path/to/xoops/directory');
+	define('XOOPS_ROOT_PATH', '[% installdir %]');
+
+	// XOOPS Virtual Path (URL)
+	// Virtual path to your main XOOPS directory WITHOUT trailing slash
+	// Example: define('XOOPS_URL', 'http://url_to_xoops_directory');
+	define('XOOPS_URL', '[% url_to_install_without_trailing_slash %]');
+
+	define('XOOPS_CHECK_PATH', "0");
+	// Protect against external scripts execution if safe mode is not enabled
+	if ( XOOPS_CHECK_PATH && !@ini_get('safe_mode') ) {
+		if ( function_exists('debug_backtrace') ) {
+			$xoopsScriptPath = debug_backtrace();
+			if ( !count($xoopsScriptPath) ) {
+			 	die("XOOPS path check: this file cannot be requested directly");
+			}
+			$xoopsScriptPath = $xoopsScriptPath[0]['file'];
+		} else {
+			$xoopsScriptPath = isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] :  $_SERVER['SCRIPT_FILENAME'];
+		}
+		if ( DIRECTORY_SEPARATOR != '/' ) {
+			// IIS6 may double the \ chars
+			$xoopsScriptPath = str_replace( strpos( $xoopsScriptPath, '\\\\', 2 ) ? '\\\\' : DIRECTORY_SEPARATOR, '/', $xoopsScriptPath);
+		}
+		if ( strcasecmp( substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace( DIRECTORY_SEPARATOR, '/', XOOPS_ROOT_PATH)) ) {
+		 	exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
+		}
+	}
+
+	// Database
+	// Choose the database to be used
+	define('XOOPS_DB_TYPE', 'mysql');
+
+	// Table Prefix
+	// This prefix will be added to all new tables created to avoid name conflict in the database. Please change this to something different than 'xoops'.
+	define('XOOPS_DB_PREFIX', '[% table_prefix %]');
+
+	// Database Hostname
+	// Hostname of the database server. If you are unsure, 'localhost' works in most cases.
+	define('XOOPS_DB_HOST', '[% mysql.xoops.sqlhost %]');
+
+	// Database Username
+	// Your database user account on the host
+	define('XOOPS_DB_USER', '[% mysql_user %]');
+
+	// Database Password
+	// Password for your database user account
+	define('XOOPS_DB_PASS', '[% mysql_pass %]');
+
+	// Database Name
+	// The name of database on the host. The installer will attempt to create the database if not exist
+	define('XOOPS_DB_NAME', '[% xoops %]');
+
+	// Use persistent connection? (Yes=1 No=0)
+	// Default is 'No'. Choose 'No' if you are unsure.
+	define('XOOPS_DB_PCONNECT', "[% input_use_persistent %]");
+
+	define("XOOPS_GROUP_ADMIN", "1");
+	define("XOOPS_GROUP_USERS", "2");
+	define("XOOPS_GROUP_ANONYMOUS", "3");
+
+	if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
+		require XOOPS_ROOT_PATH."/include/common.php";
+	}
+}
+?>
diff -ruN 2.2.3a-Final.src/misc.php 2.2.6.src/misc.php
--- 2.2.3a-Final.src/misc.php	2005-07-19 12:14:34.000000000 -0500
+++ 2.2.6.src/misc.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: misc.php,v 1.15.4.2.2.9 2005/07/19 18:14:34 mithyt2 Exp $
+// $Id: misc.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/pm/class/privmessage.php 2.2.6.src/modules/pm/class/privmessage.php
--- 2.2.3a-Final.src/modules/pm/class/privmessage.php	2005-07-28 03:04:29.000000000 -0500
+++ 2.2.6.src/modules/pm/class/privmessage.php	2007-09-09 00:44:27.000000000 -0500
@@ -110,13 +110,13 @@
         }
     }
     /**
-     * Mark a message as to_delete = 1 or removes it if the sender has also deleted it
+     * Mark a message as to_delete = 1 or removes it if the sender has also deleted it or sent by anonymous
      * @param 	object 	$pm 	{@link XoopsPrivmessage} object
      * @return 	bool
      **/
     function setTodelete(&$pm, $val=1)
     {
-        if ($pm->getVar('from_delete') == 0) {
+        if ($pm->getVar('from_delete') == 0 && $pm->getVar('from_userid') == 0) {
             return $this->updateAll('to_delete', intval($val), new Criteria('msg_id', $pm->getVar('msg_id')));
         }
         else {
diff -ruN 2.2.3a-Final.src/modules/pm/language/english/main.php 2.2.6.src/modules/pm/language/english/main.php
--- 2.2.3a-Final.src/modules/pm/language/english/main.php	2005-07-20 02:41:28.000000000 -0500
+++ 2.2.6.src/modules/pm/language/english/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.1.2.6 2005/07/20 08:41:28 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	File Name readpmsg.php 	%%%%%
 define("_PM_DELETED","Your message(s) has been deleted");
 define("_PM_PRIVATEMESSAGE","Private Messages");
diff -ruN 2.2.3a-Final.src/modules/pm/pmlite.php 2.2.6.src/modules/pm/pmlite.php
--- 2.2.3a-Final.src/modules/pm/pmlite.php	2005-08-04 16:15:18.000000000 -0500
+++ 2.2.6.src/modules/pm/pmlite.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pmlite.php,v 1.1.2.10 2005/08/04 22:15:18 phppp Exp $
+// $Id: pmlite.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/pm/readpmsg.php 2.2.6.src/modules/pm/readpmsg.php
--- 2.2.3a-Final.src/modules/pm/readpmsg.php	2005-08-04 16:16:22.000000000 -0500
+++ 2.2.6.src/modules/pm/readpmsg.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: readpmsg.php,v 1.1.2.8 2005/08/04 22:16:22 phppp Exp $
+// $Id: readpmsg.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -39,6 +39,14 @@
 	}else{
 		$pm = null;
 	}
+    if (is_object($pm) 
+    	&& (!$xoopsUser->isAdmin())
+    	&& ($pm->getVar('from_userid') != $xoopsUser->getVar('uid'))
+    	&& ($pm->getVar('to_userid') != $xoopsUser->getVar('uid'))
+    ){
+        redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'/index.php', 2, _NOPERM);
+        exit();
+    }
     if (is_object($pm) && !empty($_POST['action']) ) {
         if (!$GLOBALS['xoopsSecurity']->check()) {
             echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors());
diff -ruN 2.2.3a-Final.src/modules/pm/templates/pm_viewpmsg.html 2.2.6.src/modules/pm/templates/pm_viewpmsg.html
--- 2.2.3a-Final.src/modules/pm/templates/pm_viewpmsg.html	2005-08-12 12:13:38.000000000 -0500
+++ 2.2.6.src/modules/pm/templates/pm_viewpmsg.html	2006-01-22 17:49:01.000000000 -0600
@@ -71,7 +71,7 @@
                     <{/if}>
                 </td>
                 <td valign='middle'>
-                    <a href='readpmsg.php?msg_id=<{$message.msg_id}>start=<{$message.msg_no}>&amp;total_messages=<{$total_messages}>&amp;op=<{$op}>'>
+                    <a href='readpmsg.php?msg_id=<{$message.msg_id}>&amp;start=<{$message.msg_no}>&amp;total_messages=<{$total_messages}>&amp;op=<{$op}>'>
                         <{$message.subject}>
                     </a>
                 </td>
diff -ruN 2.2.3a-Final.src/modules/pm/viewpmsg.php 2.2.6.src/modules/pm/viewpmsg.php
--- 2.2.3a-Final.src/modules/pm/viewpmsg.php	2005-08-12 12:13:39.000000000 -0500
+++ 2.2.6.src/modules/pm/viewpmsg.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: viewpmsg.php,v 1.1.2.11 2005/08/12 18:13:39 mithyt2 Exp $
+// $Id: viewpmsg.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -133,6 +133,10 @@
 		        $criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
 		        $criteria->add(new Criteria('to_save', 0));
 	        }
+	        /*
+	         * The following method has critical scalability problem !
+	         * deleteAll method should be used instead
+	         */
     		$pms =& $pm_handler->getObjects($criteria);
 	        unset($criteria);
 		    if(count($pms)>0){
diff -ruN 2.2.3a-Final.src/modules/pm/xoops_version.php 2.2.6.src/modules/pm/xoops_version.php
--- 2.2.3a-Final.src/modules/pm/xoops_version.php	2005-08-04 16:14:23.000000000 -0500
+++ 2.2.6.src/modules/pm/xoops_version.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.1.2.14 2005/08/04 22:14:23 phppp Exp $
+// $Id: xoops_version.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -52,7 +52,7 @@
 //install
 $modversion['onInstall'] = 'include/install.php';
 //update
-$modversion['onUpdate'] = 'include/update.php';
+//$modversion['onUpdate'] = 'include/update.php';
 
 // Templates
 $modversion['templates'][1]['file'] = 'pm_pmlite.html';
@@ -106,10 +106,10 @@
 $modversion['profile']['field'][1]['type'] = 'autotext';
 $modversion['profile']['field'][1]['valuetype'] = XOBJ_DTYPE_TXTAREA;
 $modversion['profile']['field'][1]['default'] = "<a href=\"javascript:openWithSelfMain('{X_URL}/modules/pm/pmlite.php?send2=1&to_userid={X_UID}', 'pmlite', 550, 450);\" title=\""._PM_MI_MESSAGE." {X_UNAME}\"><img src=\"{X_URL}/modules/pm/images/pm.gif\" alt=\""._PM_MI_MESSAGE." {X_UNAME}\" /></a>";
-$modversion['profile']['field'][1]['show'] = 1; 
-$modversion['profile']['field'][1]['title'] = _PM_MI_LINK_TITLE; 
+$modversion['profile']['field'][1]['show'] = 1;
+$modversion['profile']['field'][1]['title'] = _PM_MI_LINK_TITLE;
 $modversion['profile']['field'][1]['edit'] = 0;
-$modversion['profile']['field'][1]['description'] = _PM_MI_LINK_DESCRIPTION; 
+$modversion['profile']['field'][1]['description'] = _PM_MI_LINK_DESCRIPTION;
 $modversion['profile']['field'][1]['required'] = 0;
 $modversion['profile']['field'][1]['config'] = 0;
 $modversion['profile']['field'][1]['options'] = array();
diff -ruN 2.2.3a-Final.src/modules/profile/activate.php 2.2.6.src/modules/profile/activate.php
--- 2.2.3a-Final.src/modules/profile/activate.php	2005-09-26 09:07:47.000000000 -0500
+++ 2.2.6.src/modules/profile/activate.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: activate.php,v 1.1.2.7.2.1 2005/09/26 15:07:47 mithyt2 Exp $
+// $Id: activate.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -69,7 +69,6 @@
                     $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
                     $xoopsMailer->setFromName($xoopsConfig['sitename']);
                     $xoopsMailer->setSubject(sprintf(_PROFILE_MA_YOURACCOUNT,$xoopsConfig['sitename']));
-                    include XOOPS_ROOT_PATH.'/header.php';
                     if ( !$xoopsMailer->send() ) {
                         printf(_PROFILE_MA_ACTVMAILNG, $thisuser->getVar('uname'));
                     } else {
diff -ruN 2.2.3a-Final.src/modules/profile/admin/admin.php 2.2.6.src/modules/profile/admin/admin.php
--- 2.2.3a-Final.src/modules/profile/admin/admin.php	2005-06-02 10:08:32.000000000 -0500
+++ 2.2.6.src/modules/profile/admin/admin.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: admin.php,v 1.1.2.3 2005/06/02 16:08:32 mithyt2 Exp $
+// $Id: admin.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/profile/admin/category.php 2.2.6.src/modules/profile/admin/category.php
--- 2.2.3a-Final.src/modules/profile/admin/category.php	2005-06-02 10:08:32.000000000 -0500
+++ 2.2.6.src/modules/profile/admin/category.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: category.php,v 1.1.2.7 2005/06/02 16:08:32 mithyt2 Exp $
+// $Id: category.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/profile/admin/field.php 2.2.6.src/modules/profile/admin/field.php
--- 2.2.3a-Final.src/modules/profile/admin/field.php	2005-10-06 10:14:15.000000000 -0500
+++ 2.2.6.src/modules/profile/admin/field.php	2007-12-08 01:38:26.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: field.php,v 1.1.2.19.2.2 2005/10/06 16:14:15 mithyt2 Exp $
+// $Id: field.php 1165 2007-12-08 07:38:26Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -89,7 +89,7 @@
     foreach (array_keys($fields) as $i) {
         $fields[$i]['canEdit'] = $fields[$i]['field_config'] || $fields[$i]['field_show'] || $fields[$i]['field_edit'];
         $fields[$i]['canDelete'] = $fields[$i]['field_config'];
-        $fields[$i]['module'] = $modules[$fields[$i]['field_moduleid']]->getVar('name');
+        $fields[$i]['module'] = isset($modules[$fields[$i]['field_moduleid']]) ? $modules[$fields[$i]['field_moduleid']]->getVar('name') : "Unknown";
         $fields[$i]['fieldtype'] = $fieldtypes[$fields[$i]['field_type']];
         $fields[$i]['valuetype'] = $valuetypes[$fields[$i]['field_valuetype']];
         $fields[$i]['catid'] = isset($fieldcats[$fields[$i]['fieldid']]) ? $fieldcats[$fields[$i]['fieldid']]->getVar('catid') : 0;
diff -ruN 2.2.3a-Final.src/modules/profile/admin/menu.php 2.2.6.src/modules/profile/admin/menu.php
--- 2.2.3a-Final.src/modules/profile/admin/menu.php	2005-07-06 14:40:53.000000000 -0500
+++ 2.2.6.src/modules/profile/admin/menu.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: menu.php,v 1.1.2.4 2005/07/06 20:40:53 mithyt2 Exp $
+// $Id: menu.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/profile/admin/permissions.php 2.2.6.src/modules/profile/admin/permissions.php
--- 2.2.3a-Final.src/modules/profile/admin/permissions.php	2005-07-02 04:36:48.000000000 -0500
+++ 2.2.6.src/modules/profile/admin/permissions.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: permissions.php,v 1.1.2.3 2005/07/02 10:36:48 mithyt2 Exp $
+// $Id: permissions.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/profile/admin/user.php 2.2.6.src/modules/profile/admin/user.php
--- 2.2.3a-Final.src/modules/profile/admin/user.php	2005-09-28 09:35:59.000000000 -0500
+++ 2.2.6.src/modules/profile/admin/user.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: user.php,v 1.1.2.14.2.2 2005/09/28 15:35:59 mithyt2 Exp $
+// $Id: user.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -88,13 +88,15 @@
     }
     $errors = array();
     $myts =& MyTextSanitizer::getInstance();
-    if ($user->isNew() || $xoopsModuleConfig['allow_chgmail'] == 1) {
+    
+    //if ($user->isNew() || $xoopsModuleConfig['allow_chgmail'] == 1 || $xoopsUser->isAdmin()) {
         $email = '';
         if (!empty($_POST['email'])) {
             $user->setVar('email', trim($_POST['email']));
         }
-    }
-    if ($user->getVar('uid') != $xoopsUser->getVar('uid')) {
+    //}
+    
+    //if ($user->getVar('uid') != $xoopsUser->getVar('uid')) {
         $password = '';
         if (!empty($_POST['password'])) {
             $password = $myts->stripSlashesGPC(trim($_POST['password']));
@@ -115,11 +117,11 @@
         elseif ($user->isNew()) {
             $errors[] = _PROFILE_MA_NOPASSWORD;
         }
-        if ($xoopsUser->isAdmin()) {
+        //if ($xoopsUser->isAdmin()) {
             //admins can set level (activated/deactivated) for users
             $user->setVar('level', intval($_POST['level']));
-        }
-    }
+        //}
+    //}
     $user->setVar('uname', $_POST['uname']);
     $user->setVar('loginname', $_POST['loginname']);
     $user->setVar('rank', intval($_POST['rank']));
@@ -137,7 +139,7 @@
         $fields =& $profile_handler->loadFields();
         // Get ids of fields that can be edited
         $gperm_handler =& xoops_gethandler('groupperm');
-        $editable_fields =& $gperm_handler->getItemIds('profile_edit', $xoopsUser->getGroups(), $xoopsModule->getVar('mid'));
+        $editable_fields = $gperm_handler->getItemIds('profile_edit', $xoopsUser->getGroups(), $xoopsModule->getVar('mid'));
 
         foreach (array_keys($fields) as $i) {
             $fieldname = $fields[$i]->getVar('field_name');
diff -ruN 2.2.3a-Final.src/modules/profile/changemail.php 2.2.6.src/modules/profile/changemail.php
--- 2.2.3a-Final.src/modules/profile/changemail.php	2005-08-12 12:21:40.000000000 -0500
+++ 2.2.6.src/modules/profile/changemail.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: changemail.php,v 1.1.2.5 2005/08/12 18:21:40 mithyt2 Exp $
+// $Id: changemail.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/profile/changepass.php 2.2.6.src/modules/profile/changepass.php
--- 2.2.3a-Final.src/modules/profile/changepass.php	2005-08-12 11:15:10.000000000 -0500
+++ 2.2.6.src/modules/profile/changepass.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: changepass.php,v 1.1.2.2 2005/08/12 17:15:10 mithyt2 Exp $
+// $Id: changepass.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/profile/class/category.php 2.2.6.src/modules/profile/class/category.php
--- 2.2.3a-Final.src/modules/profile/class/category.php	2005-08-12 12:07:28.000000000 -0500
+++ 2.2.6.src/modules/profile/class/category.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: category.php,v 1.1.2.6 2005/08/12 18:07:28 mithyt2 Exp $
+// $Id: category.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/profile/class/fieldcategory.php 2.2.6.src/modules/profile/class/fieldcategory.php
--- 2.2.3a-Final.src/modules/profile/class/fieldcategory.php	2005-08-12 12:07:28.000000000 -0500
+++ 2.2.6.src/modules/profile/class/fieldcategory.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: fieldcategory.php,v 1.1.2.6 2005/08/12 18:07:28 mithyt2 Exp $
+// $Id: fieldcategory.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/profile/edituser.php 2.2.6.src/modules/profile/edituser.php
--- 2.2.3a-Final.src/modules/profile/edituser.php	2005-09-28 14:11:55.000000000 -0500
+++ 2.2.6.src/modules/profile/edituser.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: edituser.php,v 1.1.2.15.2.3 2005/09/28 20:11:55 mithyt2 Exp $
+// $Id: edituser.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -53,7 +53,7 @@
     }
     $errors = array();
     $myts =& MyTextSanitizer::getInstance();
-    if ($xoopsUser->isAdmin()) {
+    if ($xoopsUser->isAdmin() || $xoopsModuleConfig['allow_chgmail'] == 1) {
         $email = '';
         if (!empty($_POST['email'])) {
             $email = $myts->stripSlashesGPC(trim($_POST['email']));
@@ -73,9 +73,9 @@
     } else {
         $member_handler =& xoops_gethandler('member');
         $edituser =& $member_handler->getUser($uid);
-//        if ($xoopsModuleConfig['allow_chgmail'] == 1) {
-//            $edituser->setVar('email', $email);
-//        }
+        if ($xoopsModuleConfig['allow_chgmail'] == 1) {
+            $edituser->setVar('email', $email);
+        }
         $edituser->setVar('name', $myts->stripSlashesGPC(trim($_POST['name'])));
         $edituser->setVar('uname', $myts->stripSlashesGPC(trim($_POST['uname'])));
         if ($xoopsUser->isAdmin()) {
@@ -95,7 +95,7 @@
         $fields =& $profile_handler->loadFields();
         // Get ids of fields that can be edited
         $gperm_handler =& xoops_gethandler('groupperm');
-        $editable_fields =& $gperm_handler->getItemIds('profile_edit', $xoopsUser->getGroups(), $xoopsModule->getVar('mid'));
+        $editable_fields = $gperm_handler->getItemIds('profile_edit', $xoopsUser->getGroups(), $xoopsModule->getVar('mid'));
 
         foreach (array_keys($fields) as $i) {
             if (in_array($fields[$i]->getVar('fieldid'), $editable_fields)) {
@@ -229,13 +229,15 @@
                     @unlink($uploader->getSavedDestination());
                 } else {
                     $oldavatar = $xoopsUser->getVar('user_avatar');
-                    if (!empty($oldavatar) && $oldavatar != 'blank.gif' && !preg_match("/^savt/", strtolower($oldavatar))) {
+                    if (!empty($oldavatar) && preg_match("/^cavt/", strtolower($oldavatar))) {
                         $avatars =& $avt_handler->getObjects(new Criteria('avatar_file', $oldavatar));
-                        $avt_handler->delete($avatars[0]);
-                        $oldavatar_path = str_replace("\\", "/", realpath(XOOPS_UPLOAD_PATH.'/'.$oldavatar));
-                        if (0 === strpos($oldavatar_path, XOOPS_UPLOAD_PATH) && is_file($oldavatar_path)) {
-                            unlink($oldavatar_path);
-                        }
+			            if (!empty($avatars) && count($avatars) == 1 && is_object($avatars[0])) {
+			                $avt_handler->delete($avatars[0]);
+				            $oldavatar_path = str_replace("\\", "/", realpath(XOOPS_UPLOAD_PATH.'/'.$oldavatar));
+				            if (0 === strpos($oldavatar_path, XOOPS_UPLOAD_PATH) && is_file($oldavatar_path)) {
+				                unlink($oldavatar_path);
+				            }
+			            }
                     }
                     $sql = sprintf("UPDATE %s SET user_avatar = %s WHERE uid = %u", $xoopsDB->prefix('users'), $xoopsDB->quoteString($uploader->getSavedFileName()), $xoopsUser->getVar('uid'));
                     $xoopsDB->query($sql);
@@ -263,8 +265,16 @@
         exit();
     }
     $user_avatar = '';
+    $avt_handler =& xoops_gethandler('avatar');
     if (!empty($_POST['user_avatar'])) {
         $user_avatar = trim($_POST['user_avatar']);
+        $criteria_avatar = new CriteriaCompo(new Criteria('avatar_file', $user_avatar));
+        $criteria_avatar->add(new Criteria('avatar_type', "S"));
+        $avatars =& $avt_handler->getObjects($criteria_avatar);
+        if (!is_array($avatars) || !count($avatars)) {
+	        $user_avatar = 'blank.gif';
+        }
+        unset($avatars, $criteria_avatar);
     }
     $user_avatarpath = str_replace("\\", "/", realpath(XOOPS_UPLOAD_PATH.'/'.$user_avatar));
     if (0 === strpos($user_avatarpath, XOOPS_UPLOAD_PATH) && is_file($user_avatarpath)) {
@@ -277,19 +287,19 @@
             include XOOPS_ROOT_PATH.'/footer.php';
             exit();
         }
-        $avt_handler =& xoops_gethandler('avatar');
-        if ($oldavatar && $oldavatar != 'blank.gif' && !preg_match("/^savt/", strtolower($oldavatar))) {
+        if ($oldavatar && preg_match("/^cavt/", strtolower($oldavatar))) {
             $avatars =& $avt_handler->getObjects(new Criteria('avatar_file', $oldavatar));
-            if (is_object($avatars[0])) {
+            if (!empty($avatars) && count($avatars) == 1 && is_object($avatars[0])) {
                 $avt_handler->delete($avatars[0]);
-            }
-            $oldavatar_path = str_replace("\\", "/", realpath(XOOPS_UPLOAD_PATH.'/'.$oldavatar));
-            if (0 === strpos($oldavatar_path, XOOPS_UPLOAD_PATH) && is_file($oldavatar_path)) {
-                unlink($oldavatar_path);
+	            $oldavatar_path = str_replace("\\", "/", realpath(XOOPS_UPLOAD_PATH.'/'.$oldavatar));
+	            if (0 === strpos($oldavatar_path, XOOPS_UPLOAD_PATH) && is_file($oldavatar_path)) {
+	                unlink($oldavatar_path);
+	            }
             }
         }
         if ($user_avatar != 'blank.gif') {
-            $avatars =& $avt_handler->getObjects(new Criteria('avatar_file', $user_avatar));
+			$myts =& MyTextSanitizer::getInstance();
+	        $avatars =& $avt_handler->getObjects(new Criteria('avatar_file', $myts->addSlashes( $user_avatar ) ) );
             if (is_object($avatars[0])) {
                 $avt_handler->addUser($avatars[0]->getVar('avatar_id'), $xoopsUser->getVar('uid'));
             }
diff -ruN 2.2.3a-Final.src/modules/profile/include/forms.php 2.2.6.src/modules/profile/include/forms.php
--- 2.2.3a-Final.src/modules/profile/include/forms.php	2005-10-06 10:14:15.000000000 -0500
+++ 2.2.6.src/modules/profile/include/forms.php	2006-01-22 17:49:01.000000000 -0600
@@ -60,11 +60,12 @@
         $element_select = new XoopsFormSelect(_PROFILE_AM_TYPE, 'field_type', $field->getVar('field_type', 'e'));
         $element_select->addOptionArray($fieldtypes);
 
-        $form->addElement($type_select);
+        //$form->addElement($type_select);
         $form->addElement($element_select);
 
         switch ($field->getVar('field_type')) {
             case "textbox":
+            /*
             $valuetypes = array(XOBJ_DTYPE_ARRAY => _PROFILE_AM_ARRAY,
                         XOBJ_DTYPE_EMAIL => _PROFILE_AM_EMAIL,
                         XOBJ_DTYPE_INT => _PROFILE_AM_INT,
@@ -74,8 +75,9 @@
                         XOBJ_DTYPE_OTHER => _PROFILE_AM_OTHER);
             $type_select = new XoopsFormSelect(_PROFILE_AM_VALUETYPE, 'field_valuetype', $field->getVar('field_valuetype', 'e'));
             $type_select->addOptionArray($valuetypes);
-            $form->addElement($valuetypes);
+            $form->addElement($type_select);
             break;
+            */
 
             case "select":
             case "radio":
@@ -88,7 +90,7 @@
                         XOBJ_DTYPE_OTHER => _PROFILE_AM_OTHER);
             $type_select = new XoopsFormSelect(_PROFILE_AM_VALUETYPE, 'field_valuetype', $field->getVar('field_valuetype', 'e'));
             $type_select->addOptionArray($valuetypes);
-            $form->addElement($valuetypes);
+            $form->addElement($type_select);
             break;
 
 
@@ -171,7 +173,15 @@
             break;
 
             case "theme":
-            $form->addElement(new XoopsFormSelectTheme(_PROFILE_AM_DEFAULT, 'field_default', $field->getVar('field_default', 'e')));
+           	$element = new XoopsFormSelect(_PROFILE_AM_DEFAULT, 'field_default', $field->getVar('field_default', 'e'));
+            $element->addOption("0", _SITEDEFAULT);
+            $theme_list = XoopsLists::getThemesList();
+            foreach($theme_list as $key=>$val){
+	            if(!in_array($key, $GLOBALS['xoopsConfig']['theme_set_allowed'])) continue;
+            	$element->addOption($key, $val);
+            }
+            $form->addElement($element);
+            //$form->addElement(new XoopsFormSelectTheme(_PROFILE_AM_DEFAULT, 'field_default', $field->getVar('field_default', 'e')));
             break;
 
             case "autotext":
@@ -389,7 +399,7 @@
     $weights[0][] = 0;
 
     $email_tray = new XoopsFormElementTray(_PROFILE_MA_EMAIL, '<br />');
-    if ($user->isNew() || $xoopsUser->isAdmin()) {
+    if ($user->isNew() || $xoopsModuleConfig['allow_chgmail'] == 1 || $xoopsUser->isAdmin()) {
         $email_text = new XoopsFormText('', 'email', 30, 60, $user->getVar('email'));
     } else {
         $email_text = new XoopsFormLabel('', $user->getVar('email'));
@@ -452,7 +462,7 @@
     $fields =& $profile_handler->loadFields();
     // Get ids of fields that can be edited
     $gperm_handler =& xoops_gethandler('groupperm');
-    $editable_fields =& $gperm_handler->getItemIds('profile_edit', $xoopsUser->getGroups(), $xoopsModule->getVar('mid'));
+    $editable_fields = $gperm_handler->getItemIds('profile_edit', $xoopsUser->getGroups(), $xoopsModule->getVar('mid'));
 
     $profile_fieldcat_handler =& xoops_getmodulehandler('fieldcategory');
     /* @var $profile_fieldcat_handler ProfileFieldCategoryHandler */
diff -ruN 2.2.3a-Final.src/modules/profile/include/functions.php 2.2.6.src/modules/profile/include/functions.php
--- 2.2.3a-Final.src/modules/profile/include/functions.php	2005-10-29 13:26:10.000000000 -0500
+++ 2.2.6.src/modules/profile/include/functions.php	2006-01-22 17:49:01.000000000 -0600
@@ -7,19 +7,24 @@
 *
 * @return string
 */
-function userCheck($user)
+function userCheck(& $user)
 {
     global $xoopsModuleConfig;
+    $is_admin = (is_object($GLOBALS["xoopsUser"]) && $GLOBALS["xoopsUser"]->isAdmin());
+    $is_admin_user = ($is_admin && ($user->getVar("uid") == $GLOBALS["xoopsUser"]->getVar("uid")));
+       
     $stop = '';
     if (!checkEmail($user->getVar('email'))) {
         $stop .= _PROFILE_MA_INVALIDMAIL.'<br />'.print_r($user->getVar('email'));
     }
+    if(!$is_admin):
     foreach ($xoopsModuleConfig['bad_emails'] as $be) {
         if (!empty($be) && preg_match("/".$be."/i", $user->getVar('email'))) {
             $stop .= _PROFILE_MA_INVALIDMAIL.'<br />'.print_r($user->getVar('email'));
             break;
         }
     }
+    endif;
     if (strrpos($user->getVar('email'),' ') > 0) {
         $stop .= _PROFILE_MA_EMAILNOSPACES.'<br />';
     }
@@ -37,12 +42,13 @@
         $restriction = '/[\000-\040]/';
         break;
     }
-    if ($user->getVar('loginname') == "" || preg_match($restriction, $user->getVar('loginname'))) {
+    if ($user->getVar('loginname') == "" || (preg_match($restriction, $user->getVar('loginname')) &&!$is_admin_user) ) {
         $stop .= _PROFILE_MA_INVALIDNICKNAME."<br />";
     }
 //    if ($user->getVar('name') == "" || preg_match($restriction, $user->getVar('name'))) {
 //        $stop .= _PROFILE_MA_INVALIDDISPLAYNAME."<br />";
 //    }
+    if(!$is_admin_user):
     if (strlen($user->getVar('loginname')) > $xoopsModuleConfig['max_uname']) {
         $stop .= sprintf(_PROFILE_MA_NICKNAMETOOLONG, $xoopsModuleConfig['max_uname'])."<br />";
     }
@@ -55,8 +61,9 @@
     if (strlen($user->getVar('uname')) < $xoopsModuleConfig['min_uname']) {
         $stop .= sprintf(_PROFILE_MA_DISPLAYNAMETOOSHORT, $xoopsModuleConfig['min_uname'])."<br />";
     }
+    endif;
     foreach ($xoopsModuleConfig['bad_unames'] as $bu) {
-	    if(empty($bu) ||$user->isAdmin()) continue;
+	    if( empty($bu) || $is_admin_user) continue;
         if (preg_match("/".$bu."/i", $user->getVar('loginname'))) {
             $stop .= _PROFILE_MA_NAMERESERVED."<br />";
             break;
diff -ruN 2.2.3a-Final.src/modules/profile/index.php 2.2.6.src/modules/profile/index.php
--- 2.2.3a-Final.src/modules/profile/index.php	2005-04-23 03:56:05.000000000 -0500
+++ 2.2.6.src/modules/profile/index.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: index.php,v 1.1.2.1 2005/04/23 09:56:05 mithyt2 Exp $
+// $Id: index.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/profile/language/english/admin.php 2.2.6.src/modules/profile/language/english/admin.php
--- 2.2.3a-Final.src/modules/profile/language/english/admin.php	2005-10-06 10:14:15.000000000 -0500
+++ 2.2.6.src/modules/profile/language/english/admin.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: admin.php,v 1.1.2.12.2.3 2005/10/06 16:14:15 mithyt2 Exp $
+// $Id: admin.php 184 2006-01-22 22:34:51Z skalpa $
 define("_PROFILE_AM_FIELD", "Field");
 define("_PROFILE_AM_FIELDS", "Fields");
 define("_PROFILE_AM_CATEGORY", "Category");
diff -ruN 2.2.3a-Final.src/modules/profile/language/english/error.php 2.2.6.src/modules/profile/language/english/error.php
--- 2.2.3a-Final.src/modules/profile/language/english/error.php	2005-09-18 08:03:12.000000000 -0500
+++ 2.2.6.src/modules/profile/language/english/error.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,4 +1,4 @@
 <?php
-// $Id: error.php,v 1.1.2.1.2.1 2005/09/18 14:03:12 mithyt2 Exp $
+// $Id: error.php 184 2006-01-22 22:34:51Z skalpa $
 define("PROFILE_ERROR1", "The key is wrong");
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/modules/profile/language/english/main.php 2.2.6.src/modules/profile/language/english/main.php
--- 2.2.3a-Final.src/modules/profile/language/english/main.php	2005-09-26 09:07:47.000000000 -0500
+++ 2.2.6.src/modules/profile/language/english/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.1.2.13.2.2 2005/09/26 15:07:47 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 define("_PROFILE_MA_ERRORDURINGSAVE", "Error during save");
 define('_PROFILE_MA_USERREG','User Registration');
 define('_PROFILE_MA_NICKNAME','Username');
diff -ruN 2.2.3a-Final.src/modules/profile/language/english/modinfo.php 2.2.6.src/modules/profile/language/english/modinfo.php
--- 2.2.3a-Final.src/modules/profile/language/english/modinfo.php	2005-07-05 11:33:07.000000000 -0500
+++ 2.2.6.src/modules/profile/language/english/modinfo.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: modinfo.php,v 1.1.2.13 2005/07/05 17:33:07 mithyt2 Exp $
+// $Id: modinfo.php 184 2006-01-22 22:34:51Z skalpa $
 define("_PROFILE_MI_NAME", "Extended Profiles");
 define("_PROFILE_MI_DESC", "Module for managing custom user profile fields");
 
diff -ruN 2.2.3a-Final.src/modules/profile/register.php 2.2.6.src/modules/profile/register.php
--- 2.2.3a-Final.src/modules/profile/register.php	2005-09-18 07:59:36.000000000 -0500
+++ 2.2.6.src/modules/profile/register.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: register.php,v 1.1.2.13.2.1 2005/09/18 13:59:36 mithyt2 Exp $
+// $Id: register.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -72,7 +72,9 @@
             $stop .= _PROFILE_MA_UNEEDAGREE.'<br />';
         }
     }
-    if (!empty($xoopsModuleConfig['minpass']) && strlen(trim($_POST['pass'])) < $xoopsModuleConfig['minpass']) {
+    if ( strcmp(trim($_POST['pass']), trim($_POST['vpass'])) ) {
+        $stop .= _PROFILE_MA_PASSNOTSAME."<br />";
+    }elseif (!empty($xoopsModuleConfig['minpass']) && strlen(trim($_POST['pass'])) < $xoopsModuleConfig['minpass']) {
         $stop .= sprintf(_PROFILE_MA_PWDTOOSHORT,$xoopsModuleConfig['minpass'])."<br />";
     }
     $stop .= userCheck($newuser);
@@ -118,12 +120,6 @@
         break;
     }
 
-    $stop = '';
-    if ($xoopsModuleConfig['display_disclaimer'] != 0 && $xoopsModuleConfig['disclaimer'] != '') {
-        if (empty($agree_disc)) {
-            $stop .= _PROFILE_MA_UNEEDAGREE.'<br />';
-        }
-    }
     $stop = userCheck($newuser);
     if ( empty($stop) ) {
         $newuser->setVar('pass', $_POST['pass']);
@@ -137,7 +133,7 @@
 
         $profile_handler =& xoops_gethandler('profile');
         // Get fields
-        $fields =& $profile_handler->loadFields();
+        $fields = $profile_handler->loadFields();
         if (count($fields) > 0) {
             foreach (array_keys($fields) as $i) {
                 $fieldname = $fields[$i]->getVar('field_name');
diff -ruN 2.2.3a-Final.src/modules/profile/search.php 2.2.6.src/modules/profile/search.php
--- 2.2.3a-Final.src/modules/profile/search.php	2005-09-19 11:57:08.000000000 -0500
+++ 2.2.6.src/modules/profile/search.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: search.php,v 1.1.2.10.2.3 2005/09/19 17:57:08 mithyt2 Exp $
+// $Id: search.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -42,7 +42,7 @@
     $fields =& $profile_handler->loadFields();
     // Get ids of fields that can be searched
     $gperm_handler =& xoops_gethandler('groupperm');
-    $searchable_fields =& $gperm_handler->getItemIds('profile_search', $groups, $xoopsModule->getVar('mid'));
+    $searchable_fields = $gperm_handler->getItemIds('profile_search', $groups, $xoopsModule->getVar('mid'));
 
     include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
     $searchform = new XoopsThemeForm("", "searchform", "search.php", "post");
@@ -164,7 +164,7 @@
     $fields =& $profile_handler->loadFields();
     // Get ids of fields that can be searched
     $gperm_handler =& xoops_gethandler('groupperm');
-    $searchable_fields =& $gperm_handler->getItemIds('profile_search', $groups, $xoopsModule->getVar('mid'));
+    $searchable_fields = $gperm_handler->getItemIds('profile_search', $groups, $xoopsModule->getVar('mid'));
     $searchvars = array();
 
     $criteria = new CriteriaCompo(new Criteria('level', 0, ">"));
@@ -396,12 +396,15 @@
 
     if ($total_users > $limit) {
         $search_url[] = "op=results";
-        $search_url[] = "order=".$order;
+		foreach(array('uname','uname_match','name','name_match','email','email_match') as $param) {
+			if (isset($_REQUEST[$param])) {
+				$search_url[] = "$param={$_REQUEST[$param]}";
+			}
+		}		
+		$search_url[] = "order=".$order;
         $search_url[] = "sortby=".$_REQUEST['sortby'];
         $search_url[] = "limit=".$limit;
-        if (isset($search_url)) {
-            $args = implode("&amp;", $search_url);
-        }
+        $args = implode("&amp;", $search_url);
         include_once XOOPS_ROOT_PATH."/class/pagenav.php";
         $nav = new XoopsPageNav($total_users, $limit, $start, "start", $args);
         $xoopsTpl->assign('nav', $nav->renderNav(5));
diff -ruN 2.2.3a-Final.src/modules/profile/userinfo.php 2.2.6.src/modules/profile/userinfo.php
--- 2.2.3a-Final.src/modules/profile/userinfo.php	2005-09-18 08:10:26.000000000 -0500
+++ 2.2.6.src/modules/profile/userinfo.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: userinfo.php,v 1.1.2.17.2.1 2005/09/18 14:10:26 mithyt2 Exp $
+// $Id: userinfo.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -64,7 +64,9 @@
 
     $member_handler =& xoops_gethandler('member');
     $thisUser =& $member_handler->getUser($uid);
-    if (!is_object($thisUser) || !$thisUser->isActive()) {
+    if(!is_object($thisUser) || 
+    	( !$thisUser->isActive() && (!is_object($xoopsUser) || !$xoopsUser->isAdmin()) )
+    ){
         redirect_header("index.php",3,_PROFILE_MA_SELECTNG);
         exit();
     }
@@ -82,9 +84,9 @@
 // Dynamic User Profiles
 $thisUsergroups =& $thisUser->getGroups();
 $groupperm_handler =& xoops_gethandler('groupperm');
-$show_ids =& $groupperm_handler->getItemIds('profile_show', $thisUsergroups, $xoopsModule->getVar('mid'));
+$show_ids = $groupperm_handler->getItemIds('profile_show', $thisUsergroups, $xoopsModule->getVar('mid'));
 if (!is_object($xoopsUser) || !$xoopsUser->isAdmin()) {
-    $visible_ids =& $groupperm_handler->getItemIds('profile_visible', $groups, $xoopsModule->getVar('mid'));
+    $visible_ids = $groupperm_handler->getItemIds('profile_visible', $groups, $xoopsModule->getVar('mid'));
     $fieldids = array_intersect($show_ids, $visible_ids);
 }
 else {
@@ -110,7 +112,7 @@
 	$categories[0]['fields'][] = array('title' => _PROFILE_MA_AVATAR, 'value' => "<img src='".XOOPS_UPLOAD_URL."/".$thisUser->getVar('user_avatar')."' alt='".$thisUser->getVar('uname')."' />");
 	$weights[0][] = 0;
 }
-$userrank =& $thisUser->rank();
+$userrank = $thisUser->rank();
 $user_rankimage = "";
 if (isset($userrank['image']) && $userrank['image'] != "") {
     $user_rankimage = '<img src="'.XOOPS_UPLOAD_URL.'/'.$userrank['image'].'" alt="'.$userrank['title'].'" /><br />';
@@ -167,14 +169,14 @@
     $criteria = new CriteriaCompo(new Criteria('hassearch', 1));
     $criteria->add(new Criteria('isactive', 1));
     $modules =& $module_handler->getObjects($criteria, true);
-    $mids =& array_keys($modules);
+    $mids = array_keys($modules);
 
     $myts =& MyTextSanitizer::getInstance();
     $allowed_mids = $gperm_handler->getItemIds('module_read', $groups);
     if (count($mids) > 0 && count($allowed_mids) > 0) {
         foreach ($mids as $mid) {
             if ( in_array($mid, $allowed_mids)) {
-                $results =& $modules[$mid]->search('', '', 5, 0, $thisUser->getVar('uid'));
+                $results = $modules[$mid]->search('', '', 5, 0, $thisUser->getVar('uid'));
                 $count = count($results);
                 if (is_array($results) && $count > 0) {
                     for ($i = 0; $i < $count; $i++) {
diff -ruN 2.2.3a-Final.src/modules/profile/xoops_version.php 2.2.6.src/modules/profile/xoops_version.php
--- 2.2.3a-Final.src/modules/profile/xoops_version.php	2005-08-12 12:21:40.000000000 -0500
+++ 2.2.6.src/modules/profile/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.1.2.15 2005/08/12 18:21:40 mithyt2 Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/avatars/main.php 2.2.6.src/modules/system/admin/avatars/main.php
--- 2.2.3a-Final.src/modules/system/admin/avatars/main.php	2005-03-31 11:39:27.000000000 -0600
+++ 2.2.6.src/modules/system/admin/avatars/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.11.6.2 2005/03/31 18:39:27 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/avatars/xoops_version.php 2.2.6.src/modules/system/admin/avatars/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/avatars/xoops_version.php	2003-02-12 05:37:53.000000000 -0600
+++ 2.2.6.src/modules/system/admin/avatars/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.6 2003/02/12 11:37:53 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/banners/banners.php 2.2.6.src/modules/system/admin/banners/banners.php
--- 2.2.3a-Final.src/modules/system/admin/banners/banners.php	2005-09-18 08:23:08.000000000 -0500
+++ 2.2.6.src/modules/system/admin/banners/banners.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: banners.php,v 1.11.6.1.2.1 2005/09/18 14:23:08 mithyt2 Exp $
+// $Id: banners.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -125,9 +125,9 @@
     <td align='center'>"._AM_FUNCTION."</td></tr><tr align='center'>";
     $result = $xoopsDB->query("SELECT cid, name, contact, email FROM ".$xoopsDB->prefix("bannerclient")." ORDER BY cid");
     while(list($cid, $name, $contact, $email) = $xoopsDB->fetchRow($result)) {
-        $name = $myts->makeTboxData4Show($name);
-        $contact = $myts->makeTboxData4Show($contact);
-        $email = $myts->makeTboxData4Show($email);
+        $name = htmlspecialchars($name,ENT_QUOTES);
+        $contact = htmlspecialchars($contact,ENT_QUOTES);
+        $email = htmlspecialchars($email,ENT_QUOTES);
         $result2 = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("banner")." WHERE cid=$cid");
         list($numrows) = $xoopsDB->fetchRow($result2);
         echo "
@@ -297,9 +297,9 @@
     "._AM_CLICKURLT."<input type='text' name='clickurl' size='50' maxlength='200' value='".htmlspecialchars($clickurl, ENT_QUOTES)."' /><br />
     "._AM_USEHTML;
     if ($htmlbanner){
-        echo " <input type='checkbox' name='htmlbanner' value='1' checked='checked'>";
+        echo " <input type='checkbox' name='htmlbanner' value='1' checked='checked' />";
     }else{
-        echo " <input type='checkbox' name='htmlbanner' value='1'>";
+        echo " <input type='checkbox' name='htmlbanner' value='1' />";
     }
     echo "
     <br />
@@ -347,9 +347,9 @@
             if(strtolower(substr($imageurl,strrpos($imageurl,".")))==".swf") {
                 $bannerobject = $bannerobject
                         .'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="468" height="60">'
-                        .'<param name=movie value="'.$imageurl.'">'
-                        .'<param name=quality value=high>'
-                        .'<embed src="'.$imageurl.'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"; type="application/x-shockwave-flash" width="468" height="60">'
+                        .'<param name="movie" value="'.$imageurl.'"></param>'
+                        .'<param name="quality" value="high"></param>'
+                        .'<embed src="'.$imageurl.'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="468" height="60">'
                         .'</embed>'
                         .'</object>';
             } else {
diff -ruN 2.2.3a-Final.src/modules/system/admin/banners/main.php 2.2.6.src/modules/system/admin/banners/main.php
--- 2.2.3a-Final.src/modules/system/admin/banners/main.php	2005-09-18 08:23:08.000000000 -0500
+++ 2.2.6.src/modules/system/admin/banners/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.12.6.3.2.1 2005/09/18 14:23:08 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/banners/xoops_version.php 2.2.6.src/modules/system/admin/banners/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/banners/xoops_version.php	2003-02-12 05:37:53.000000000 -0600
+++ 2.2.6.src/modules/system/admin/banners/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:37:53 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/blocksadmin/blockform.php 2.2.6.src/modules/system/admin/blocksadmin/blockform.php
--- 2.2.3a-Final.src/modules/system/admin/blocksadmin/blockform.php	2005-07-20 04:02:36.000000000 -0500
+++ 2.2.6.src/modules/system/admin/blocksadmin/blockform.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: blockform.php,v 1.8.22.6 2005/07/20 10:02:36 mithyt2 Exp $
+// $Id: blockform.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/blocksadmin/blocksadmin.php 2.2.6.src/modules/system/admin/blocksadmin/blocksadmin.php
--- 2.2.3a-Final.src/modules/system/admin/blocksadmin/blocksadmin.php	2005-09-18 08:27:46.000000000 -0500
+++ 2.2.6.src/modules/system/admin/blocksadmin/blocksadmin.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: blocksadmin.php,v 1.23.4.4.2.20.2.2 2005/09/18 14:27:46 mithyt2 Exp $
+// $Id: blocksadmin.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/blocksadmin/main.php 2.2.6.src/modules/system/admin/blocksadmin/main.php
--- 2.2.3a-Final.src/modules/system/admin/blocksadmin/main.php	2005-09-18 08:25:40.000000000 -0500
+++ 2.2.6.src/modules/system/admin/blocksadmin/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.13.4.2.2.9.2.1 2005/09/18 14:25:40 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/blocksadmin/xoops_version.php 2.2.6.src/modules/system/admin/blocksadmin/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/blocksadmin/xoops_version.php	2003-02-12 05:37:54.000000000 -0600
+++ 2.2.6.src/modules/system/admin/blocksadmin/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:37:54 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/comments/admin_header.php 2.2.6.src/modules/system/admin/comments/admin_header.php
--- 2.2.3a-Final.src/modules/system/admin/comments/admin_header.php	2003-03-10 07:32:06.000000000 -0600
+++ 2.2.6.src/modules/system/admin/comments/admin_header.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: admin_header.php,v 1.4 2003/03/10 13:32:06 okazu Exp $
+// $Id: admin_header.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/comments/comment_delete.php 2.2.6.src/modules/system/admin/comments/comment_delete.php
--- 2.2.3a-Final.src/modules/system/admin/comments/comment_delete.php	2003-02-12 05:37:54.000000000 -0600
+++ 2.2.6.src/modules/system/admin/comments/comment_delete.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_delete.php,v 1.4 2003/02/12 11:37:54 okazu Exp $
+// $Id: comment_delete.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/comments/comment_edit.php 2.2.6.src/modules/system/admin/comments/comment_edit.php
--- 2.2.3a-Final.src/modules/system/admin/comments/comment_edit.php	2003-02-12 05:37:54.000000000 -0600
+++ 2.2.6.src/modules/system/admin/comments/comment_edit.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_edit.php,v 1.4 2003/02/12 11:37:54 okazu Exp $
+// $Id: comment_edit.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/comments/comment_post.php 2.2.6.src/modules/system/admin/comments/comment_post.php
--- 2.2.3a-Final.src/modules/system/admin/comments/comment_post.php	2003-02-12 05:37:54.000000000 -0600
+++ 2.2.6.src/modules/system/admin/comments/comment_post.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment_post.php,v 1.4 2003/02/12 11:37:54 okazu Exp $
+// $Id: comment_post.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/comments/main.php 2.2.6.src/modules/system/admin/comments/main.php
--- 2.2.3a-Final.src/modules/system/admin/comments/main.php	2005-10-27 19:46:02.000000000 -0500
+++ 2.2.6.src/modules/system/admin/comments/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.12.6.2.2.1 2005/10/28 01:46:02 skalpa Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/comments/xoops_version.php 2.2.6.src/modules/system/admin/comments/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/comments/xoops_version.php	2003-02-12 05:37:54.000000000 -0600
+++ 2.2.6.src/modules/system/admin/comments/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:37:54 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/findusers/main.php 2.2.6.src/modules/system/admin/findusers/main.php
--- 2.2.3a-Final.src/modules/system/admin/findusers/main.php	2005-07-19 08:47:16.000000000 -0500
+++ 2.2.6.src/modules/system/admin/findusers/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.11.4.1.2.7 2005/07/19 14:47:16 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/findusers/xoops_version.php 2.2.6.src/modules/system/admin/findusers/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/findusers/xoops_version.php	2003-02-12 05:37:54.000000000 -0600
+++ 2.2.6.src/modules/system/admin/findusers/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:37:54 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/groupperm.php 2.2.6.src/modules/system/admin/groupperm.php
--- 2.2.3a-Final.src/modules/system/admin/groupperm.php	2005-04-09 08:48:19.000000000 -0500
+++ 2.2.6.src/modules/system/admin/groupperm.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: groupperm.php,v 1.8.6.1 2005/04/09 14:48:19 mithyt2 Exp $
+// $Id: groupperm.php 1030 2007-09-09 05:44:27Z phppp $
 $xoopsOption['pagetype'] = 'admin';
 include '../../../include/cp_header.php';
 $modid = isset($_POST['modid']) ? intval($_POST['modid']) : 0;
@@ -22,6 +22,8 @@
 	exit();
 }
 
+$msg = array();
+
 $member_handler =& xoops_gethandler('member');
 $group_list =& $member_handler->getGroupList();
 if (is_array($_POST['perms']) && !empty($_POST['perms'])) {
@@ -57,21 +59,19 @@
 				}
 			}
 		} else {
-+ $msg[] = sprintf(_MD_AM_PERMRESETNG, $module->getVar('name').'('.$perm_name.')');
+			$msg[] = sprintf(_MD_AM_PERMRESETNG, $module->getVar('name').'('.$perm_name.')');
 		}
 	}
 }
 
-$backlink = XOOPS_URL.'/admin.php';
+$backlink = xoops_getenv("HTTP_REFERER");
 if ($module->getVar('hasadmin')) {
     $adminindex = isset($_POST['redirect_url']) ? $_POST['redirect_url'] : $module->getInfo('adminindex');
 	if ($adminindex) {
 		$backlink = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$adminindex;
 	}
 }
+$backlink = ($backlink)?$backlink:XOOPS_URL.'/admin.php';
 
-$msg[] = '<br /><br /><a href="'.$backlink.'">'._BACK.'</a>';
-xoops_cp_header();
-xoops_result($msg);
-xoops_cp_footer();
+redirect_header($backlink, 2, implode("<br />", $msg));
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/modules/system/admin/groups/groupform.php 2.2.6.src/modules/system/admin/groups/groupform.php
--- 2.2.3a-Final.src/modules/system/admin/groups/groupform.php	2005-05-06 10:56:48.000000000 -0500
+++ 2.2.6.src/modules/system/admin/groups/groupform.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: groupform.php,v 1.5.22.3 2005/05/06 16:56:48 mithyt2 Exp $
+// $Id: groupform.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/groups/groups.php 2.2.6.src/modules/system/admin/groups/groups.php
--- 2.2.3a-Final.src/modules/system/admin/groups/groups.php	2005-05-14 04:31:17.000000000 -0500
+++ 2.2.6.src/modules/system/admin/groups/groups.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: groups.php,v 1.12.6.5 2005/05/14 10:31:17 mithyt2 Exp $
+// $Id: groups.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -93,11 +93,11 @@
     $name_value = $thisgroup->getVar("name", "E");
     $desc_value = $thisgroup->getVar("description", "E");
     $moduleperm_handler =& xoops_gethandler('groupperm');
-    $a_mod_value =& $moduleperm_handler->getItemIds('module_admin', $thisgroup->getVar('groupid'));
-    $r_mod_value =& $moduleperm_handler->getItemIds('module_read', $thisgroup->getVar('groupid'));
-    
+    $a_mod_value = $moduleperm_handler->getItemIds('module_admin', $thisgroup->getVar('groupid'));
+    $r_mod_value = $moduleperm_handler->getItemIds('module_read', $thisgroup->getVar('groupid'));
+
     $gperm_handler =& xoops_gethandler('groupperm');
-    $r_block_value =& $gperm_handler->getItemIds('block_read', $g_id);
+    $r_block_value = $gperm_handler->getItemIds('block_read', $g_id);
     $op_value = "update";
     $submit_value = _AM_UPDATEADG;
     $g_id_value = $thisgroup->getVar("groupid");
@@ -108,7 +108,7 @@
     }
 
     $sysperm_handler =& xoops_gethandler('groupperm');
-    $s_cat_value =& $sysperm_handler->getItemIds('system_admin', $g_id);
+    $s_cat_value = $sysperm_handler->getItemIds('system_admin', $g_id);
 
     include XOOPS_ROOT_PATH."/modules/system/admin/groups/groupform.php";
     echo "<br /><h4 style='text-align:left'>"._AM_EDITMEMBER."</h4>";
@@ -121,11 +121,11 @@
         $members =& $member_handler->getUsersByGroup($g_id, false);
         if (count($members) > 0) {
             $member_criteria = new Criteria('uid', "(".implode(',', $members).")", "IN");
-            $member_criteria->setSort('name');
+            $member_criteria->setSort('uname');
             $mlist = $member_handler->getUserList($member_criteria);
         }
         $criteria = new Criteria('level', 0, '>');
-        $criteria->setSort('name');
+        $criteria->setSort('uname');
         $userslist =& $member_handler->getUserList($criteria);
         $users =& array_diff($userslist, $mlist);
         echo '<table class="outer">
@@ -168,7 +168,7 @@
         $mlist = array();
         if (count($members) > 0) {
             $member_criteria = new Criteria('uid', "(".implode(',', $members).")", "IN");
-            $member_criteria->setSort('name');
+            $member_criteria->setSort('uname');
             $mlist = $member_handler->getUserList($member_criteria);
         }
         echo '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=findusers&amp;group='.$g_id.'">'._AM_FINDU4GROUP.'</a><br />';
diff -ruN 2.2.3a-Final.src/modules/system/admin/groups/main.php 2.2.6.src/modules/system/admin/groups/main.php
--- 2.2.3a-Final.src/modules/system/admin/groups/main.php	2005-05-07 10:46:03.000000000 -0500
+++ 2.2.6.src/modules/system/admin/groups/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.12.6.4 2005/05/07 16:46:03 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/groups/xoops_version.php 2.2.6.src/modules/system/admin/groups/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/groups/xoops_version.php	2003-02-12 05:37:54.000000000 -0600
+++ 2.2.6.src/modules/system/admin/groups/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:37:54 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/images/main.php 2.2.6.src/modules/system/admin/images/main.php
--- 2.2.3a-Final.src/modules/system/admin/images/main.php	2005-03-31 11:39:29.000000000 -0600
+++ 2.2.6.src/modules/system/admin/images/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.12.6.2 2005/03/31 18:39:29 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/images/xoops_version.php 2.2.6.src/modules/system/admin/images/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/images/xoops_version.php	2003-02-12 05:37:54.000000000 -0600
+++ 2.2.6.src/modules/system/admin/images/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:37:54 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/mailusers/mailform.php 2.2.6.src/modules/system/admin/mailusers/mailform.php
--- 2.2.3a-Final.src/modules/system/admin/mailusers/mailform.php	2005-03-25 07:06:08.000000000 -0600
+++ 2.2.6.src/modules/system/admin/mailusers/mailform.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,101 +1,101 @@
-<?php
-// $Id: mailform.php,v 1.6.6.1 2005/03/25 13:06:08 mithyt2 Exp $
-//  ------------------------------------------------------------------------ //
-//                XOOPS - PHP Content Management System                      //
-//                    Copyright (c) 2000 XOOPS.org                           //
-//                       <http://www.xoops.org/>                             //
-//  ------------------------------------------------------------------------ //
-//  This program 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.                                      //
-//                                                                           //
-//  You may not change or alter any portion of this comment or credits       //
-//  of supporting developers from this source code or any supporting         //
-//  source code which is considered copyrighted (c) material of the          //
-//  original comment or credit authors.                                      //
-//                                                                           //
-//  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.                             //
-//                                                                           //
-//  You should have received a copy of the GNU General Public License        //
-//  along with this program; if not, write to the Free Software              //
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
-//  ------------------------------------------------------------------------ //
-// Author: Kazumi Ono (AKA onokazu)                                          //
-// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
-// Project: The XOOPS Project                                                //
-// ------------------------------------------------------------------------- //
-
-$form = new XoopsThemeForm(_AM_SENDMTOUSERS, "mailusers", "admin.php?fct=mailusers", 'post', true);
-
-// from finduser section
-if (!empty($_POST['memberslist_id'])) {
-    $user_count = count($_POST['memberslist_id']);
-    $display_names = "";
-    for ( $i = 0; $i < $user_count; $i++ ) {
-        $uid_hidden = new XoopsFormHidden("mail_to_user[]", $_POST['memberslist_id'][$i]);
-        $form->addElement($uid_hidden);
-        $display_names .= "<a href='".XOOPS_URL."/userinfo.php?uid=".$_POST['memberslist_id'][$i]."' target='_blank'>".$_POST['memberslist_uname'][$_POST['memberslist_id'][$i]]."</a>, ";
-        unset($uid_hidden);
-    }
-    $users_label = new XoopsFormLabel(_AM_SENDTOUSERS2, substr($display_names, 0, -2));
-    $form->addElement($users_label);
-    $display_criteria = 0;
-}
-if ( !empty($display_criteria) ) {
-    $selected_groups = array();
-    $group_select = new XoopsFormSelectGroup(_AM_GROUPIS."<br />", "mail_to_group", false, $selected_groups, 5, true);
-    $lastlog_min = new XoopsFormText(_AM_LASTLOGMIN."<br />"._AM_TIMEFORMAT."<br />", "mail_lastlog_min", 20, 10);
-    $lastlog_max = new XoopsFormText(_AM_LASTLOGMAX."<br />"._AM_TIMEFORMAT."<br />", "mail_lastlog_max", 20, 10);
-    $regd_min = new XoopsFormText(_AM_REGDMIN."<br />"._AM_TIMEFORMAT."<br />", "mail_regd_min", 20, 10);
-    $regd_max = new XoopsFormText(_AM_REGDMAX."<br />"._AM_TIMEFORMAT."<br />", "mail_regd_max", 20, 10);
-    $idle_more = new XoopsFormText(_AM_IDLEMORE."<br />", "mail_idle_more", 10, 5);
-    $idle_less = new XoopsFormText(_AM_IDLELESS."<br />", "mail_idle_less", 10, 5);
-    $mailok_cbox = new XoopsFormCheckBox('', 'mail_mailok');
-    $mailok_cbox->addOption(1, _AM_MAILOK);
-    $inactive_cbox = new XoopsFormCheckBox(_AM_INACTIVE."<br />", "mail_inactive");
-    $inactive_cbox->addOption(1, _AMIFCHECKD);
-    $inactive_cbox->setExtra("onclick='javascript:disableElement(\"mail_lastlog_min\");disableElement(\"mail_lastlog_max\");disableElement(\"mail_idle_more\");disableElement(\"mail_idle_less\");disableElement(\"mail_to_group[]\");'");
-    $criteria_tray = new XoopsFormElementTray(_AM_SENDTOUSERS, "<br /><br />");
-    $criteria_tray->addElement($group_select);
-    $criteria_tray->addElement($lastlog_min);
-    $criteria_tray->addElement($lastlog_max);
-    $criteria_tray->addElement($idle_more);
-    $criteria_tray->addElement($idle_less);
-    $criteria_tray->addElement($mailok_cbox);
-    $criteria_tray->addElement($inactive_cbox);
-    $criteria_tray->addElement($regd_min);
-    $criteria_tray->addElement($regd_max);
-    $form->addElement($criteria_tray);
-}
-
-$fname_text = new XoopsFormText(_AM_MAILFNAME, "mail_fromname", 30, 255, $xoopsConfig['sitename']);
-$fromemail = !empty($xoopsConfig['adminmail']) ? $xoopsConfig['adminmail'] : $xoopsUser->getVar("email", "E");
-$femail_text = new XoopsFormText(_AM_MAILFMAIL, "mail_fromemail", 30, 255, $fromemail);
-//$subject_caption = _AM_MAILSUBJECT."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS1."<br />"._AM_MAILTAGS2."<br />"._AM_MAILTAGS3."</span>";
-$subject_caption = _AM_MAILSUBJECT."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS2."</span>";
-$subject_text = new XoopsFormText($subject_caption, "mail_subject", 50, 255);
-$body_caption = _AM_MAILBODY."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS1."<br />"._AM_MAILTAGS2."<br />"._AM_MAILTAGS3."<br />"._AM_MAILTAGS4."</span>";
-$body_text = new XoopsFormTextArea($body_caption, "mail_body", "", 10);
-$to_checkbox = new XoopsFormCheckBox(_AM_SENDTO, "mail_send_to", "mail");
-$to_checkbox->addOption("mail", _AM_EMAIL);
-$to_checkbox->addOption("pm", _AM_PM);
-$start_hidden = new XoopsFormHidden("mail_start", 0);
-$op_hidden = new XoopsFormHidden("op", "send");
-$submit_button = new XoopsFormButton("", "mail_submit", _SEND, "submit");
-
-$form->addElement($fname_text);
-$form->addElement($femail_text);
-$form->addElement($subject_text);
-$form->addElement($body_text);
-$form->addElement($to_checkbox);
-$form->addElement($op_hidden);
-$form->addElement($start_hidden);
-$form->addElement($submit_button);
-$form->setRequired($subject_text);
-$form->setRequired($body_text);
-//$form->setRequired($to_checkbox);
+<?php
+// $Id: mailform.php 185 2006-01-22 23:49:01Z skalpa $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$form = new XoopsThemeForm(_AM_SENDMTOUSERS, "mailusers", "admin.php?fct=mailusers", 'post', true);
+
+// from finduser section
+if (!empty($_POST['memberslist_id'])) {
+    $user_count = count($_POST['memberslist_id']);
+    $display_names = "";
+    for ( $i = 0; $i < $user_count; $i++ ) {
+        $uid_hidden = new XoopsFormHidden("mail_to_user[]", $_POST['memberslist_id'][$i]);
+        $form->addElement($uid_hidden);
+        $display_names .= "<a href='".XOOPS_URL."/userinfo.php?uid=".$_POST['memberslist_id'][$i]."' target='_blank'>".$_POST['memberslist_uname'][$_POST['memberslist_id'][$i]]."</a>, ";
+        unset($uid_hidden);
+    }
+    $users_label = new XoopsFormLabel(_AM_SENDTOUSERS2, substr($display_names, 0, -2));
+    $form->addElement($users_label);
+    $display_criteria = 0;
+}
+if ( !empty($display_criteria) ) {
+    $selected_groups = array();
+    $group_select = new XoopsFormSelectGroup(_AM_GROUPIS."<br />", "mail_to_group", false, $selected_groups, 5, true);
+    $lastlog_min = new XoopsFormText(_AM_LASTLOGMIN."<br />"._AM_TIMEFORMAT."<br />", "mail_lastlog_min", 20, 10);
+    $lastlog_max = new XoopsFormText(_AM_LASTLOGMAX."<br />"._AM_TIMEFORMAT."<br />", "mail_lastlog_max", 20, 10);
+    $regd_min = new XoopsFormText(_AM_REGDMIN."<br />"._AM_TIMEFORMAT."<br />", "mail_regd_min", 20, 10);
+    $regd_max = new XoopsFormText(_AM_REGDMAX."<br />"._AM_TIMEFORMAT."<br />", "mail_regd_max", 20, 10);
+    $idle_more = new XoopsFormText(_AM_IDLEMORE."<br />", "mail_idle_more", 10, 5);
+    $idle_less = new XoopsFormText(_AM_IDLELESS."<br />", "mail_idle_less", 10, 5);
+    $mailok_cbox = new XoopsFormCheckBox('', 'mail_mailok');
+    $mailok_cbox->addOption(1, _AM_MAILOK);
+    $inactive_cbox = new XoopsFormCheckBox(_AM_INACTIVE."<br />", "mail_inactive");
+    $inactive_cbox->addOption(1, _AMIFCHECKD);
+    $inactive_cbox->setExtra("onclick='javascript:disableElement(\"mail_lastlog_min\");disableElement(\"mail_lastlog_max\");disableElement(\"mail_idle_more\");disableElement(\"mail_idle_less\");disableElement(\"mail_to_group[]\");'");
+    $criteria_tray = new XoopsFormElementTray(_AM_SENDTOUSERS, "<br /><br />");
+    $criteria_tray->addElement($group_select);
+    $criteria_tray->addElement($lastlog_min);
+    $criteria_tray->addElement($lastlog_max);
+    $criteria_tray->addElement($idle_more);
+    $criteria_tray->addElement($idle_less);
+    $criteria_tray->addElement($mailok_cbox);
+    $criteria_tray->addElement($inactive_cbox);
+    $criteria_tray->addElement($regd_min);
+    $criteria_tray->addElement($regd_max);
+    $form->addElement($criteria_tray);
+}
+
+$fname_text = new XoopsFormText(_AM_MAILFNAME, "mail_fromname", 30, 255, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
+$fromemail = !empty($xoopsConfig['adminmail']) ? $xoopsConfig['adminmail'] : $xoopsUser->getVar("email", "E");
+$femail_text = new XoopsFormText(_AM_MAILFMAIL, "mail_fromemail", 30, 255, $fromemail);
+//$subject_caption = _AM_MAILSUBJECT."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS1."<br />"._AM_MAILTAGS2."<br />"._AM_MAILTAGS3."</span>";
+$subject_caption = _AM_MAILSUBJECT."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS2."</span>";
+$subject_text = new XoopsFormText($subject_caption, "mail_subject", 50, 255);
+$body_caption = _AM_MAILBODY."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS1."<br />"._AM_MAILTAGS2."<br />"._AM_MAILTAGS3."<br />"._AM_MAILTAGS4."</span>";
+$body_text = new XoopsFormTextArea($body_caption, "mail_body", "", 10);
+$to_checkbox = new XoopsFormCheckBox(_AM_SENDTO, "mail_send_to", "mail");
+$to_checkbox->addOption("mail", _AM_EMAIL);
+$to_checkbox->addOption("pm", _AM_PM);
+$start_hidden = new XoopsFormHidden("mail_start", 0);
+$op_hidden = new XoopsFormHidden("op", "send");
+$submit_button = new XoopsFormButton("", "mail_submit", _SEND, "submit");
+
+$form->addElement($fname_text);
+$form->addElement($femail_text);
+$form->addElement($subject_text);
+$form->addElement($body_text);
+$form->addElement($to_checkbox);
+$form->addElement($op_hidden);
+$form->addElement($start_hidden);
+$form->addElement($submit_button);
+$form->setRequired($subject_text);
+$form->setRequired($body_text);
+//$form->setRequired($to_checkbox);
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/modules/system/admin/mailusers/mailusers.php 2.2.6.src/modules/system/admin/mailusers/mailusers.php
--- 2.2.3a-Final.src/modules/system/admin/mailusers/mailusers.php	2005-05-06 05:58:13.000000000 -0500
+++ 2.2.6.src/modules/system/admin/mailusers/mailusers.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: mailusers.php,v 1.9.6.4 2005/05/06 11:58:13 mithyt2 Exp $
+// $Id: mailusers.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -180,6 +180,9 @@
                         $form->addElement($group_hidden);
                     }
                 }
+                if (!empty($_POST['mail_mailok'])) {
+                    $mailok_hidden = new XoopsFormHidden("mail_mailok", 1);
+                }
                 $inactive_hidden = new XoopsFormHidden("mail_inactive", $mail_inactive);
                 $lastlog_min_hidden = new XoopsFormHidden("mail_lastlog_min", $myts->makeTboxData4PreviewInForm($_POST['mail_lastlog_min']));
                 $lastlog_max_hidden = new XoopsFormHidden("mail_lastlog_max", $myts->makeTboxData4PreviewInForm($_POST['mail_lastlog_max']));
@@ -197,6 +200,7 @@
                 $submit_button = new XoopsFormButton("", "mail_submit", _AM_SENDNEXT, "submit");
                 $sent_label = new XoopsFormLabel(_AM_SENT, sprintf(_AM_SENTNUM, $_POST['mail_start']+1, $mail_end, $added_count));
                 $form->addElement($sent_label);
+                $form->addElement($mailok_hidden);
                 $form->addElement($inactive_hidden);
                 $form->addElement($lastlog_min_hidden);
                 $form->addElement($lastlog_max_hidden);
diff -ruN 2.2.3a-Final.src/modules/system/admin/mailusers/main.php 2.2.6.src/modules/system/admin/mailusers/main.php
--- 2.2.3a-Final.src/modules/system/admin/mailusers/main.php	2003-02-12 05:37:54.000000000 -0600
+++ 2.2.6.src/modules/system/admin/mailusers/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.4 2003/02/12 11:37:54 okazu Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/mailusers/xoops_version.php 2.2.6.src/modules/system/admin/mailusers/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/mailusers/xoops_version.php	2003-02-12 05:37:54.000000000 -0600
+++ 2.2.6.src/modules/system/admin/mailusers/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:37:54 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/modulesadmin/main.php 2.2.6.src/modules/system/admin/modulesadmin/main.php
--- 2.2.3a-Final.src/modules/system/admin/modulesadmin/main.php	2005-09-18 08:41:09.000000000 -0500
+++ 2.2.6.src/modules/system/admin/modulesadmin/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.28.2.2.2.9.2.1 2005/09/18 14:41:09 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/modulesadmin/modulesadmin.php 2.2.6.src/modules/system/admin/modulesadmin/modulesadmin.php
--- 2.2.3a-Final.src/modules/system/admin/modulesadmin/modulesadmin.php	2005-09-18 08:38:41.000000000 -0500
+++ 2.2.6.src/modules/system/admin/modulesadmin/modulesadmin.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: modulesadmin.php,v 1.32.6.5.2.1 2005/09/18 14:38:41 mithyt2 Exp $
+// $Id: modulesadmin.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -173,20 +173,6 @@
                         $msgs[] = '&nbsp;&nbsp;Block <b>'.$block_arr[$i]->getVar('name').'</b> deleted. Block ID: <b>'.$block_arr[$i]->getVar('bid').'</b>';
                     }
                 }
-                // delete any left-over block templates
-                $templates =& $tplfile_handler->find(null, 'block', $module->getVar('mid'));
-                $tcount = count($templates);
-                if ($tcount > 0) {
-                    $msgs[] = 'Deleting templates...';
-                    for ($i = 0; $i < $tcount; $i++) {
-                        if (!$tplfile_handler->delete($templates[$i])) {
-                            $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete template '.$templates[$i]->getVar('tpl_file').' from the database. Template ID: <b>'.$templates[$i]->getVar('tpl_id').'</b></span>';
-                        } else {
-                            $msgs[] = '&nbsp;&nbsp;Template <b>'.$templates[$i]->getVar('tpl_file').'</b> deleted from the database. Template ID: <b>'.$templates[$i]->getVar('tpl_id').'</b>';
-                        }
-                    }
-                }
-                unset($templates);
             }
 
             // delete tables used by this module
@@ -342,7 +328,7 @@
             return $ret."</p>";
         }
         $block_handler =& xoops_gethandler('block');
-        $block_handler->updateAll('isactive', 1, new Criteria('mid', $mid));
+        $block_handler->updateAll('isactive', 0, new Criteria('mid', $mid));
         return "<p>".sprintf(_MD_AM_OKDEACT, "<b>".$module->getVar('name')."</b>")."</p>";
     }
 }
diff -ruN 2.2.3a-Final.src/modules/system/admin/modulesadmin/xoops_version.php 2.2.6.src/modules/system/admin/modulesadmin/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/modulesadmin/xoops_version.php	2003-02-12 05:37:54.000000000 -0600
+++ 2.2.6.src/modules/system/admin/modulesadmin/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:37:54 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/preferences/main.php 2.2.6.src/modules/system/admin/preferences/main.php
--- 2.2.3a-Final.src/modules/system/admin/preferences/main.php	2005-09-19 11:10:07.000000000 -0500
+++ 2.2.6.src/modules/system/admin/preferences/main.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.24.6.17.2.1 2005/09/19 17:10:07 mithyt2 Exp $
+// $Id: main.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -36,7 +36,7 @@
 
     if ($op == 'list') {
         $gperm_handler =& xoops_gethandler('groupperm');
-        $admin_mids =& $gperm_handler->getItemIds('module_admin', $xoopsUser->getGroups());
+        $admin_mids = $gperm_handler->getItemIds('module_admin', $xoopsUser->getGroups());
         if ($gperm_handler->checkRight('system_admin', XOOPS_SYSTEM_PREF, $xoopsUser->getGroups())) {
             array_push($admin_mids, 1);
         }
@@ -50,7 +50,7 @@
         }
 
         $module_handler =& xoops_gethandler('module');
-        $modules =& $module_handler->getList(new Criteria('mid', "(".implode(',', array_keys($modcats)).")", 'IN'));
+        $modules = $module_handler->getList(new Criteria('mid', "(".implode(',', array_keys($modcats)).")", 'IN'));
 
         foreach (array_keys($modules) as $modid) {
             $modcats[$modid]['module'] = $modules[$modid];
@@ -131,7 +131,7 @@
                 break;
                 case 'select':
                 $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
-                $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+                $options = $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
                 $opcount = count($options);
                 for ($j = 0; $j < $opcount; $j++) {
                     $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
@@ -237,7 +237,7 @@
                 $module_handler =& xoops_gethandler('module');
                 $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
                 $criteria->add(new Criteria('isactive', 1));
-                $moduleslist =& $module_handler->getList($criteria, true);
+                $moduleslist = $module_handler->getList($criteria, true);
                 $moduleslist['--'] = _MD_AM_NONE;
                 $ele->addOptionArray($moduleslist);
                 break;
@@ -368,8 +368,22 @@
                         $startmod_updated = true;
                     }
 
+                    if (empty($censor_words_updated) && $config->getVar('conf_catid') == XOOPS_CONF_CENSOR && $config->getVar('conf_name') == 'censor_words') {
+        				$ts =& MyTextSanitizer::getInstance();
+						if (!isset($ts->censorConf)) {
+							$ts->censorConf =& $config_handler->getConfigsByCat(XOOPS_CONF_CENSOR);
+						}
+	                    $censor_enable_original = $ts->censorConf['censor_enable'];
+	                    $ts->censorConf['censor_enable'] = 0;
+	                    $censor_words_updated = true;
+	                    $censor_enable_set = true;
+                    }
                     $config->setConfValueForInput($new_value);
                     $config_handler->insertConfig($config);
+                    if(!empty($censor_enable_set)){
+	                    $ts->censorConf['censor_enable'] == $censor_enable_original;
+	                    $censor_enable_set = false;
+                    }
                 }
                 unset($new_value);
             }
diff -ruN 2.2.3a-Final.src/modules/system/admin/preferences/xoops_version.php 2.2.6.src/modules/system/admin/preferences/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/preferences/xoops_version.php	2003-02-12 05:38:41.000000000 -0600
+++ 2.2.6.src/modules/system/admin/preferences/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:38:41 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/smilies/main.php 2.2.6.src/modules/system/admin/smilies/main.php
--- 2.2.3a-Final.src/modules/system/admin/smilies/main.php	2005-05-07 10:46:03.000000000 -0500
+++ 2.2.6.src/modules/system/admin/smilies/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.5.6.4 2005/05/07 16:46:03 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/smilies/smileform.php 2.2.6.src/modules/system/admin/smilies/smileform.php
--- 2.2.3a-Final.src/modules/system/admin/smilies/smileform.php	2005-03-25 07:06:10.000000000 -0600
+++ 2.2.6.src/modules/system/admin/smilies/smileform.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: smileform.php,v 1.5.22.1 2005/03/25 13:06:10 mithyt2 Exp $
+// $Id: smileform.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/smilies/smilies.php 2.2.6.src/modules/system/admin/smilies/smilies.php
--- 2.2.3a-Final.src/modules/system/admin/smilies/smilies.php	2005-09-18 08:36:28.000000000 -0500
+++ 2.2.6.src/modules/system/admin/smilies/smilies.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,123 +1,122 @@
-<?php
-// $Id: smilies.php,v 1.6.6.1.2.1 2005/09/18 14:36:28 mithyt2 Exp $
-//  ------------------------------------------------------------------------ //
-//                XOOPS - PHP Content Management System                      //
-//                    Copyright (c) 2000 XOOPS.org                           //
-//                       <http://www.xoops.org/>                             //
-//  ------------------------------------------------------------------------ //
-//  This program 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.                                      //
-//                                                                           //
-//  You may not change or alter any portion of this comment or credits       //
-//  of supporting developers from this source code or any supporting         //
-//  source code which is considered copyrighted (c) material of the          //
-//  original comment or credit authors.                                      //
-//                                                                           //
-//  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.                             //
-//                                                                           //
-//  You should have received a copy of the GNU General Public License        //
-//  along with this program; if not, write to the Free Software              //
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
-//  ------------------------------------------------------------------------ //
-// Author: Kazumi Ono (AKA onokazu)                                          //
-// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
-// Project: The XOOPS Project                                                //
-// ------------------------------------------------------------------------- //
-
-if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
-    exit("Access Denied");
-}
-
-function SmilesAdmin()
-{
-    $db =& Database::getInstance();
-    $url_smiles = XOOPS_UPLOAD_URL;
-    $myts =& MyTextSanitizer::getInstance();
-    xoops_cp_header();
-    echo "<h4 style='text-align:left;'>"._AM_SMILESCONTROL."</h4>";
-
-    if ($getsmiles = $db->query("SELECT * FROM ".$db->prefix("smiles"))) {
-        if (($numsmiles = $db->getRowsNum($getsmiles)) == "0") {
-            //EMPTY
-        } else {
-            echo '<form action="admin.php" method="post"><table width="100%" class="outer" cellpadding="4" cellspacing="1">';
-            echo "<tr align='center'><th align='left'>" ._AM_CODE."</th>";
-            echo "<th>" ._AM_SMILIE."</th>";
-            echo "<th>"._AM_SMILEEMOTION."</th>";
-            echo "<th>" ._AM_DISPLAYF."</th>";
-            echo "<th>"._AM_ACTION."</th>";
-            echo "</tr>\n";
-            $i = 0;
-            while ($smiles = $db->fetchArray($getsmiles)) {
-                if ($i % 2 == 0) {
-                    $class = 'even';
-                } else {
-                    $class= 'odd';
-                }
-                $smiles['code'] = $myts->makeTboxData4Show($smiles['code']);
-                $smiles['smile_url'] = $myts->makeTboxData4Edit($smiles['smile_url']);
-                $smiles['smile_emotion'] = $myts->makeTboxData4Edit($smiles['emotion']);
-                echo "<tr align='center' class='$class'>";
-                echo "<td align='left'>".$smiles['code']."</td>";
-                echo "<td><img src='".$url_smiles."/".$smiles['smile_url']."' alt='' /></td>";
-                echo '<td>'.$smiles['smile_emotion'].'</td>';
-                echo '<td><input type="hidden" name="smile_id['.$i.']" value="'.$smiles['id'].'" /><input type="hidden" name="old_display['.$i.']" value="'.$smiles['display'].'" /><input type="checkbox" value="1" name="smile_display['.$i.']"';
-                if ($smiles['display'] == 1) {
-                    echo ' checked="checked"';
-                }
-                echo "</td><td><a href='admin.php?fct=smilies&amp;op=SmilesEdit&amp;id=".$smiles['id']."'>" ._AM_EDIT."</a>&nbsp;";
-                echo "<a href='admin.php?fct=smilies&amp;op=SmilesDel&amp;id=".$smiles['id']."'>" ._AM_DEL."</a></td>";
-                echo "</tr>\n";
-                $i++;
-            }
-            echo '<tr><td class="foot" colspan="5" align="center"><input type="hidden" name="op" value="SmilesUpdate" /><input type="hidden" name="fct" value="smilies" />'.$GLOBALS['xoopsSecurity']->getTokenHTML().'<input type="submit" value="'._SUBMIT.'" /></tr></table></form>';
-        }
-    } else {
-        echo _AM_CNRFTSD;
-    }
-    $smiles['smile_code'] = '';
-    $smiles['smile_url'] = 'blank.gif';
-    $smiles['smile_desc'] = '';
-    $smiles['smile_display'] = 1;
-    $smiles['smile_form'] = _AM_ADDSMILE;
-    $smiles['op'] = 'SmilesAdd';
-    $smiles['id'] = '';
-    include XOOPS_ROOT_PATH.'/modules/system/admin/smilies/smileform.php';
-    $smile_form->display();
-    xoops_cp_footer();
-}
-
-function SmilesEdit($id)
-{
-    $db =& Database::getInstance();
-    $myts =& MyTextSanitizer::getInstance();
-    xoops_cp_header();
-    echo '<a href="admin.php?fct=smilies">'._AM_SMILESCONTROL .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._AM_EDITSMILE.'<br /><br />';
-    if ($getsmiles = $db->query("SELECT * FROM ".$db->prefix("smiles")." WHERE id = $id")) {
-        $numsmiles = $db->getRowsNum($getsmiles);
-        if ( $numsmiles == 0 ) {
-            //EMPTY
-        } else {
-            if ($smiles = $db->fetchArray($getsmiles)) {
-                $smiles['smile_code'] = $myts->makeTboxData4Edit($smiles['code']);
-                $smiles['smile_url'] = $myts->makeTboxData4Edit($smiles['smile_url']);
-                $smiles['smile_desc'] = $myts->makeTboxData4Edit($smiles['emotion']);
-                $smiles['smile_display'] = $smiles['display'];
-                $smiles['smile_form'] = _AM_EDITSMILE;
-                $smiles['op'] = 'SmilesSave';
-                include XOOPS_ROOT_PATH.'/modules/system/admin/smilies/smileform.php';
-                $smile_form->addElement(new XoopsFormHidden('old_smile', $smiles['smile_url']));
-                $smile_form->display();
-            }
-        }
-    } else {
-        echo _AM_CNRFTSD;
-    }
-    xoops_cp_footer();
-}
+<?php
+// $Id: smilies.php 185 2006-01-22 23:49:01Z skalpa $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  This program 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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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.                             //
+//                                                                           //
+//  You should have received a copy of the GNU General Public License        //
+//  along with this program; if not, write to the Free Software              //
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+function SmilesAdmin()
+{
+    $db =& Database::getInstance();
+    $url_smiles = XOOPS_UPLOAD_URL;
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    echo "<h4 style='text-align:left;'>"._AM_SMILESCONTROL."</h4>";
+
+    if ($getsmiles = $db->query("SELECT * FROM ".$db->prefix("smiles"))) {
+        if (($numsmiles = $db->getRowsNum($getsmiles)) == "0") {
+            //EMPTY
+        } else {
+            echo '<form action="admin.php" method="post"><table width="100%" class="outer" cellpadding="4" cellspacing="1">';
+            echo "<tr align='center'><th align='left'>" ._AM_CODE."</th>";
+            echo "<th>" ._AM_SMILIE."</th>";
+            echo "<th>"._AM_SMILEEMOTION."</th>";
+            echo "<th>" ._AM_DISPLAYF."</th>";
+            echo "<th>"._AM_ACTION."</th>";
+            echo "</tr>\n";
+            $i = 0;
+            while ($smiles = $db->fetchArray($getsmiles)) {
+                if ($i % 2 == 0) {
+                    $class = 'even';
+                } else {
+                    $class= 'odd';
+                }
+                $smiles['code'] = $myts->makeTboxData4Show($smiles['code']);
+                $smiles['smile_url'] = $myts->makeTboxData4Edit($smiles['smile_url']);
+                $smiles['smile_emotion'] = $myts->makeTboxData4Edit($smiles['emotion']);
+                echo "<tr align='center' class='$class'>";
+                echo "<td align='left'>".$smiles['code']."</td>";
+                echo "<td><img src='".$url_smiles."/".$smiles['smile_url']."' alt='' /></td>";
+                echo '<td>'.$smiles['smile_emotion'].'</td>';
+                echo '<td><input type="hidden" name="smile_id['.$i.']" value="'.$smiles['id'].'" /><input type="hidden" name="old_display['.$i.']" value="'.$smiles['display'].'" /><input type="checkbox" value="1" name="smile_display['.$i.']"';
+                if ($smiles['display'] == 1) {
+                    echo ' checked="checked"';
+                }
+                echo " /></td><td><a href='admin.php?fct=smilies&amp;op=SmilesEdit&amp;id=".$smiles['id']."'>" ._AM_EDIT."</a>&nbsp;";
+                echo "<a href='admin.php?fct=smilies&amp;op=SmilesDel&amp;id=".$smiles['id']."'>" ._AM_DEL."</a></td>";
+                echo "</tr>\n";
+                $i++;
+            }
+            echo '<tr><td class="foot" colspan="5" align="center"><input type="hidden" name="op" value="SmilesUpdate" /><input type="hidden" name="fct" value="smilies" />'.$GLOBALS['xoopsSecurity']->getTokenHTML().'<input type="submit" value="'._SUBMIT.'" /></tr></table></form>';
+        }
+    } else {
+        echo _AM_CNRFTSD;
+    }
+    $smiles['smile_code'] = '';
+    $smiles['smile_url'] = 'blank.gif';
+    $smiles['smile_desc'] = '';
+    $smiles['smile_display'] = 1;
+    $smiles['smile_form'] = _AM_ADDSMILE;
+    $smiles['op'] = 'SmilesAdd';
+    $smiles['id'] = '';
+    include XOOPS_ROOT_PATH.'/modules/system/admin/smilies/smileform.php';
+    $smile_form->display();
+    xoops_cp_footer();
+}
+
+function SmilesEdit($id)
+{
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    echo '<a href="admin.php?fct=smilies">'._AM_SMILESCONTROL .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._AM_EDITSMILE.'<br /><br />';
+    if ($getsmiles = $db->query("SELECT * FROM ".$db->prefix("smiles")." WHERE id = $id")) {
+        $numsmiles = $db->getRowsNum($getsmiles);
+        if ( $numsmiles == 0 ) {
+            //EMPTY
+        } else {
+            if ($smiles = $db->fetchArray($getsmiles)) {
+                $smiles['smile_code'] = $myts->makeTboxData4Edit($smiles['code']);
+                $smiles['smile_url'] = $myts->makeTboxData4Edit($smiles['smile_url']);
+                $smiles['smile_desc'] = $myts->makeTboxData4Edit($smiles['emotion']);
+                $smiles['smile_display'] = $smiles['display'];
+                $smiles['smile_form'] = _AM_EDITSMILE;
+                $smiles['op'] = 'SmilesSave';
+                include XOOPS_ROOT_PATH.'/modules/system/admin/smilies/smileform.php';
+                $smile_form->addElement(new XoopsFormHidden('old_smile', $smiles['smile_url']));
+                $smile_form->display();
+            }
+        }
+    } else {
+        echo _AM_CNRFTSD;
+    }
+    xoops_cp_footer();
+}
 ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/modules/system/admin/smilies/xoops_version.php 2.2.6.src/modules/system/admin/smilies/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/smilies/xoops_version.php	2003-02-12 05:38:41.000000000 -0600
+++ 2.2.6.src/modules/system/admin/smilies/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:38:41 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/tplsets/main.php 2.2.6.src/modules/system/admin/tplsets/main.php
--- 2.2.3a-Final.src/modules/system/admin/tplsets/main.php	2005-09-18 08:35:23.000000000 -0500
+++ 2.2.6.src/modules/system/admin/tplsets/main.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.9.4.2.2.7.2.1 2005/09/18 14:35:23 mithyt2 Exp $
+// $Id: main.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -87,11 +87,12 @@
                 echo '<ul>';
                 foreach ($tplstats as $moddir => $filecount) {
                     $module =& $module_handler->getByDirname($moddir);
-                    if ($installed_mods[$moddir] > $filecount) {
-                        $filecount = '<span style="color:#ff0000;">'.$filecount.'</span>';
+                    if ( is_object ( $module ) ) {
+                        if ($installed_mods[$moddir] > $filecount) {
+                            $filecount = '<span style="color:#ff0000;">'.$filecount.'</span>';
+                        }
+                        echo '<li>'.$module->getVar('name').' [<a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.$tplsetname.'&amp;moddir='.$moddir.'">'._LIST.'</a> (<b>'.$filecount.'</b>)]</li>';
                     }
-                    $modulename = is_object($module) ? $module->getVar('name') : $moddir;
-                    echo '<li>'.$modulename.' [<a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.$tplsetname.'&amp;moddir='.$moddir.'">'._LIST.'</a> (<b>'.$filecount.'</b>)]</li>';
                     unset($module);
                 }
                 $not_installed = array_diff(array_keys($installed_mods), array_keys($tplstats));
@@ -100,9 +101,9 @@
             }
             foreach ($not_installed as $ni) {
                 $module =& $module_handler->getByDirname($ni);
-                $modname = is_object($module) ? $module->getVar('name') : $ni;
-                    
-                echo '<li>'.$modname.' [<a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.$tplsetname.'&amp;moddir='.$ni.'">'._LIST.'</a> (<span style="color:#ff0000; font-weight: bold;">0</span>)] [<a href="admin.php?fct=tplsets&amp;op=generatemod&amp;tplset='.$tplsetname.'&amp;moddir='.$ni.'">'._MD_GENERATE.'</a>]</li>';
+                if ( is_object ( $module ) ) {
+                    echo '<li>'.$module->getVar('name').' [<a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.$tplsetname.'&amp;moddir='.$ni.'">'._LIST.'</a> (<span style="color:#ff0000; font-weight: bold;">0</span>)] [<a href="admin.php?fct=tplsets&amp;op=generatemod&amp;tplset='.$tplsetname.'&amp;moddir='.$ni.'">'._MD_GENERATE.'</a>]</li>';
+                }
             }
             echo '</ul></td><td>';
             echo '[<a href="admin.php?fct=tplsets&amp;op=download&amp;method=tar&amp;tplset='.$tplsetname.'">'._MD_DOWNLOAD.'</a>]<br />[<a href="admin.php?fct=tplsets&amp;op=clone&amp;tplset='.$tplsetname.'">'._CLONE.'</a>]';
@@ -197,7 +198,7 @@
             foreach ($notinst_files as $nfile) {
                 if ($nfile != 'index.html') {
                     echo  '<tr><td style="background-color:#FFFF99; padding: 5px;">'.$nfile.'</td><td style="background-color:#FFFF99; padding: 5px;">&nbsp;</td><td style="background-color:#FFFF99; padding: 5px;">';
-                    $physical_file = XOOPS_ROOT_PATH.'/templates/'.$tplset.'/'.$moddir.'/'.$nfile;
+                    $physical_file = XOOPS_ROOT_PATH.'/themes/'.$tplset.'/templates/'.$moddir.'/'.$nfile;
                     if (file_exists($physical_file)) {
                         echo '[<a href="admin.php?fct=tplsets&amp;moddir='.$moddir.'&amp;tplset='.$tplset.'&amp;op=importtpl&amp;file='.urlencode($nfile).'">'._MD_IMPORT.'</a>]';
                     } else {
@@ -227,7 +228,7 @@
             }
             echo  '<tr class="'.$class.'"><td class="head"><span style="font-weight:bold;">'.$btemplates[$j]->getVar('tpl_file').'</span><br /><br /><span style="font-weight:normal;">'.$btemplates[$j]->getVar('tpl_desc').'</span></td><td>'.formatTimestamp($last_modified, 'l').'</td>';
             $filename = $btemplates[$j]->getVar('tpl_file');
-            $physical_file = XOOPS_ROOT_PATH.'/templates/'.$tplset.'/'.$moddir.'/blocks/'.$filename;
+            $physical_file = XOOPS_ROOT_PATH.'/themes/'.$tplset.'/templates/'.$moddir.'/blocks/'.$filename;
             if ($tplset != 'default') {
                 if (file_exists($physical_file)) {
                     $mtime = filemtime($physical_file);
@@ -257,7 +258,7 @@
             foreach ($bnotinst_files as $nfile) {
                 if ($nfile != 'index.html') {
                     echo  '<tr style="background-color:#FFFF99;"><td style="background-color:#FFFF99; padding: 5px;">'.$nfile.'</td><td style="background-color:#FFFF99; padding: 5px;">&nbsp;</td><td style="background-color:#FFFF99; padding: 5px;">';
-                    $physical_file = XOOPS_ROOT_PATH.'/templates/'.$tplset.'/'.$moddir.'/blocks/'.$nfile;
+                    $physical_file = XOOPS_ROOT_PATH.'/themes/'.$tplset.'/templates/'.$moddir.'/blocks/'.$nfile;
                     if (file_exists($physical_file)) {
                         echo '[<a href="admin.php?fct=tplsets&amp;moddir='.$moddir.'&amp;tplset='.$tplset.'&amp;op=importtpl&amp;file='.urlencode($nfile).'">'._MD_IMPORT.'</a>]';
                     } else {
@@ -409,9 +410,9 @@
             if (count($tplsets) > 0 && is_object($tplsets[0])) {
                 $msgs[] = 'Deleting template set data...';
                 if (!$tplset_handler->delete($tplsets[0])) {
-                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Template set '.$tplset.' could not be deleted.</span>';
+                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Template set '.htmlspecialchars($tplset, ENT_QUOTES).' could not be deleted.</span>';
                 } else {
-                    $msgs[] = '&nbsp;&nbsp;Template set data removed from the database.';
+                    $msgs[] = '&nbsp;&nbsp;Template set data <b>'.htmlspecialchars($tplset, ENT_QUOTES).'</b> removed from the database.';
                 }
             }
         } else {
@@ -457,7 +458,7 @@
             $tplsetobj->setVar('tplset_name', $newtheme);
             $tplsetobj->setVar('tplset_created', time());
             if (!$tplset_handler->insert($tplsetobj)) {
-                $msgs[] = '<span style="color:#ff0000;">ERROR: Could not create template set <b>'.$newtheme.'</b>.</span><br />';
+                $msgs[] = '<span style="color:#ff0000;">ERROR: Could not create template set <b>'.htmlspecialchars($newtheme, ENT_QUOTES).'</b>.</span><br />';
             } else {
                 $tplsetid = $tplsetobj->getVar('tplset_id');
                 $templates =& $tpltpl_handler->getObjects(new Criteria('tpl_tplset', $tplset), true);
@@ -503,7 +504,7 @@
         <head>
         <meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" />
         <meta http-equiv="content-language" content="'._LANGCODE.'" />
-        <title>'.$xoopsConfig['sitename'].' Administration</title>
+        <title>'.htmlspecialchars($xoopsConfig['sitename']).' Administration</title>
         <link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/xoops.css" />
             <link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/system/style.css" />
         </head><body>';
@@ -560,7 +561,7 @@
         $id = intval($_GET['id']);
         $tpl =& $tpltpl_handler->get($id);
         xoops_cp_header();
-        echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;<a href="./admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$tpl->getVar('tpl_module').'&amp;tplset='.$tpl->getVar('tpl_tplset').'">'.$tpl->getVar('tpl_tplset').'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._MD_UPLOAD.'<br /><br />';
+        echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;<a href="./admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$tpl->getVar('tpl_module').'&amp;tplset='.urlencode($tpl->getVar('tpl_tplset')).'">'.$tpl->getVar('tpl_tplset').'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._MD_UPLOAD.'<br /><br />';
         if (is_object($tpl)) {
             include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
             $form = new XoopsThemeForm(_MD_UPLOAD, 'tplupload_form', 'admin.php', 'post', true);
@@ -821,7 +822,7 @@
             flush();
             unset($newtpl);
         }
-        unset($files);
+        unset($tplfiles);
         $tplfiles =& $tpltpl_handler->find('default', 'block', null, $moddir, null, true);
         $fcount = count($tplfiles);
         if ($fcount > 0) {
@@ -845,7 +846,7 @@
             flush();
             unset($newtpl);
         }
-        echo '<br />Module template files for template set <b>'.$tplset.'</b> generated and installed.<br /></code><br /><a href="admin.php?fct=tplsets">'._MD_AM_BTOTADMIN.'</a>';
+        echo '<br />Module template files for template set <b>'.htmlspecialchars($tplset, ENT_QUOTES).'</b> generated and installed.<br /></code><br /><a href="admin.php?fct=tplsets">'._MD_AM_BTOTADMIN.'</a>';
         xoops_cp_footer();
         break;
     case 'uploadtar_go':
@@ -882,19 +883,21 @@
                 }
                 if ($tplset_name == '') {
                     echo '<span style="color:#ff0000;">ERROR: Template file not found</span><br />';
+                } elseif  (preg_match('/['.preg_quote('\/:*?"<>|','/').']/', $tplset_name)) {
+                    echo '<span style="color:#ff0000;">ERROR: Invalid Template Set Name</span><br />';
                 } else {
                     $tplset_handler =& xoops_gethandler('tplset');
                     if ($tplset_handler->getCount(new Criteria('tplset_name', $tplset_name)) > 0) {
-                        echo '<span style="color:#ff0000;">ERROR: Template set <b>'.$tplset_name.'</b> already exists.</span><br />';
+                        echo '<span style="color:#ff0000;">ERROR: Template set <b>'.htmlspecialchars($tplset_name, ENT_QUOTES).'</b> already exists.</span><br />';
                     } else {
                         $tplset =& $tplset_handler->create();
                         $tplset->setVar('tplset_name', $tplset_name);
                         $tplset->setVar('tplset_created', time());
                         if (!$tplset_handler->insert($tplset)) {
-                            echo '<span style="color:#ff0000;">ERROR: Could not create template set <b>'.$tplset_name.'</b>.</span><br />';
+                            echo '<span style="color:#ff0000;">ERROR: Could not create template set <b>'.htmlspecialchars($tplset_name, ENT_QUOTES).'</b>.</span><br />';
                         } else {
                             $tplsetid = $tplset->getVar('tplset_id');
-                            echo 'Template set <b>'.$tplset_name.'</b> created. (ID: <b>'.$tplsetid.'</b>)</span><br />';
+                            echo 'Template set <b>'.htmlspecialchars($tplset_name, ENT_QUOTES).'</b> created. (ID: <b>'.$tplsetid.'</b>)</span><br />';
                             $tpltpl_handler = xoops_gethandler('tplfile');
                             $themeimages = array();
                             foreach ($tar->files as $id => $info) {
@@ -934,9 +937,9 @@
                                     echo '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not create image set.</span><br />';
                                 } else {
                                     $newimgsetid = $imgset->getVar('imgset_id');
-                                    echo '&nbsp;&nbsp;Image set <b>'.$tplset_name.'</b> created. (ID: <b>'.$newimgsetid.'</b>)<br />';
+                                    echo '&nbsp;&nbsp;Image set <b>'.htmlspecialchars($tplset_name, ENT_QUOTES).'</b> created. (ID: <b>'.$newimgsetid.'</b>)<br />';
                                     if (!$imageset_handler->linktplset($newimgsetid, $tplset_name)) {
-                                        echo '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Failed linking image set to template set <b>'.$tplset_name.'</b></span><br />';
+                                        echo '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Failed linking image set to template set <b>'.htmlspecialchars($tplset_name, ENT_QUOTES).'</b></span><br />';
                                     }
                                     $image_handler =& xoops_gethandler('imagesetimg');
                                     for ($i = 0; $i < $icount; $i++) {
@@ -1000,7 +1003,7 @@
             $tform = array('tpl_tplset' => $tplset, 'tpl_id' => $id, 'tpl_file' => $tplfile->getVar('tpl_file'), 'tpl_desc' => $tplfile->getVar('tpl_desc'), 'tpl_lastmodified' => $tplfile->getVar('tpl_lastmodified'), 'tpl_source' => htmlspecialchars($html, ENT_QUOTES), 'tpl_module' => $moddir);
             include_once XOOPS_ROOT_PATH.'/modules/system/admin/tplsets/tplform.php';
             xoops_cp_header();
-            echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;<a href="./admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$moddir.'&amp;tplset='.$tplset.'">'.$tplset.'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._MD_EDITTEMPLATE.'<br /><br />';
+            echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;<a href="./admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$moddir.'&amp;tplset='.urlencode($tplset).'">'.htmlspecialchars($tplset, ENT_QUOTES).'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._MD_EDITTEMPLATE.'<br /><br />';
             $form->display();
             xoops_cp_footer();
             echo '<script type="text/javascript">
@@ -1083,7 +1086,7 @@
         foreach ($msg as $m) {
             echo $m.'<br />';
         }
-        echo '</code><br /><a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.$tplset.'&amp;moddir='.$moddir.'">'._MD_AM_BTOTADMIN.'</a>';
+        echo '</code><br /><a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.urlencode($tplset).'&amp;moddir='.$moddir.'">'._MD_AM_BTOTADMIN.'</a>';
         xoops_cp_footer();
         break;
     case 'importtpl':
@@ -1111,10 +1114,10 @@
         if (is_object($tplfile)) {
             switch ($tplfile->getVar('tpl_type')) {
                 case 'module':
-                    $filepath = XOOPS_ROOT_PATH.'/templates/'.$tplset.'/'.$tplfile->getVar('tpl_module').'/'.$tplfile->getVar('tpl_file');
+                    $filepath = XOOPS_ROOT_PATH.'/themes/'.$tplset.'/templates/'.$tplfile->getVar('tpl_module').'/'.$tplfile->getVar('tpl_file');
                     break;
                 case 'block':
-                    $filepath = XOOPS_ROOT_PATH.'/templates/'.$tplset.'/'.$tplfile->getVar('tpl_module').'/blocks/'.$tplfile->getVar('tpl_file');
+                    $filepath = XOOPS_ROOT_PATH.'/themes/'.$tplset.'/templates/'.$tplfile->getVar('tpl_module').'/blocks/'.$tplfile->getVar('tpl_file');
                     break;
                 default:
                     break;
@@ -1137,7 +1140,7 @@
         if (false != $error) {
             xoops_cp_header();
             xoops_error('Could not import file '.$filepath);
-            echo '<br /><a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.$tplset.'&amp;moddir='.$moddir.'">'._MD_AM_BTOTADMIN.'</a>';
+            echo '<br /><a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.urlencode($tplset).'&amp;moddir='.$moddir.'">'._MD_AM_BTOTADMIN.'</a>';
             xoops_cp_footer();
             exit();
         }
diff -ruN 2.2.3a-Final.src/modules/system/admin/tplsets/themeimgform.php 2.2.6.src/modules/system/admin/tplsets/themeimgform.php
--- 2.2.3a-Final.src/modules/system/admin/tplsets/themeimgform.php	2003-03-01 10:11:00.000000000 -0600
+++ 2.2.6.src/modules/system/admin/tplsets/themeimgform.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: themeimgform.php,v 1.1 2003/03/01 16:11:00 okazu Exp $
+// $Id: themeimgform.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -35,7 +35,7 @@
 	if ($icount > 0) {
 		echo '<form action="admin.php" method="post" enctype="multipart/form-data"><table width="100%" class="outer" cellspacing="1"><tr><th colspan="3">'._MD_EDITSKINIMG.'</th></tr>';
 		for ($i = 0; $i < $icount; $i++) {
-			echo '<tr><td rowspan="3" valign="middle" align="center" class="odd"><img src="admin.php?fct=tplsets&op=showimage&id='.$imgs[$i]->getVar('imgsetimg_id').'" alt="" /></td><td class="head">'._MD_IMGFILE.'</td><td class="even">'.$imgs[$i]->getVar('imgsetimg_file').'</td></tr><tr><td class="head">'._MD_IMGNEWFILE.'</td><td class="even"><input type="file" name="imgfiles['.$imgs[$i]->getVar('imgsetimg_id').']" /></td></tr><tr><td class="head">'._MD_IMGDELETE.'</td><td class="even"><input type="checkbox" name="imgdelete['.$imgs[$i]->getVar('imgsetimg_id').']" value="1" /><input type="hidden" name="imgids[]" value="'.$imgs[$i]->getVar('imgsetimg_id').'" /></td></tr>';
+			echo '<tr><td rowspan="3" valign="middle" align="center" class="odd"><img src="admin.php?fct=tplsets&amp;op=showimage&amp;id='.$imgs[$i]->getVar('imgsetimg_id').'" alt="" /></td><td class="head">'._MD_IMGFILE.'</td><td class="even">'.$imgs[$i]->getVar('imgsetimg_file').'</td></tr><tr><td class="head">'._MD_IMGNEWFILE.'</td><td class="even"><input type="file" name="imgfiles['.$imgs[$i]->getVar('imgsetimg_id').']" /></td></tr><tr><td class="head">'._MD_IMGDELETE.'</td><td class="even"><input type="checkbox" name="imgdelete['.$imgs[$i]->getVar('imgsetimg_id').']" value="1" /><input type="hidden" name="imgids[]" value="'.$imgs[$i]->getVar('imgsetimg_id').'" /></td></tr>';
 		}
 		echo '<tr class="foot"><td colspan="3" align="center"><input type="hidden" name="tplset" value="'.$tplset.'" /><input type="hidden" name="op" value="updateimage" /><input type="hidden" name="fct" value="tplsets" /><input type="hidden" name="imgset" value="'.$imgs[0]->getVar('imgsetimg_imgset').'" /><input type="submit" name="imgsubmit" value="'._SUBMIT.'" /></td></tr></table></form>';
 	}
@@ -49,7 +49,7 @@
 } else {
 	echo '<table width="100%" class="outer" cellspacing="1"><tr><th colspan="3">'._MD_SKINIMGS.'</th></tr>';
 	for ($i = 0; $i < $icount; $i++) {
-		echo '<tr><td valign="middle" align="center" class="odd"><img src="admin.php?fct=tplsets&op=showimage&id='.$imgs[$i]->getVar('imgsetimg_id').'" alt="" /></td><td class="head">'._MD_IMGFILE.'</td><td class="even">'.$imgs[$i]->getVar('imgsetimg_file').'</td></tr>';
+		echo '<tr><td valign="middle" align="center" class="odd"><img src="admin.php?fct=tplsets&amp;op=showimage&amp;id='.$imgs[$i]->getVar('imgsetimg_id').'" alt="" /></td><td class="head">'._MD_IMGFILE.'</td><td class="even">'.$imgs[$i]->getVar('imgsetimg_file').'</td></tr>';
 	}
 	echo '</table>';
 }
diff -ruN 2.2.3a-Final.src/modules/system/admin/tplsets/tplform.php 2.2.6.src/modules/system/admin/tplsets/tplform.php
--- 2.2.3a-Final.src/modules/system/admin/tplsets/tplform.php	2005-03-25 07:06:11.000000000 -0600
+++ 2.2.6.src/modules/system/admin/tplsets/tplform.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: tplform.php,v 1.1.26.1 2005/03/25 13:06:11 mithyt2 Exp $
+// $Id: tplform.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/tplsets/xoops_version.php 2.2.6.src/modules/system/admin/tplsets/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/tplsets/xoops_version.php	2003-03-01 10:11:00.000000000 -0600
+++ 2.2.6.src/modules/system/admin/tplsets/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.1 2003/03/01 16:11:00 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/userrank/main.php 2.2.6.src/modules/system/admin/userrank/main.php
--- 2.2.3a-Final.src/modules/system/admin/userrank/main.php	2005-05-07 10:46:03.000000000 -0500
+++ 2.2.6.src/modules/system/admin/userrank/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.7.6.3 2005/05/07 16:46:03 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/userrank/rankform.php 2.2.6.src/modules/system/admin/userrank/rankform.php
--- 2.2.3a-Final.src/modules/system/admin/userrank/rankform.php	2005-03-25 07:06:11.000000000 -0600
+++ 2.2.6.src/modules/system/admin/userrank/rankform.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: rankform.php,v 1.9.22.1 2005/03/25 13:06:11 mithyt2 Exp $
+// $Id: rankform.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/userrank/userrank.php 2.2.6.src/modules/system/admin/userrank/userrank.php
--- 2.2.3a-Final.src/modules/system/admin/userrank/userrank.php	2005-03-25 07:06:11.000000000 -0600
+++ 2.2.6.src/modules/system/admin/userrank/userrank.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: userrank.php,v 1.9.6.1 2005/03/25 13:06:11 mithyt2 Exp $
+// $Id: userrank.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/userrank/xoops_version.php 2.2.6.src/modules/system/admin/userrank/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/userrank/xoops_version.php	2003-02-12 05:38:41.000000000 -0600
+++ 2.2.6.src/modules/system/admin/userrank/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:38:41 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/version/main.php 2.2.6.src/modules/system/admin/version/main.php
--- 2.2.3a-Final.src/modules/system/admin/version/main.php	2005-03-25 07:06:17.000000000 -0600
+++ 2.2.6.src/modules/system/admin/version/main.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: main.php,v 1.6.6.1 2005/03/25 13:06:17 mithyt2 Exp $
+// $Id: main.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin/version/xoops_version.php 2.2.6.src/modules/system/admin/version/xoops_version.php
--- 2.2.3a-Final.src/modules/system/admin/version/xoops_version.php	2003-02-12 05:38:41.000000000 -0600
+++ 2.2.6.src/modules/system/admin/version/xoops_version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.4 2003/02/12 11:38:41 okazu Exp $
+// $Id: xoops_version.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/admin.php 2.2.6.src/modules/system/admin.php
--- 2.2.3a-Final.src/modules/system/admin.php	2005-04-23 03:55:44.000000000 -0500
+++ 2.2.6.src/modules/system/admin.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: admin.php,v 1.8.6.3 2005/04/23 09:55:44 mithyt2 Exp $
+// $Id: admin.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -93,7 +93,7 @@
 	$all_ok = false;
 	if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
 		$sysperm_handler =& xoops_gethandler('groupperm');
-		$ok_syscats =& $sysperm_handler->getItemIds('system_admin', $groups);
+		$ok_syscats = $sysperm_handler->getItemIds('system_admin', $groups);
 	} else {
 		$all_ok = true;
 	}
diff -ruN 2.2.3a-Final.src/modules/system/blocks/system_blocks.php 2.2.6.src/modules/system/blocks/system_blocks.php
--- 2.2.3a-Final.src/modules/system/blocks/system_blocks.php	2005-10-27 19:48:15.000000000 -0500
+++ 2.2.6.src/modules/system/blocks/system_blocks.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: system_blocks.php,v 1.43.4.1.2.14.2.2 2005/10/28 01:48:15 skalpa Exp $
+// $Id: system_blocks.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -84,7 +84,7 @@
     } else {
         $online_handler->write($uid, $uname, time(), 0, $_SERVER['REMOTE_ADDR']);
     }
-    $onlines =& $online_handler->getAll();
+    $onlines = $online_handler->getAll();
     if (false != $onlines) {
         $total = count($onlines);
         $block = array();
@@ -117,7 +117,7 @@
 function b_system_login_show()
 {
     global $xoopsUser, $xoopsConfig;
-    if (!$xoopsUser) {
+    if (!is_object($xoopsUser)) {
         $block = array();
         $block['lang_username'] = _USERNAME;
         $block['unamevalue'] = "";
@@ -151,12 +151,12 @@
     $modules =& $module_handler->getObjects($criteria, true);
     $moduleperm_handler =& xoops_gethandler('groupperm');
     $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
-    $read_allowed =& $moduleperm_handler->getItemIds('module_read', $groups);
+    $read_allowed = $moduleperm_handler->getItemIds('module_read', $groups);
     foreach (array_keys($modules) as $i) {
         if (in_array($i, $read_allowed)) {
             $block['modules'][$i]['name'] = $modules[$i]->getVar('name');
             $block['modules'][$i]['directory'] = $modules[$i]->getVar('dirname');
-            $sublinks =& $modules[$i]->subLink();
+            $sublinks = $modules[$i]->subLink();
             if ((count($sublinks) > 0) && (!empty($xoopsModule)) && ($i == $xoopsModule->getVar('mid'))) {
                 foreach($sublinks as $sublink){
                     $block['modules'][$i]['sublinks'][] = array('name' => $sublink['name'], 'url' => XOOPS_URL.'/modules/'.$modules[$i]->getVar('dirname').'/'.$sublink['url']);
@@ -288,7 +288,7 @@
                     $prev_caption = $userinfo['groupname'];
                     $block['groups'][$i]['name'] = $myts->htmlSpecialChars($userinfo['groupname']);
                 }
-                if ($xoopsUser != '') {
+                if (!is_object($xoopsUser)) {
                     $block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => $myts->htmlspecialchars($userinfo['name']), 'msglink' => "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/pmlite.php?send2=1&amp;to_userid=".$userinfo['uid']."','pmlite',450,370);\"><img src=\"".XOOPS_URL."/images/icons/pm_small.gif\" border=\"0\" width=\"27\" height=\"17\" alt=\"\" /></a>", 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);
                 } else {
                     if ($userinfo['user_viewemail']) {
@@ -317,7 +317,7 @@
     $criteria->setSort('user_regdate');
     $criteria->setLimit($limit);
     $member_handler =& xoops_gethandler('member');
-    $newmembers =& $member_handler->getUsers($criteria);
+    $newmembers = $member_handler->getUsers($criteria);
     $count = count($newmembers);
     for ($i = 0; $i < $count; $i++) {
         if ( $options[1] == 1 ) {
@@ -383,7 +383,7 @@
             $comment_config[$mid] = $modules[$mid]->getInfo('comments');
         }
         $com['id'] = $i;
-        $com['title'] = '<a href="'.XOOPS_URL.'/modules/'.$modules[$mid]->getVar('dirname').'/'.$comment_config[$mid]['pageName'].'?'.$comment_config[$mid]['itemName'].'='.$comments[$i]->getVar('com_itemid').'&amp;com_id='.$i.'&amp;com_rootid='.$comments[$i]->getVar('com_rootid').'&amp;'.$comments[$i]->getVar('com_exparams').'#comment'.$i.'">'.$comments[$i]->getVar('com_title').'</a>';
+        $com['title'] = '<a href="'.XOOPS_URL.'/modules/'.$modules[$mid]->getVar('dirname').'/'.$comment_config[$mid]['pageName'].'?'.$comment_config[$mid]['itemName'].'='.$comments[$i]->getVar('com_itemid').'&amp;com_id='.$i.'&amp;com_rootid='.$comments[$i]->getVar('com_rootid').'&amp;'.htmlspecialchars($comments[$i]->getVar('com_exparams')).'#comment'.$i.'">'.$comments[$i]->getVar('com_title').'</a>';
         $com['icon'] = htmlspecialchars( $comments[$i]->getVar('com_icon'), ENT_QUOTES );
         $com['icon'] = ($com['icon'] != '') ? "subject/".$com['icon'] : 'subject/icon1.gif';
         $com['time'] = formatTimestamp($comments[$i]->getVar('com_created'),'m');
@@ -410,7 +410,7 @@
     include_once XOOPS_ROOT_PATH . '/include/notification_functions.php';
     include_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/notification.php';
     // Notification must be enabled, and user must be logged in
-    if (empty($xoopsUser) || !notificationEnabled('block')) {
+    if (!is_object($xoopsUser) || !notificationEnabled('block')) {
         return false; // do not display block
     }
     $notification_handler =& xoops_gethandler('notification');
diff -ruN 2.2.3a-Final.src/modules/system/constants.php 2.2.6.src/modules/system/constants.php
--- 2.2.3a-Final.src/modules/system/constants.php	2005-07-07 10:47:16.000000000 -0500
+++ 2.2.6.src/modules/system/constants.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: constants.php,v 1.6.24.1 2005/07/07 16:47:16 mithyt2 Exp $
+// $Id: constants.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/include/update.php 2.2.6.src/modules/system/include/update.php
--- 2.2.3a-Final.src/modules/system/include/update.php	2005-10-30 15:24:27.000000000 -0600
+++ 2.2.6.src/modules/system/include/update.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: update.php,v 1.1.2.22.2.3 2005/09/28 16:31:27 mithyt2 Exp $
+// $Id: update.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -186,11 +186,42 @@
             }
         }
     }
+
+    /**
+    * update default value for some profile fields according to system preferences
+    * comments mode and order, default timezone and theme is set to the same values as in general settings
+    */
+    $module->setMessage('Updating user profile field default value...');
+    $profile_handler =& xoops_gethandler('profile');
+    $fields = $profile_handler->loadFields();
+    $fields_update = array("umode"=>"com_mode", "uorder"=>"com_order", "timezone_offset"=>"default_TZ");
+    $count = 0;
+    foreach (array_keys($fields) as $i) {
+        if ($fields[$i]->getVar('field_moduleid') == $module->getVar('mid')){
+         	$field_name = $fields[$i]->getVar('field_name');
+         	if (!in_array($field_name, array_keys($fields_update))) {
+         	    continue;
+         	}
+        	$count++;
+	        $default = $GLOBALS["xoopsConfig"][$fields_update[$field_name]];
+	        if ($default == $fields[$i]->getVar("field_default")) {
+	            continue;
+	        }
+	        $fields[$i]->setVar("field_default", $default);
+        	if ($profile_handler->insertField($fields[$i])) {
+        	    $module->setMessage("&nbsp;&nbsp;Field <strong>".$field_name."</strong> default value updated: ".$default);
+        	}
+        }
+        if ($count>=count($fields_update)) {
+            break;
+        }
+    }
+    unset($fields);
+
     return true;
 }
 
 function xoops_module_pre_update_system(&$module) {
-
     $oldversion = $module->getVar('version');
     if ($oldversion < 206) {
         $sql = "ALTER TABLE ".$GLOBALS['xoopsDB']->prefix("session")." CHANGE sess_data sess_data MEDIUMBLOB NOT NULL";
@@ -320,7 +351,7 @@
         $ids = array();
         while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) {
             if (!isset($ids[$row['oldid']])) { //if "old id" is not set as the new joint id
-            $ids[$row['newid']][] = $row['oldid'];
+                $ids[$row['newid']][] = $row['oldid'];
             }
         }
 
diff -ruN 2.2.3a-Final.src/modules/system/include/userselect.php 2.2.6.src/modules/system/include/userselect.php
--- 2.2.3a-Final.src/modules/system/include/userselect.php	2005-08-04 16:09:46.000000000 -0500
+++ 2.2.6.src/modules/system/include/userselect.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: userselect.php,v 1.1.2.10 2005/08/04 22:09:46 phppp Exp $
+// $Id: userselect.php 184 2006-01-22 22:34:51Z skalpa $
 // ------------------------------------------------------------------------ //
 // XOOPS - PHP Content Management System                      //
 // Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/banners.php 2.2.6.src/modules/system/language/english/admin/banners.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/banners.php	2005-05-07 10:46:05.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/admin/banners.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: banners.php,v 1.5.22.1 2005/05/07 16:46:05 mithyt2 Exp $
+// $Id: banners.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%        Admin Module Name  Banners         %%%%%
 define("_AM_CURACTBNR","Current Active Banners");
 define("_AM_BANNERID","Banner ID");
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/blocksadmin.php 2.2.6.src/modules/system/language/english/admin/blocksadmin.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/blocksadmin.php	2005-06-05 06:04:21.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/admin/blocksadmin.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: blocksadmin.php,v 1.6.22.5 2005/06/05 12:04:21 mithyt2 Exp $
+// $Id: blocksadmin.php 184 2006-01-22 22:34:51Z skalpa $
 
 //%%%%%%	blocks.php 	%%%%%
 define("_AM_BADMIN","Blocks Administration");
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/comments.php 2.2.6.src/modules/system/language/english/admin/comments.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/comments.php	2003-02-12 05:38:42.000000000 -0600
+++ 2.2.6.src/modules/system/language/english/admin/comments.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: comments.php,v 1.5 2003/02/12 11:38:42 okazu Exp $
+// $Id: comments.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%% Comment Manager %%%%%
 define('_MD_AM_COMMMAN','Comment Manager');
 
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/findusers.php 2.2.6.src/modules/system/language/english/admin/findusers.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/findusers.php	2005-07-05 11:15:05.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/admin/findusers.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: findusers.php,v 1.4.22.1 2005/07/05 17:15:05 mithyt2 Exp $
+// $Id: findusers.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	File Name findusers.php 	%%%%%
 
 define("_AM_FINDUS","Find Users");
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/groups.php 2.2.6.src/modules/system/language/english/admin/groups.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/groups.php	2005-05-07 10:46:05.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/admin/groups.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: groups.php,v 1.6.22.1 2005/05/07 16:46:05 mithyt2 Exp $
+// $Id: groups.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	Admin Module Name  AdminGroup 	%%%%%
 define("_AM_EDITADG","Edit Groups");
 define("_AM_MODIFY","Modify");
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/images.php 2.2.6.src/modules/system/language/english/admin/images.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/images.php	2003-02-12 05:38:42.000000000 -0600
+++ 2.2.6.src/modules/system/language/english/admin/images.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: images.php,v 1.4 2003/02/12 11:38:42 okazu Exp $
+// $Id: images.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%% Image Manager %%%%%
 
 
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/mailusers.php 2.2.6.src/modules/system/language/english/admin/mailusers.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/mailusers.php	2005-05-07 10:46:05.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/admin/mailusers.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: mailusers.php,v 1.4.22.1 2005/05/07 16:46:05 mithyt2 Exp $
+// $Id: mailusers.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	Admin Module Name  MailUsers	%%%%%
 
 //%%%%%%	mailusers.php 	%%%%%
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/modulesadmin.php 2.2.6.src/modules/system/language/english/admin/modulesadmin.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/modulesadmin.php	2005-06-18 02:34:52.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/admin/modulesadmin.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: modulesadmin.php,v 1.5.22.1 2005/06/18 08:34:52 mithyt2 Exp $
+// $Id: modulesadmin.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	File Name  modulesadmin.php 	%%%%%
 define("_MD_AM_MODADMIN","Modules Administration");
 define("_MD_AM_MODULE","Module");
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/preferences.php 2.2.6.src/modules/system/language/english/admin/preferences.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/preferences.php	2005-07-24 04:23:46.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/admin/preferences.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: preferences.php,v 1.16.22.7 2005/07/24 10:23:46 mithyt2 Exp $
+// $Id: preferences.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	Admin Module Name  AdminGroup 	%%%%%
 // dont change
 
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/smilies.php 2.2.6.src/modules/system/language/english/admin/smilies.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/smilies.php	2005-05-07 10:46:05.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/admin/smilies.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: smilies.php,v 1.5.22.1 2005/05/07 16:46:05 mithyt2 Exp $
+// $Id: smilies.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	Admin Module Name  Smilies 	%%%%%
 
 define('_AM_SMILESCONTROL','Smilies Control');
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/tplsets.php 2.2.6.src/modules/system/language/english/admin/tplsets.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/tplsets.php	2003-03-03 03:41:40.000000000 -0600
+++ 2.2.6.src/modules/system/language/english/admin/tplsets.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: tplsets.php,v 1.2 2003/03/03 09:41:40 okazu Exp $
+// $Id: tplsets.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%% Template Manager %%%%%
 define('_MD_TPLMAIN','Template Set Manager');
 define('_MD_INSTALL','Install');
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/userrank.php 2.2.6.src/modules/system/language/english/admin/userrank.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/userrank.php	2005-05-07 10:46:05.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/admin/userrank.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: userrank.php,v 1.5.22.1 2005/05/07 16:46:05 mithyt2 Exp $
+// $Id: userrank.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	Admin Module Name  UserRank 	%%%%%
 define("_AM_RANKSSETTINGS","User Ranks Settings");
 define("_AM_TITLE","Title");
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin/version.php 2.2.6.src/modules/system/language/english/admin/version.php
--- 2.2.3a-Final.src/modules/system/language/english/admin/version.php	2005-05-07 10:46:05.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/admin/version.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: version.php,v 1.5.22.1 2005/05/07 16:46:05 mithyt2 Exp $
+// $Id: version.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	Admin Module Name  Version 	%%%%%
 
 
diff -ruN 2.2.3a-Final.src/modules/system/language/english/admin.php 2.2.6.src/modules/system/language/english/admin.php
--- 2.2.3a-Final.src/modules/system/language/english/admin.php	2003-09-17 18:09:51.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/admin.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: admin.php,v 1.8 2003/09/18 00:09:51 okazu Exp $
+// $Id: admin.php 184 2006-01-22 22:34:51Z skalpa $
 //%%%%%%	File Name  admin.php 	%%%%%
 define('_MD_AM_DBUPDATED','Database Updated Successfully!');
 
diff -ruN 2.2.3a-Final.src/modules/system/language/english/blocks.php 2.2.6.src/modules/system/language/english/blocks.php
--- 2.2.3a-Final.src/modules/system/language/english/blocks.php	2005-04-30 06:23:15.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/blocks.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: blocks.php,v 1.13.22.1 2005/04/30 12:23:15 mithyt2 Exp $
+// $Id: blocks.php 184 2006-01-22 22:34:51Z skalpa $
 // Blocks
 define("_MB_SYSTEM_ADMENU","Administration Menu");
 define("_MB_SYSTEM_RNOW","Register now!");
diff -ruN 2.2.3a-Final.src/modules/system/language/english/error.php 2.2.6.src/modules/system/language/english/error.php
--- 2.2.3a-Final.src/modules/system/language/english/error.php	2005-07-28 01:47:29.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/error.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: error.php,v 1.1.2.2 2005/07/28 07:47:29 mithyt2 Exp $
+// $Id: error.php 184 2006-01-22 22:34:51Z skalpa $
 // Error messages
 define("SYSTEM_ERROR1", "[b]Why am I being redirected here?[/b]
 
diff -ruN 2.2.3a-Final.src/modules/system/language/english/modinfo.php 2.2.6.src/modules/system/language/english/modinfo.php
--- 2.2.3a-Final.src/modules/system/language/english/modinfo.php	2005-07-05 11:15:05.000000000 -0500
+++ 2.2.6.src/modules/system/language/english/modinfo.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: modinfo.php,v 1.9.22.4 2005/07/05 17:15:05 mithyt2 Exp $
+// $Id: modinfo.php 184 2006-01-22 22:34:51Z skalpa $
 // Module Info
 
 // The name of this module
diff -ruN 2.2.3a-Final.src/modules/system/menu.php 2.2.6.src/modules/system/menu.php
--- 2.2.3a-Final.src/modules/system/menu.php	2005-07-02 03:41:54.000000000 -0500
+++ 2.2.6.src/modules/system/menu.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: menu.php,v 1.7.26.3 2005/07/02 09:41:54 mithyt2 Exp $
+// $Id: menu.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/modules/system/templates/system_imagemanager2.html 2.2.6.src/modules/system/templates/system_imagemanager2.html
--- 2.2.3a-Final.src/modules/system/templates/system_imagemanager2.html	2004-12-30 23:42:27.000000000 -0600
+++ 2.2.6.src/modules/system/templates/system_imagemanager2.html	2006-01-22 17:49:01.000000000 -0600
@@ -35,7 +35,7 @@
 
   <table cellspacing="0" id="imagenav">
     <tr>
-      <td align="left"><a href="<{$xoops_url}>/imagemanager.php?target=<{$target}>&cat_id=<{$show_cat}>"><{$lang_imgmanager}></a></td>
+      <td align="left"><a href="<{$xoops_url}>/imagemanager.php?target=<{$target}>&amp;cat_id=<{$show_cat}>"><{$lang_imgmanager}></a></td>
     </tr>
   </table>
 
diff -ruN 2.2.3a-Final.src/modules/system/templates/system_userinfo.html 2.2.6.src/modules/system/templates/system_userinfo.html
--- 2.2.3a-Final.src/modules/system/templates/system_userinfo.html	2005-04-23 03:55:47.000000000 -0500
+++ 2.2.6.src/modules/system/templates/system_userinfo.html	2006-01-22 17:49:01.000000000 -0600
@@ -26,8 +26,8 @@
 
 <table width="70%" align="center" border="0">
   <tr align="center">
-    <td><input type="button" value="<{$lang_editprofile}>" onclick="location='<{$xoops_url}>/modules/system/admin.php?fct=users&uid=<{$user_uid}>&op=modifyUser'" />
-    <input type="button" value="<{$lang_deleteaccount}>" onclick="location='<{$xoops_url}>/modules/system/admin.php?fct=users&op=delUser&uid=<{$user_uid}>'" />
+    <td><input type="button" value="<{$lang_editprofile}>" onclick="location='<{$xoops_url}>/modules/system/admin.php?fct=users&amp;uid=<{$user_uid}>&amp;op=modifyUser'" />
+    <input type="button" value="<{$lang_deleteaccount}>" onclick="location='<{$xoops_url}>/modules/system/admin.php?fct=users&amp;op=delUser&amp;uid=<{$user_uid}>'" /></td>
   </tr>
 </table>
 
diff -ruN 2.2.3a-Final.src/modules/system/xoops_version.php 2.2.6.src/modules/system/xoops_version.php
--- 2.2.3a-Final.src/modules/system/xoops_version.php	2005-09-18 08:41:58.000000000 -0500
+++ 2.2.6.src/modules/system/xoops_version.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: xoops_version.php,v 1.17.14.37.2.1 2005/09/18 14:41:58 mithyt2 Exp $
+// $Id: xoops_version.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -684,7 +684,7 @@
 $modversion['config'][38]['valuetype'] = 'text';
 $modversion['config'][38]['default'] = 'general';
 $modversion['config'][38]['category'] = 'meta';
-$modversion['config'][38]['options'] = array("_MD_AM_METAOGEN" => "general", "_MD_AM_METAO14YRS" => "14 years", "_MD_AM_METAOREST" => "restricted", "_MD_AM_METAOMAT", "mature");
+$modversion['config'][38]['options'] = array("_MD_AM_METAOGEN" => "general", "_MD_AM_METAO14YRS" => "14 years", "_MD_AM_METAOREST" => "restricted", "_MD_AM_METAOMAT" => "mature");
 
 $modversion['config'][39]['name'] = 'meta_author';
 $modversion['config'][39]['title'] = '_MD_AM_METAAUTHOR';
diff -ruN 2.2.3a-Final.src/notifications.php 2.2.6.src/notifications.php
--- 2.2.3a-Final.src/notifications.php	2005-04-08 13:06:38.000000000 -0500
+++ 2.2.6.src/notifications.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: notifications.php,v 1.5.6.3 2005/04/08 19:06:38 mithyt2 Exp $
+// $Id: notifications.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/pda.php 2.2.6.src/pda.php
--- 2.2.3a-Final.src/pda.php	2005-03-25 07:06:00.000000000 -0600
+++ 2.2.6.src/pda.php	2006-01-22 17:49:01.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pda.php,v 1.5.22.1 2005/03/25 13:06:00 mithyt2 Exp $
+// $Id: pda.php 185 2006-01-22 23:49:01Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -41,7 +41,7 @@
 if (!$result) {
     echo "An error occured";
 } else {
-    echo "<img src='images/logo.gif' alt='".htmlspecialchars($xoopsConfig['sitename'])."' border='0' /><br />";
+    echo "<img src='images/logo.gif' alt='".htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)."' border='0' /><br />";
     echo "<h2>".htmlspecialchars($xoopsConfig['slogan'])."</h2>";
     echo "<div>";
     while (list($storyid, $title) = $xoopsDB->fetchRow($result)) {
diff -ruN 2.2.3a-Final.src/pmlite.php 2.2.6.src/pmlite.php
--- 2.2.3a-Final.src/pmlite.php	2005-04-23 03:55:39.000000000 -0500
+++ 2.2.6.src/pmlite.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: pmlite.php,v 1.11.6.4 2005/04/23 09:55:39 mithyt2 Exp $
+// $Id: pmlite.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/readpmsg.php 2.2.6.src/readpmsg.php
--- 2.2.3a-Final.src/readpmsg.php	2005-04-23 03:55:39.000000000 -0500
+++ 2.2.6.src/readpmsg.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: readpmsg.php,v 1.11.6.3 2005/04/23 09:55:39 mithyt2 Exp $
+// $Id: readpmsg.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/recovery.php 2.2.6.src/recovery.php
--- 2.2.3a-Final.src/recovery.php	2005-04-30 06:23:11.000000000 -0500
+++ 2.2.6.src/recovery.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: recovery.php,v 1.1.2.4 2005/04/30 12:23:11 mithyt2 Exp $
+// $Id: recovery.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/register.php 2.2.6.src/register.php
--- 2.2.3a-Final.src/register.php	2005-04-23 03:55:39.000000000 -0500
+++ 2.2.6.src/register.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: register.php,v 1.13.4.1.2.3 2005/04/23 09:55:39 mithyt2 Exp $
+// $Id: register.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/search.php 2.2.6.src/search.php
--- 2.2.3a-Final.src/search.php	2005-05-06 05:44:12.000000000 -0500
+++ 2.2.6.src/search.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: search.php,v 1.17.4.2.2.6 2005/05/06 11:44:12 mithyt2 Exp $
+// $Id: search.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -89,7 +89,7 @@
     }
 }
 
-$groups = ( $xoopsUser ) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;
+$groups = is_object($xoopsUser) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;
 $gperm_handler = & xoops_gethandler( 'groupperm' );
 $available_modules = $gperm_handler->getItemIds('module_read', $groups);
 
@@ -180,18 +180,18 @@
                     }
                     echo "<b><a href='".$results[$i]['link']."'>".$myts->makeTboxData4Show($results[$i]['title'])."</a></b><br />\n";
                     echo "<small>";
-                    $results[$i]['uid'] = intval($results[$i]['uid']);
+                    $results[$i]['uid'] = @intval($results[$i]['uid']);
                     if ( !empty($results[$i]['uid']) ) {
                         $uname = XoopsUser::getUnameFromId($results[$i]['uid']);
                         echo "&nbsp;&nbsp;<a href='".XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid']."'>".$uname."</a>\n";
                     }
-                    echo $results[$i]['time'] ? " (". formatTimestamp(intval($results[$i]['time'])).")" : "";
+                    echo !empty($results[$i]['time']) ? " (". formatTimestamp(intval($results[$i]['time'])).")" : "";
                     echo "</small><br />\n";
                 }
-                if ( $count == 5 ) {
+                if ( $count >= 5 ) {
                     $search_url = XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' ', $queries)));
                     $search_url .= "&mid=$mid&action=showall&andor=$andor";
-                    echo '<br /><a href="'.$search_url.'">'._SR_SHOWALLR.'</a></p>';
+                    echo '<br /><a href="'.htmlspecialchars($search_url).'">'._SR_SHOWALLR.'</a></p>';
                 }
             }
         }
@@ -242,12 +242,12 @@
             }
             echo "<b><a href='".$results[$i]['link']."'>".$myts->makeTboxData4Show($results[$i]['title'])."</a></b><br />\n";
             echo "<small>";
-            $results[$i]['uid'] = intval($results[$i]['uid']);
+            $results[$i]['uid'] = @intval($results[$i]['uid']);
             if ( !empty($results[$i]['uid']) ) {
                 $uname = XoopsUser::getUnameFromId($results[$i]['uid']);
                 echo "&nbsp;&nbsp;<a href='".XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid']."'>".$uname."</a>\n";
             }
-            echo $results[$i]['time'] ? " (". formatTimestamp(intval($results[$i]['time'])).")" : "";
+            echo !empty($results[$i]['time']) ? " (". formatTimestamp(intval($results[$i]['time'])).")" : "";
             echo "</small><br />\n";
         }
         echo '
diff -ruN 2.2.3a-Final.src/templates_c/%%22^222^222153D0%%db%3Asystem_block_user.html.php 2.2.6.src/templates_c/%%22^222^222153D0%%db%3Asystem_block_user.html.php
--- 2.2.3a-Final.src/templates_c/%%22^222^222153D0%%db%3Asystem_block_user.html.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/templates_c/%%22^222^222153D0%%db%3Asystem_block_user.html.php	2008-01-17 07:24:53.000000000 -0600
@@ -0,0 +1,30 @@
+<?php /* Smarty version 2.6.5-dev, created on 2008-01-17 07:24:53
+         compiled from db:system_block_user.html */ ?>
+<table cellspacing="0">
+  <tr>
+    <td id="usermenu">
+      <a class="menuTop" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/user.php"><?php echo $this->_tpl_vars['block']['lang_youraccount']; ?>
+</a>
+      <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/edituser.php"><?php echo $this->_tpl_vars['block']['lang_editaccount']; ?>
+</a>
+      <?php if ($this->_tpl_vars['block']['lang_inbox']): ?>
+        <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/pm/"><?php echo $this->_tpl_vars['block']['lang_inbox']; ?>
+</a>
+      <?php endif; ?>
+      <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/notifications.php"><?php echo $this->_tpl_vars['block']['lang_notifications']; ?>
+</a>
+      <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/user.php?op=logout"><?php echo $this->_tpl_vars['block']['lang_logout']; ?>
+</a>
+      <?php if ($this->_tpl_vars['block']['admin']): ?>
+        <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/admin.php"><?php echo $this->_tpl_vars['block']['lang_adminmenu']; ?>
+</a>
+      <?php endif; ?>
+    </td>
+  </tr>
+</table>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/templates_c/%%2D^2DD^2DDFE4CA%%theme_blockleft.html.php 2.2.6.src/templates_c/%%2D^2DD^2DDFE4CA%%theme_blockleft.html.php
--- 2.2.3a-Final.src/templates_c/%%2D^2DD^2DDFE4CA%%theme_blockleft.html.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/templates_c/%%2D^2DD^2DDFE4CA%%theme_blockleft.html.php	2008-01-17 07:24:43.000000000 -0600
@@ -0,0 +1,7 @@
+<?php /* Smarty version 2.6.5-dev, created on 2008-01-17 07:24:43
+         compiled from default/blocks/theme_blockleft.html */ ?>
+<?php if ($this->_tpl_vars['block']['title'] != ""): ?><div class="blockTitle"><?php echo $this->_tpl_vars['block']['title']; ?>
+</div><?php endif; ?>
+<div class="blockContent"><?php echo $this->_tpl_vars['block']['content']; ?>
+</div>
+
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/templates_c/%%42^428^428512AB%%db%3Asystem_block_mainmenu.html.php 2.2.6.src/templates_c/%%42^428^428512AB%%db%3Asystem_block_mainmenu.html.php
--- 2.2.3a-Final.src/templates_c/%%42^428^428512AB%%db%3Asystem_block_mainmenu.html.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/templates_c/%%42^428^428512AB%%db%3Asystem_block_mainmenu.html.php	2008-01-17 07:24:43.000000000 -0600
@@ -0,0 +1,28 @@
+<?php /* Smarty version 2.6.5-dev, created on 2008-01-17 07:24:43
+         compiled from db:system_block_mainmenu.html */ ?>
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+      <a class="menuTop" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/"><?php echo $this->_tpl_vars['block']['lang_home']; ?>
+</a>
+      <!-- start module menu loop -->
+      <?php if (count($_from = (array)$this->_tpl_vars['block']['modules'])):
+    foreach ($_from as $this->_tpl_vars['module']):
+?>
+      <a class="menuMain" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/<?php echo $this->_tpl_vars['module']['directory']; ?>
+/"><?php echo $this->_tpl_vars['module']['name']; ?>
+</a>
+        <?php if (count($_from = (array)$this->_tpl_vars['module']['sublinks'])):
+    foreach ($_from as $this->_tpl_vars['sublink']):
+?>
+          <a class="menuSub" href="<?php echo $this->_tpl_vars['sublink']['url']; ?>
+"><?php echo $this->_tpl_vars['sublink']['name']; ?>
+</a>
+        <?php endforeach; unset($_from); endif; ?>
+      <?php endforeach; unset($_from); endif; ?>
+      <!-- end module menu loop -->
+    </td>
+  </tr>
+</table>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/templates_c/%%65^657^657DE3A1%%theme.html.php 2.2.6.src/templates_c/%%65^657^657DE3A1%%theme.html.php
--- 2.2.3a-Final.src/templates_c/%%65^657^657DE3A1%%theme.html.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/templates_c/%%65^657^657DE3A1%%theme.html.php	2008-01-17 08:01:05.000000000 -0600
@@ -0,0 +1,207 @@
+<?php /* Smarty version 2.6.5-dev, created on 2008-01-17 07:24:43 */ ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
+" lang="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
+">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=<?php echo $this->_tpl_vars['xoops_charset']; ?>
+" />
+<meta http-equiv="content-language" content="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
+" />
+<meta name="robots" content="<?php echo $this->_tpl_vars['xoops_meta_robots']; ?>
+" />
+<meta name="keywords" content="<?php echo $this->_tpl_vars['xoops_meta_keywords']; ?>
+" />
+<meta name="description" content="<?php echo $this->_tpl_vars['xoops_meta_description']; ?>
+" />
+<meta name="rating" content="<?php echo $this->_tpl_vars['xoops_meta_rating']; ?>
+" />
+<meta name="author" content="<?php echo $this->_tpl_vars['xoops_meta_author']; ?>
+" />
+<meta name="copyright" content="<?php echo $this->_tpl_vars['xoops_meta_copyright']; ?>
+" />
+<meta name="generator" content="XOOPS" />
+<title><?php echo $this->_tpl_vars['xoops_sitename']; ?>
+ - <?php echo $this->_tpl_vars['xoops_pagetitle']; ?>
+</title>
+<link href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/favicon.ico" rel="SHORTCUT ICON" />
+
+<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/xoops.css" />
+<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->_tpl_vars['xoops_themecss']; ?>
+" />
+
+<!-- RMV: added module header -->
+<?php echo $this->_tpl_vars['xoops_module_header']; ?>
+
+<script type="text/javascript">
+<!--
+<?php echo $this->_tpl_vars['xoops_js']; ?>
+
+//-->
+</script>
+<script type="text/javascript">
+</script>
+<script type="text/javascript" src="<?php echo $this->_tpl_vars['xoops_imageurl']; ?>
+js/adminmenu.js"></script>
+<script type="text/javascript" src="<?php echo $this->_tpl_vars['xoops_imageurl']; ?>
+js/ie5.js"></script>
+<script type="text/javascript">
+
+function toggle(notifs_form) 
+{
+obj=document.getElementById(notifs_form);
+obj.style.display=!(obj.style.display=="block")? "block" : "none";  
+}
+
+function swapimage(swap)
+{
+img_plus="<?php echo $this->_tpl_vars['xoops_imageurl']; ?>
+images/plus.gif";
+img_minus="<?php echo $this->_tpl_vars['xoops_imageurl']; ?>
+images/minus.gif";
+obj=document.getElementById(swap);
+obj.src=!(obj.src==img_minus)? img_minus : img_plus;  
+}
+
+</script>
+</head>
+<body>
+
+	<div class="wrapper">
+  		<table class="toptable" cellspacing="0">
+    		<tr>
+      		<td id="headerlogo"><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/"><img src="<?php echo $this->_tpl_vars['xoops_imageurl']; ?>
+images/logo.gif" width="148" height="80" title="<?php echo @constant('_YOURHOME'); ?>
+" alt="<?php echo @constant('_YOURHOME'); ?>
+" /></a></td>
+      		<td id="headerbanner"><?php echo $this->_tpl_vars['xoops_banner']; ?>
+</td>
+    		</tr>
+    		<tr>
+      		<td id="headerbar" colspan="2">
+					<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "default/navigation/theme_usernav.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+				</td>
+    		</tr>
+  		</table>
+
+  		<table class="maintable" cellspacing="0">
+    		<tr>
+				<!-- Display left blocks start-->
+				<?php if ($this->_tpl_vars['xoops_showlblock'] == 1): ?>
+				<td id="leftcolumn">
+        			 <!-- Start left blocks loop -->
+        			<?php if (count($_from = (array)$this->_tpl_vars['xoops_lblocks'])):
+    foreach ($_from as $this->_tpl_vars['block']):
+?>
+          		<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "default/blocks/theme_blockleft.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+        			<?php endforeach; unset($_from); endif; ?>
+        			<!-- End left blocks loop -->
+				</td>
+				<?php endif; ?>
+				<!-- Display left blocks end -->
+				<td id="centercolumn">
+					<!-- Display center blocks if any -->
+        			<?php if ($this->_tpl_vars['xoops_showcblock'] == 1): ?>
+						<table cellspacing="0">
+						<tr>
+            				<td id="centerCcolumn" colspan="2">
+									<!-- Start center-center blocks loop -->
+            					<?php if (count($_from = (array)$this->_tpl_vars['xoops_ccblocks'])):
+    foreach ($_from as $this->_tpl_vars['block']):
+?>
+              					<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "default/blocks/theme_blockcenter_c.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+            					<?php endforeach; unset($_from); endif; ?>
+            					<!-- End center-center blocks loop -->
+            				</td>
+          				</tr>
+          				<tr>
+            				<td id="centerLcolumn">
+									<!-- Start center-left blocks loop -->
+              					<?php if (count($_from = (array)$this->_tpl_vars['xoops_clblocks'])):
+    foreach ($_from as $this->_tpl_vars['block']):
+?>
+                				<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "default/blocks/theme_blockcenter_l.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+              					<?php endforeach; unset($_from); endif; ?>
+            					<!-- End center-left blocks loop -->
+            				</td>
+								<td id="centerRcolumn">
+            					<!-- Start center-right blocks loop -->
+              					<?php if (count($_from = (array)$this->_tpl_vars['xoops_crblocks'])):
+    foreach ($_from as $this->_tpl_vars['block']):
+?>
+                				<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "default/blocks/theme_blockcenter_r.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+              					<?php endforeach; unset($_from); endif; ?>
+            					<!-- End center-right blocks loop -->
+            				</td>
+          				</tr>
+        				</table>
+        			<?php endif; ?>
+        			<!-- End display center blocks -->
+        			<div id="content">
+          			<?php echo $this->_tpl_vars['xoops_contents']; ?>
+
+        			</div>
+      		</td>
+				<!-- Display right blocks start-->
+      		<?php if ($this->_tpl_vars['xoops_showrblock'] == 1): ?>
+				<td id="rightcolumn">
+        			<!-- Start right blocks loop -->
+        			<?php if (count($_from = (array)$this->_tpl_vars['xoops_rblocks'])):
+    foreach ($_from as $this->_tpl_vars['block']):
+?>
+          		<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "default/blocks/theme_blockright.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+        			<?php endforeach; unset($_from); endif; ?>
+        			<!-- End right blocks loop -->
+      		</td>
+				<?php endif; ?>
+				<!-- Display right blocks end-->
+			</tr>
+  		</table>
+
+  		<table class="footertable" cellspacing="0">
+    		<tr>
+          		<td id="footerbar">
+					<?php echo $this->_tpl_vars['xoops_footer']; ?>
+
+				</td>
+    		</tr>
+  		</table>
+	</div>
+	<script type="text/javascript">
+    	var menu1 = new AdMenu("menu1");
+    	menu1.position.level1.top = 1;
+    		menu1.position.level1.left = 0;
+    	menu1.position.levelX.top = 0;
+    		menu1.position.levelX.left = 0;
+    	menu1.init();
+    </script>
+    <!-- USER NAVIGATION BAR END -->
+</body>
+</html>
diff -ruN 2.2.3a-Final.src/templates_c/%%6A^6AE^6AE583CC%%db%3Aprofile_userinfo.html.php 2.2.6.src/templates_c/%%6A^6AE^6AE583CC%%db%3Aprofile_userinfo.html.php
--- 2.2.3a-Final.src/templates_c/%%6A^6AE^6AE583CC%%db%3Aprofile_userinfo.html.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/templates_c/%%6A^6AE^6AE583CC%%db%3Aprofile_userinfo.html.php	2008-01-17 07:24:53.000000000 -0600
@@ -0,0 +1,115 @@
+<?php /* Smarty version 2.6.5-dev, created on 2008-01-17 07:24:53
+         compiled from db:profile_userinfo.html */ ?>
+<?php if ($this->_tpl_vars['user_ownpage'] == true): ?>
+
+    <form name="usernav" action="user.php" method="post">
+
+    <br /><br />
+
+    <table width="70%" align="center" border="0">
+      <tr align="center">
+        <td><input type="button" value="<?php echo $this->_tpl_vars['lang_editprofile']; ?>
+" onclick="location='edituser.php'" />
+        <input type="button" value="<?php echo $this->_tpl_vars['lang_changepassword']; ?>
+" onclick="location='changepass.php'" />
+        <input type="button" value="<?php echo $this->_tpl_vars['lang_avatar']; ?>
+" onclick="location='edituser.php?op=avatarform'" />
+
+        <?php if ($this->_tpl_vars['user_candelete'] == true): ?>
+        <input type="button" value="<?php echo $this->_tpl_vars['lang_deleteaccount']; ?>
+" onclick="location='edituser.php?op=delete'" />
+        <?php endif; ?>
+
+        <input type="button" value="<?php echo $this->_tpl_vars['lang_logout']; ?>
+" onclick="location='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/user.php?op=logout'" /></td>
+      </tr>
+    </table>
+    </form>
+
+<br /><br />
+<?php elseif ($this->_tpl_vars['xoops_isadmin'] != false): ?>
+
+    <br /><br />
+
+    <table width="70%" align="center" border="0">
+      <tr align="center">
+        <td><input type="button" value="<?php echo $this->_tpl_vars['lang_editprofile']; ?>
+" onclick="location='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/profile/admin/user.php?op=edit&amp;id=<?php echo $this->_tpl_vars['user_uid']; ?>
+'" />
+        <input type="button" value="<?php echo $this->_tpl_vars['lang_deleteaccount']; ?>
+" onclick="location='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/profile/admin/user.php?op=delete&amp;id=<?php echo $this->_tpl_vars['user_uid']; ?>
+'" />
+      </tr>
+    </table>
+
+    <br /><br />
+<?php endif; ?>
+
+<?php if (isset($this->_foreach['catcount'])) unset($this->_foreach['catcount']);
+$this->_foreach['catcount']['total'] = count($_from = (array)$this->_tpl_vars['categories']);
+$this->_foreach['catcount']['show'] = $this->_foreach['catcount']['total'] > 0;
+if ($this->_foreach['catcount']['show']):
+$this->_foreach['catcount']['iteration'] = 0;
+    foreach ($_from as $this->_tpl_vars['category']):
+        $this->_foreach['catcount']['iteration']++;
+        $this->_foreach['catcount']['first'] = ($this->_foreach['catcount']['iteration'] == 1);
+        $this->_foreach['catcount']['last']  = ($this->_foreach['catcount']['iteration'] == $this->_foreach['catcount']['total']);
+?>
+    <?php if (isset ( $this->_tpl_vars['category']['fields'] )): ?>
+        <div style="width: 48%; float: left; padding: 0px 5px 10px 5px;">
+            <table class="outer" cellpadding="4" cellspacing="1">
+                <tr>
+                  <th colspan="2" align="center"><?php echo $this->_tpl_vars['category']['cat_title']; ?>
+</th>
+                </tr>
+                <?php if (count($_from = (array)$this->_tpl_vars['category']['fields'])):
+    foreach ($_from as $this->_tpl_vars['field']):
+?>
+                    <tr>
+                        <td class="head"><?php echo $this->_tpl_vars['field']['title']; ?>
+</td>
+                        <td class="even"><?php echo $this->_tpl_vars['field']['value']; ?>
+</td>
+                    </tr>
+                <?php endforeach; unset($_from); endif; ?>
+            </table>
+        </div>
+    <?php endif; ?>
+<?php endforeach; unset($_from); endif; ?>
+
+<?php if ($this->_tpl_vars['modules']): ?>
+    <br style="clear: both;"/>
+    <!-- start module search results loop -->
+    <?php if (count($_from = (array)$this->_tpl_vars['modules'])):
+    foreach ($_from as $this->_tpl_vars['module']):
+?>
+
+    <p>
+    <h4><?php echo $this->_tpl_vars['module']['name']; ?>
+</h4>
+
+      <!-- start results item loop -->
+          <?php if (count($_from = (array)$this->_tpl_vars['module']['results'])):
+    foreach ($_from as $this->_tpl_vars['result']):
+?>
+
+          <img src="<?php echo $this->_tpl_vars['result']['image']; ?>
+" alt="<?php echo $this->_tpl_vars['module']['name']; ?>
+" />&nbsp;<b><a href="<?php echo $this->_tpl_vars['result']['link']; ?>
+"><?php echo $this->_tpl_vars['result']['title']; ?>
+</a></b><br /><small>(<?php echo $this->_tpl_vars['result']['time']; ?>
+)</small><br />
+
+          <?php endforeach; unset($_from); endif; ?>
+          <!-- end results item loop -->
+
+    <?php echo $this->_tpl_vars['module']['showall_link']; ?>
+
+    </p>
+
+    <?php endforeach; unset($_from); endif; ?>
+    <!-- end module search results loop -->
+<?php endif; ?>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/templates_c/%%6E^6E8^6E8C036B%%db%3Asystem_block_login.html.php 2.2.6.src/templates_c/%%6E^6E8^6E8C036B%%db%3Asystem_block_login.html.php
--- 2.2.3a-Final.src/templates_c/%%6E^6E8^6E8C036B%%db%3Asystem_block_login.html.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/templates_c/%%6E^6E8^6E8C036B%%db%3Asystem_block_login.html.php	2008-01-17 07:24:43.000000000 -0600
@@ -0,0 +1,28 @@
+<?php /* Smarty version 2.6.5-dev, created on 2008-01-17 07:24:43
+         compiled from db:system_block_login.html */ ?>
+<form style="margin-top: 0px;" action="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/user.php" method="post">
+    <?php echo $this->_tpl_vars['block']['lang_username']; ?>
+<br />
+    <input type="text" name="uname" size="12" value="<?php echo $this->_tpl_vars['block']['unamevalue']; ?>
+" maxlength="25" /><br />
+    <?php echo $this->_tpl_vars['block']['lang_password']; ?>
+<br />
+    <input type="password" name="pass" size="12" maxlength="32" /><br />
+    <!-- <input type="checkbox" name="rememberme" value="On" class ="formButton" /><?php echo $this->_tpl_vars['block']['lang_rememberme']; ?>
+<br /> //-->
+    <input type="hidden" name="xoops_redirect" value="<?php echo $this->_tpl_vars['xoops_requesturi']; ?>
+" />
+    <input type="hidden" name="op" value="login" />
+    <input class="formbutton" type="submit" value="<?php echo $this->_tpl_vars['block']['lang_login']; ?>
+" /><br />
+    <?php echo $this->_tpl_vars['block']['sslloginlink']; ?>
+
+</form>
+<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/user.php#lost"><?php echo $this->_tpl_vars['block']['lang_lostpass']; ?>
+</a>
+<br /><br />
+<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/register.php"><?php echo $this->_tpl_vars['block']['lang_registernow']; ?>
+</a>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/templates_c/%%F3^F34^F34CA8BF%%theme_usernav.html.php 2.2.6.src/templates_c/%%F3^F34^F34CA8BF%%theme_usernav.html.php
--- 2.2.3a-Final.src/templates_c/%%F3^F34^F34CA8BF%%theme_usernav.html.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/templates_c/%%F3^F34^F34CA8BF%%theme_usernav.html.php	2008-01-17 07:24:43.000000000 -0600
@@ -0,0 +1,54 @@
+<?php /* Smarty version 2.6.5-dev, created on 2008-01-17 07:24:43
+         compiled from default/navigation/theme_usernav.html */ ?>
+<?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');
+smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'default/navigation/theme_usernav.html', 20, false),)), $this); ?>
+					<!-- USER NAVIGATION BAR START -->
+					<div id="navbar">
+        				<table cellspacing="0" cellpadding="0" id="menu1" class="NavMenu">
+        					<tr>
+								<?php if ($this->_tpl_vars['xoops_isuser'] == 1): ?>
+								    <td>
+    								    <a class="button" href="javascript:void(0)"><?php echo @constant('_MA_NAV_ACTIONS'); ?>
+</a>
+    								    <div class="section">
+        									<a class="item" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/user.php"><?php echo @constant('_MA_NAV_VIEWACCOUNT'); ?>
+</a>
+                                            <a class="item" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/edituser.php"><?php echo @constant('_MA_NAV_EDITACCOUNT'); ?>
+</a>
+                                            <a class="item" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/notifications.php"><?php echo @constant('_MA_NAV_NOTIFICATIONS'); ?>
+</a>
+                                            <a class="item" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/user.php?op=logout"><?php echo @constant('_MA_NAV_LOGOUT'); ?>
+</a>
+                                            <?php if ($this->_tpl_vars['xoops_isadmin']): ?>
+                                                <a class="item" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/admin.php"><?php echo @constant('_MA_NAV_ADMINISTRATION'); ?>
+</a>
+                                            <?php endif; ?>
+                                        </div>
+                                    </td>
+								<?php else: ?>
+									<td id="date"> 
+										<?php echo ((is_array($_tmp=time())) ? $this->_run_mod_handler('date_format', true, $_tmp, "%A, %e %B %Y") : smarty_modifier_date_format($_tmp, "%A, %e %B %Y")); ?>
+
+									</td>
+								<?php endif; ?>
+									<td id="search">
+										<form style="margin: 0px;" action="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/search.php" method="get">
+  											<input type="text" name="query" size="14" />
+											<input type="hidden" name="action" value="results" />
+											<input class="formButton" type="submit" value="<?php echo @constant('_SEARCH'); ?>
+" />
+  											<?php if (@constant('modid') > 1): ?>
+    										<input type="hidden" name="mids[]" value="<?php echo @constant('modid'); ?>
+" />
+  											<?php endif; ?>
+										</form>
+									</td>
+        					</tr>
+        				</table>
+    				</div>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/templates_c/%%F3^F39^F3989731%%db%3Asystem_userform.html.php 2.2.6.src/templates_c/%%F3^F39^F3989731%%db%3Asystem_userform.html.php
--- 2.2.3a-Final.src/templates_c/%%F3^F39^F3989731%%db%3Asystem_userform.html.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/templates_c/%%F3^F39^F3989731%%db%3Asystem_userform.html.php	2008-01-17 07:24:43.000000000 -0600
@@ -0,0 +1,42 @@
+<?php /* Smarty version 2.6.5-dev, created on 2008-01-17 07:24:43
+         compiled from db:system_userform.html */ ?>
+<fieldset style="padding: 10px;">
+  <legend style="font-weight: bold;"><?php echo $this->_tpl_vars['lang_login']; ?>
+</legend>
+  <form action="user.php" method="post">
+    <?php echo $this->_tpl_vars['lang_username']; ?>
+ <input type="text" name="uname" size="26" maxlength="25" value="<?php echo $this->_tpl_vars['usercookie']; ?>
+" /><br />
+    <?php echo $this->_tpl_vars['lang_password']; ?>
+ <input type="password" name="pass" size="21" maxlength="32" /><br />
+    <input type="hidden" name="op" value="login" />
+    <input type="hidden" name="xoops_redirect" value="<?php echo $this->_tpl_vars['redirect_page']; ?>
+" />
+    <input type="submit" value="<?php echo $this->_tpl_vars['lang_login']; ?>
+" />
+  </form>
+  <a name="lost"></a>
+  <div><?php echo $this->_tpl_vars['lang_notregister']; ?>
+<br /></div>
+</fieldset>
+
+<br />
+
+<fieldset style="padding: 10px;">
+  <legend style="font-weight: bold;"><?php echo $this->_tpl_vars['lang_lostpassword']; ?>
+</legend>
+  <div><br /><?php echo $this->_tpl_vars['lang_noproblem']; ?>
+</div>
+  <form action="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/lostpass.php" method="post">
+    <?php echo $this->_tpl_vars['lang_youremail']; ?>
+ <input type="text" name="email" size="26" maxlength="60" />&nbsp;&nbsp;<input type="hidden" name="op" value="mailpasswd" /><input type="hidden" name="t" value="<?php echo $this->_tpl_vars['mailpasswd_token']; ?>
+" /><input type="submit" value="<?php echo $this->_tpl_vars['lang_sendpassword']; ?>
+" />
+  </form>
+</fieldset>
+<br />
+<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/profile/activate.php" title="<?php echo @constant('_US_RESENDACTIVATIONMAIL'); ?>
+"><?php echo @constant('_US_RESENDACTIVATIONMAIL'); ?>
+</a>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/templates_c/%%F6^F69^F692B736%%db%3Asystem_redirect.html.php 2.2.6.src/templates_c/%%F6^F69^F692B736%%db%3Asystem_redirect.html.php
--- 2.2.3a-Final.src/templates_c/%%F6^F69^F692B736%%db%3Asystem_redirect.html.php	1969-12-31 18:00:00.000000000 -0600
+++ 2.2.6.src/templates_c/%%F6^F69^F692B736%%db%3Asystem_redirect.html.php	2008-01-17 07:24:52.000000000 -0600
@@ -0,0 +1,8 @@
+<?php /* Smarty version 2.6.5-dev, created on 2008-01-17 07:24:52
+         compiled from db:system_redirect.html */ ?>
+<div style="text-align:center; background-color: transparent; border-top: 0px solid #FFFFFF; border-left: 0px solid #FFFFFF; border-right: 0px solid #AAAAAA; border-bottom: 0px solid #AAAAAA; font-weight : bold;">
+  <h4><?php echo $this->_tpl_vars['message']; ?>
+</h4>
+  <p><?php echo $this->_tpl_vars['lang_ifnotreload']; ?>
+</p>
+</div>
\ No newline at end of file
diff -ruN 2.2.3a-Final.src/themes/default/css/styleAdmin.css 2.2.6.src/themes/default/css/styleAdmin.css
--- 2.2.3a-Final.src/themes/default/css/styleAdmin.css	2005-05-24 11:55:15.000000000 -0500
+++ 2.2.6.src/themes/default/css/styleAdmin.css	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 @import url(style.css);
-#buttontop { float:left; width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0; }
+#buttontop { width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0; }
 #buttonbar { float:left; width:100%; background: #e7e7e7 url('../images/modadminbg.gif') repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px; }
 #buttonbar ul { margin:0; margin-top: 15px; padding:10px 10px 0; list-style:none; }
 #buttonbar li { display:inline; margin:0; padding:0; }
diff -ruN 2.2.3a-Final.src/themes/default/css/style.css 2.2.6.src/themes/default/css/style.css
--- 2.2.3a-Final.src/themes/default/css/style.css	2005-07-24 03:25:29.000000000 -0500
+++ 2.2.6.src/themes/default/css/style.css	2007-09-09 00:44:27.000000000 -0500
@@ -21,7 +21,7 @@
 h4 {}
 h5 {}
 ul { margin: 2px; padding: 2px; list-style: decimal inside; text-align: left;}
-li { margin-left: 2px; list-style: square inside; color: #436792}
+li { margin-left: 2px; color: #436792; line-height: 150%;}
 
 fieldset {padding: 10px;border: 1px solid #aca899;}
 
@@ -54,7 +54,8 @@
 .comUserRank {margin: 2px;}
 .comUserRankText {font-size: 10px;font-weight:bold;}
 .comUserRankImg {border: 0;}
-.comUserName {}
+.comUserName {color: #eee;}
+.comUserName a{color: #eee;}
 .comUserImg {margin: 2px;}
 .comDate {font-weight: normal; font-style: italic; font-size: smaller}
 .comDateCaption {font-weight: bold; font-style: normal;}
@@ -125,7 +126,8 @@
 .head {background-color: #e7e7e7; padding: 3px; font-weight: normal;}
 .even {background-color: #e7e7e7; padding: 3px;}
 .odd {background-color: #f7f7f7; padding: 3px;}
-.foot {background-color: #436792; padding: 3px; font-weight: bold;text-align: center;}
+.foot {color: #fff; background-color: #436792; padding: 3px; font-weight: bold;text-align: center;}
+.foot a {color: #fff;}
 tr.head td {background-color: #B6CDE4; padding: 3px; font-weight: bold;}
 tr.even td {background-color: #efefef; padding: 3px;}
 tr.odd td {background-color: #f7f7f7; padding: 3px;}
@@ -182,4 +184,4 @@
 * html .NavMenu td { position: relative;} /* ie 5.0 fix */
 /* ...Nav bar end */
 
-.section .item {margin-bottom: 0px;}
\ No newline at end of file
+.section .item {margin-bottom: 0px;}
diff -ruN 2.2.3a-Final.src/themes/xmt/css/style.css 2.2.6.src/themes/xmt/css/style.css
--- 2.2.3a-Final.src/themes/xmt/css/style.css	2005-09-18 08:30:10.000000000 -0500
+++ 2.2.6.src/themes/xmt/css/style.css	2006-01-22 17:49:01.000000000 -0600
@@ -40,14 +40,14 @@
 
 /* Begin Menus */
 td#mainmenu { margin: 0; }
-td#mainmenu a:before { content: url(images/menubullet.png); }
+td#mainmenu a:before { content: url("../images/menubullet.png"); }
 td#mainmenu a:hover { }
 td#mainmenu a.menuTop { padding-left: 3px; }
 td#mainmenu a.menuMain { padding-left: 3px; }
 td#mainmenu a.menuSub { padding-left: 9px; }
 
 td#usermenu { margin: 0; }
-td#usermenu a:before { content: url(images/menubullet.png); }
+td#usermenu a:before { content: url("../images/menubullet.png"); }
 td#usermenu a:hover { }
 td#usermenu a.menuTop { padding-left: 3px; }
 td#usermenu a.highlight { background: #fcc; }
@@ -72,7 +72,7 @@
 /*Lists */
 html>body ul {list-style: none;text-indent: -12px;}
 ul li:before {content: "\00BB \0020";}
-ul {margin-top: 0;margin-left: 0;padding-left: 12px;} 
+ul {margin-top: 0;margin-left: 0;padding-left: 12px;}
 li {margin: 7px 0 8px 10px;}
 
 /* System Messages */
@@ -81,7 +81,7 @@
 div.confirmMsg {border-top: 1px solid #ddf;border-left: 10px solid #48b;border-right: 1px solid #aaa;border-bottom: 1px solid #aaa;padding: 10px;width: 75%;color: #136C99;background: #ddffdf;font-weight: bold;text-align: center;}
 
 div.resultMsg {border-top: 1px solid silver;border-left: 10px solid #48b;border-right: 1px solid #666;border-bottom: 1px solid #666;padding: 10px;width: 75%;color: #333;background: #f9f9f9;font-weight: bold;text-align: center;}
-	
+
 /* Posts */
 div.xoopsCode {border: 1px inset #000;padding: 6px;background: #e7e7e7;font-family: "Courier New",Courier,monospace; overflow: auto;}
 div.xoopsQuote { font-style: italic;  overflow: auto;}
diff -ruN 2.2.3a-Final.src/userinfo.php 2.2.6.src/userinfo.php
--- 2.2.3a-Final.src/userinfo.php	2005-05-27 08:55:25.000000000 -0500
+++ 2.2.6.src/userinfo.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: userinfo.php,v 1.18.6.5 2005/05/27 14:55:25 mithyt2 Exp $
+// $Id: userinfo.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/user.php 2.2.6.src/user.php
--- 2.2.3a-Final.src/user.php	2005-09-26 08:55:27.000000000 -0500
+++ 2.2.6.src/user.php	2007-09-09 00:44:27.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: user.php,v 1.14.6.4.2.1 2005/09/26 14:55:27 mithyt2 Exp $
+// $Id: user.php 1030 2007-09-09 05:44:27Z phppp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -56,7 +56,9 @@
         $xoopsTpl->assign('lang_sendpassword', _US_SENDPASSWORD);
         $xoopsTpl->assign('mailpasswd_token', $GLOBALS['xoopsSecurity']->createToken());
         include 'footer.php';
-    } elseif ( $xoopsUser ) {
+    } elseif ( trim($_GET['xoops_redirect']) ) {
+        header('Location: '.trim($_GET['xoops_redirect']));
+    } else {
         header('Location: '.XOOPS_URL.'/modules/profile/userinfo.php?uid='.$xoopsUser->getVar('uid'));
     }
     exit();
@@ -69,8 +71,9 @@
 
 if ($op == 'logout') {
     $message = '';
+    // Regenrate a new session id and destroy old session
+    session_regenerate_id(true);
     $_SESSION = array();
-    session_destroy();
     if ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') {
         setcookie($xoopsConfig['session_name'], '', time()- 3600, '/',  '', 0);
     }
diff -ruN 2.2.3a-Final.src/viewpmsg.php 2.2.6.src/viewpmsg.php
--- 2.2.3a-Final.src/viewpmsg.php	2005-04-23 03:55:39.000000000 -0500
+++ 2.2.6.src/viewpmsg.php	2006-01-22 16:34:51.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: viewpmsg.php,v 1.11.6.3 2005/04/23 09:55:39 mithyt2 Exp $
+// $Id: viewpmsg.php 184 2006-01-22 22:34:51Z skalpa $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
diff -ruN 2.2.3a-Final.src/xmlrpc.php 2.2.6.src/xmlrpc.php
--- 2.2.3a-Final.src/xmlrpc.php	2004-12-26 13:11:48.000000000 -0600
+++ 2.2.6.src/xmlrpc.php	2006-01-22 17:49:01.000000000 -0600
@@ -30,7 +30,7 @@
 include_once XOOPS_ROOT_PATH.'/class/xml/rpc/xmlrpctag.php';
 include_once XOOPS_ROOT_PATH.'/class/xml/rpc/xmlrpcparser.php';
 $response = new XoopsXmlRpcResponse();
-$parser = new XoopsXmlRpcParser($GLOBALS['HTTP_RAW_POST_DATA']);
+$parser = new XoopsXmlRpcParser(rawurldecode($GLOBALS['HTTP_RAW_POST_DATA']));
 if (!$parser->parse()) {
 	$response->add(new XoopsXmlRpcFault(102));
 } else {
diff -ruN 2.2.3a-Final.src/xoopsupdate.php 2.2.6.src/xoopsupdate.php
--- 2.2.3a-Final.src/xoopsupdate.php	2005-10-30 15:26:12.000000000 -0600
+++ 2.2.6.src/xoopsupdate.php	2007-12-09 07:50:42.000000000 -0600
@@ -5,6 +5,7 @@
     $sql = "SELECT c1.conf_id FROM ".$xoopsDB->prefix('config')." c1, ".$xoopsDB->prefix('config')." c2 WHERE
                 c1.conf_modid=c2.conf_modid AND c1.conf_name=c2.conf_name AND c1.conf_id > c2.conf_id";
     $result = $xoopsDB->query($sql);
+    $ids = array();
     while (list($id) = $xoopsDB->fetchRow($result)) {
         $ids[] = $id;
     }
