Index: /trunk/admin/versione.php
===================================================================
--- /trunk/admin/versione.php	(revision 231)
+++ /trunk/admin/versione.php	(revision 232)
@@ -1,7 +1,7 @@
 <?php
 
-$versione = "2.0 rev 231";
+$versione = "2.0 rev 232";
 $version_number = $versione;
-$version = "Eleonline $version_number (<i>Data Release: 17 maggio 2015</i>)";
+$version = "Eleonline $version_number (<i>Data Release: 18 maggio 2015</i>)";
 
 ?> 
Index: /trunk/client/class/db/db.php
===================================================================
--- /trunk/client/class/db/db.php	(revision 232)
+++ /trunk/client/class/db/db.php	(revision 232)
@@ -0,0 +1,98 @@
+<?php
+/***************************************************************************
+ *                                 db.php
+ *                            -------------------
+ *   begin                : Saturday, Feb 13, 2001
+ *   copyright            : (C) 2001 The phpBB Group
+ *   email                : support@phpbb.com
+ *
+ *   Id: db.php,v 1.10 2002/03/18 13:35:22 psotfx Exp
+ *
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This file is part of the phpBB2 port to Nuke 6.0 (c) copyright 2002
+ *   by Tom Nitzschner (tom@toms-home.com)
+ *   http://bbtonuke.sourceforge.net (or http://www.toms-home.com)
+ *
+ *   As always, make a backup before messing with anything. All code
+ *   release by me is considered sample code only. It may be fully
+ *   functual, but you use it at your own risk, if you break it,
+ *   you get to fix it too. No waranty is given or implied.
+ *
+ *   Please post all questions/request about this port on http://bbtonuke.sourceforge.net first,
+ *   then on my site. All original header code and copyright messages will be maintained
+ *   to give credit where credit is due. If you modify this, the only requirement is
+ *   that you also maintain all original copyright messages. All my work is released
+ *   under the GNU GENERAL PUBLIC LICENSE. Please see the README for more information.
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+/*
+if (stristr($_SERVER['PHP_SELF'], "db.php")) {
+    Header("Location: index.php");
+    die();
+}
+
+if (!defined('MODULE_FILE')) {
+    die ("Non puoi accedere al file direttamente...");
+}
+*/
+
+$the_include = "class/db"; // directory dove ci sono le classi
+
+switch($dbtype) {
+
+	case 'MySQL':
+		include("".$the_include."/mysql.php");
+		break;
+
+	case 'mysql4':
+		include("".$the_include."/mysql4.php");
+		break;
+
+	case 'sqlite':
+		include("".$the_include."/sqlite.php");
+		break;
+
+	case 'postgres':
+		include("".$the_include."/postgres7.php");
+		break;
+
+	case 'mssql':
+		include("".$the_include."/mssql.php");
+		break;
+
+	case 'oracle':
+		include("".$the_include."/oracle.php");
+		break;
+
+	case 'msaccess':
+		include("".$the_include."/msaccess.php");
+		break;
+
+	case 'mssql-odbc':
+		include("".$the_include."/mssql-odbc.php");
+		break;
+	
+	case 'db2':
+		include("".$the_include."/db2.php");
+		break;
+
+}
+
+$db = new sql_db($dbhost, $dbuname, $dbpass, $dbname, false);
+if(!$db->db_connect_id) {
+    die("<br><br><center><img src=images/logo.gif><br><br><b>There seems to be a problem with the $dbtype server, sorry for the inconvenience.<br><br>We should be back shortly.</center></b>");
+}
+
+?>
Index: /trunk/client/class/db/db2.php
===================================================================
--- /trunk/client/class/db/db2.php	(revision 232)
+++ /trunk/client/class/db/db2.php	(revision 232)
@@ -0,0 +1,421 @@
+<?php
+/***************************************************************************
+ *                                 db2.php
+ *                            -------------------
+ *   begin                : Saturday, Feb 13, 2001
+ *   copyright            : (C) 2001 The phpBB Group
+ *   email                : support@phpbb.com
+ *
+ *   $Id: db2.php,v 1.2 2002/01/28 17:24:45 psotfx Exp $
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+
+if(!defined("SQL_LAYER"))
+{
+
+define("SQL_LAYER","db2");
+
+class sql_db
+{
+
+	var $db_connect_id;
+	var $query_result;
+	var $query_resultset;
+	var $query_numrows;
+	var $next_id;
+	var $row = array();
+	var $rowset = array();
+	var $row_index;
+	var $num_queries = 0;
+
+	//
+	// Constructor
+	//
+	function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
+	{
+		$this->persistency = $persistency;
+		$this->user = $sqluser;
+		$this->password = $sqlpassword;
+		$this->dbname = $database;
+
+		$this->server = $sqlserver;
+
+		if($this->persistency)
+		{
+			$this->db_connect_id = odbc_pconnect($this->server, "", "");
+		}
+		else
+		{
+			$this->db_connect_id = odbc_connect($this->server, "", "");
+		}
+
+		if($this->db_connect_id)
+		{
+			@odbc_autocommit($this->db_connect_id, off);
+
+			return $this->db_connect_id;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	//
+	// Other base methods
+	//
+	function sql_close()
+	{
+		if($this->db_connect_id)
+		{
+			if($this->query_result)
+			{
+				@odbc_free_result($this->query_result);
+			}
+			$result = @odbc_close($this->db_connect_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+
+	//
+	// Query method
+	//
+	function sql_query($query = "", $transaction = FALSE)
+	{
+		//
+		// Remove any pre-existing queries
+		//
+		unset($this->query_result);
+		unset($this->row);
+		if($query != "")
+		{
+			$this->num_queries++;
+
+			if(!eregi("^INSERT ",$query))
+			{
+				if(eregi("LIMIT", $query))
+				{
+					preg_match("/^(.*)LIMIT ([0-9]+)[, ]*([0-9]+)*/s", $query, $limits);
+
+					$query = $limits[1];
+					if($limits[3])
+					{
+						$row_offset = $limits[2];
+						$num_rows = $limits[3];
+					}
+					else
+					{
+						$row_offset = 0;
+						$num_rows = $limits[2];
+					}
+
+					$query .= " FETCH FIRST ".($row_offset+$num_rows)." ROWS ONLY OPTIMIZE FOR ".($row_offset+$num_rows)." ROWS";
+
+					$this->query_result = odbc_exec($this->db_connect_id, $query);
+
+					$query_limit_offset = $row_offset;
+					$this->result_numrows[$this->query_result] = $num_rows;
+				}
+				else
+				{
+					$this->query_result = odbc_exec($this->db_connect_id, $query);
+
+					$row_offset = 0;
+					$this->result_numrows[$this->query_result] = 5E6;
+				}
+
+				$result_id = $this->query_result;
+				if($this->query_result && eregi("^SELECT", $query))
+				{
+
+					for($i = 1; $i < odbc_num_fields($result_id)+1; $i++)
+					{
+						$this->result_field_names[$result_id][] = odbc_field_name($result_id, $i);
+					}
+
+					$i =  $row_offset + 1;
+					$k = 0;
+					while(odbc_fetch_row($result_id, $i) && $k < $this->result_numrows[$result_id])
+					{
+
+						for($j = 1; $j < count($this->result_field_names[$result_id])+1; $j++)
+						{
+							$this->result_rowset[$result_id][$k][$this->result_field_names[$result_id][$j-1]] = odbc_result($result_id, $j);
+						}
+						$i++;
+						$k++;
+					}
+
+					$this->result_numrows[$result_id] = $k;
+					$this->row_index[$result_id] = 0;
+				}
+				else
+				{
+					$this->result_numrows[$result_id] = @odbc_num_rows($result_id);
+					$this->row_index[$result_id] = 0;
+				}
+			}
+			else
+			{
+				if(eregi("^(INSERT|UPDATE) ", $query))
+				{
+					$query = preg_replace("/\\\'/s", "''", $query);
+				}
+
+				$this->query_result = odbc_exec($this->db_connect_id, $query);
+
+				if($this->query_result)
+				{
+					$sql_id = "VALUES(IDENTITY_VAL_LOCAL())";
+
+					$id_result = odbc_exec($this->db_connect_id, $sql_id);
+					if($id_result)
+					{
+						$row_result = odbc_fetch_row($id_result);
+						if($row_result)
+						{
+							$this->next_id[$this->query_result] = odbc_result($id_result, 1);
+						}
+					}
+				}
+
+				odbc_commit($this->db_connect_id);
+
+				$this->query_limit_offset[$this->query_result] = 0;
+				$this->result_numrows[$this->query_result] = 0;
+			}
+
+			return $this->query_result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Other query methods
+	//
+	function sql_numrows($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			return $this->result_numrows[$query_id];
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_affectedrows($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			return $this->result_numrows[$query_id];
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_numfields($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = count($this->result_field_names[$query_id]);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fieldname($offset, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = $this->result_field_names[$query_id][$offset];
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fieldtype($offset, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @odbc_field_type($query_id, $offset);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fetchrow($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			if($this->row_index[$query_id] < $this->result_numrows[$query_id])
+			{
+				$result = $this->result_rowset[$query_id][$this->row_index[$query_id]];
+				$this->row_index[$query_id]++;
+				return $result;
+			}
+			else
+			{
+				return false;
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fetchrowset($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$this->row_index[$query_id] = $this->result_numrows[$query_id];
+			return $this->result_rowset[$query_id];
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fetchfield($field, $row = -1, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			if($row < $this->result_numrows[$query_id])
+			{
+				if($row == -1)
+				{
+					$getrow = $this->row_index[$query_id]-1;
+				}
+				else
+				{
+					$getrow = $row;
+				}
+
+				return $this->result_rowset[$query_id][$getrow][$this->result_field_names[$query_id][$field]];
+
+			}
+			else
+			{
+				return false;
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_rowseek($offset, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$this->row_index[$query_id] = 0;
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_nextid($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			return $this->next_id[$query_id];
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_freeresult($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @odbc_free_result($query_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_error($query_id = 0)
+	{
+//		$result['code'] = @odbc_error($this->db_connect_id);
+//		$result['message'] = @odbc_errormsg($this->db_connect_id);
+
+		return "";
+	}
+
+} // class sql_db
+
+} // if ... define
+
+?>
Index: /trunk/client/class/db/msaccess.php
===================================================================
--- /trunk/client/class/db/msaccess.php	(revision 232)
+++ /trunk/client/class/db/msaccess.php	(revision 232)
@@ -0,0 +1,389 @@
+<?php
+/***************************************************************************
+ *                               msaccess.php
+ *                            -------------------
+ *   begin                : Saturday, Feb 13, 2001
+ *   copyright            : (C) 2001 The phpBB Group
+ *   email                : support@phpbb.com
+ *
+ *   $Id: msaccess.php,v 1.8.2.1 2002/05/12 00:47:40 psotfx Exp $
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+
+if(!defined("SQL_LAYER"))
+{
+
+define("SQL_LAYER","msaccess");
+
+class sql_db
+{
+
+	var $db_connect_id;
+	var $result_ids = array();
+	var $result;
+
+	var $next_id;
+
+	var $num_rows = array();
+	var $current_row = array();
+	var $field_names = array();
+	var $field_types = array();
+	var $result_rowset = array();
+
+	var $num_queries = 0;
+
+	//
+	// Constructor
+	//
+	function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
+	{
+		$this->persistency = $persistency;
+		$this->server = $sqlserver;
+		$this->user = $sqluser;
+		$this->password = $sqlpassword;
+		$this->dbname = $database;
+
+		$this->db_connect_id = ($this->persistency) ? odbc_pconnect($this->server, $this->user, $this->password) : odbc_connect($this->server, $this->user, $this->password);
+
+		return ( $this->db_connect_id ) ? $this->db_connect_id : false;
+	}
+	//
+	// Other base methods
+	//
+	function sql_close()
+	{
+		if($this->db_connect_id)
+		{
+			if( $this->in_transaction )
+			{
+				@odbc_commit($this->db_connect_id);
+			}
+
+			if( count($this->result_rowset) )
+			{
+				unset($this->result_rowset);
+				unset($this->field_names);
+				unset($this->field_types);
+				unset($this->num_rows);
+				unset($this->current_row);
+			}
+
+			return @odbc_close($this->db_connect_id);
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Query method
+	//
+	function sql_query($query = "", $transaction = FALSE)
+	{
+		if( $query != "" )
+		{
+			$this->num_queries++;
+
+			if( $transaction == BEGIN_TRANSACTION && !$this->in_transaction )
+			{
+				if( !odbc_autocommit($this->db_connect_id, false) )
+				{
+					return false;
+				}
+				$this->in_transaction = TRUE;
+			}
+
+			$query = str_replace("LOWER(", "LCASE(", $query);
+
+			if( preg_match("/^SELECT(.*?)(LIMIT ([0-9]+)[, ]*([0-9]+)*)?$/s", $query, $limits) )
+			{
+				$query = $limits[1];
+
+				if( !empty($limits[2]) )
+				{
+					$row_offset = ( $limits[4] ) ? $limits[3] : "";
+					$num_rows = ( $limits[4] ) ? $limits[4] : $limits[3];
+
+					$query = "TOP " . ( $row_offset + $num_rows ) . $query;
+				}
+
+				$this->result = odbc_exec($this->db_connect_id, "SELECT $query"); 
+
+				if( $this->result )
+				{
+					if( empty($this->field_names[$this->result]) )
+					{
+						for($i = 1; $i < odbc_num_fields($this->result) + 1; $i++)
+						{
+							$this->field_names[$this->result][] = odbc_field_name($this->result, $i);
+							$this->field_types[$this->result][] = odbc_field_type($this->result, $i);
+						}
+					}
+
+					$this->current_row[$this->result] = 0;
+					$this->result_rowset[$this->result] = array();
+
+					$row_outer = ( isset($row_offset) ) ? $row_offset + 1 : 1;
+					$row_outer_max = ( isset($num_rows) ) ? $row_offset + $num_rows + 1 : 1E9;
+					$row_inner = 0;
+
+					while( odbc_fetch_row($this->result) && $row_outer < $row_outer_max )
+					{
+						for($j = 0; $j < count($this->field_names[$this->result]); $j++)
+						{
+							$this->result_rowset[$this->result][$row_inner][$this->field_names[$this->result][$j]] = stripslashes(odbc_result($this->result, $j + 1));
+						}
+
+						$row_outer++;
+						$row_inner++;
+					}
+
+					$this->num_rows[$this->result] = count($this->result_rowset[$this->result]);	
+
+					odbc_free_result($this->result);
+				}
+
+			}
+			else if( eregi("^INSERT ", $query) )
+			{
+				$this->result = odbc_exec($this->db_connect_id, $query);
+
+				if( $this->result )
+				{
+					$result_id = odbc_exec($this->db_connect_id, "SELECT @@IDENTITY");
+					if( $result_id )
+					{
+						if( odbc_fetch_row($result_id) )
+						{
+							$this->next_id[$this->db_connect_id] = odbc_result($result_id, 1);	
+							$this->affected_rows[$this->db_connect_id] = odbc_num_rows($this->result);
+						}
+					}
+				}
+			}
+			else
+			{
+				$this->result = odbc_exec($this->db_connect_id, $query);
+
+				if( $this->result )
+				{
+					$this->affected_rows[$this->db_connect_id] = odbc_num_rows($this->result);
+				}
+			}
+
+			if( !$this->result )
+			{
+				if( $this->in_transaction )
+				{
+					odbc_rollback($this->db_connect_id);
+					odbc_autocommit($this->db_connect_id, true);
+					$this->in_transaction = FALSE;
+				}
+
+				return false;
+			}
+
+			if( $transaction == END_TRANSACTION && $this->in_transaction )
+			{
+				$this->in_transaction = FALSE;
+
+				if ( !@odbc_commit($this->db_connect_id) )
+				{
+					odbc_rollback($this->db_connect_id);
+					odbc_autocommit($this->db_connect_id, true);
+					return false;
+				}
+				odbc_autocommit($this->db_connect_id, true);
+			}
+
+			return $this->result;
+		}
+		else
+		{
+			if( $transaction == END_TRANSACTION && $this->in_transaction )
+			{
+				$this->in_transaction = FALSE;
+
+				if ( !@odbc_commit($this->db_connect_id) )
+				{
+					odbc_rollback($this->db_connect_id);
+					odbc_autocommit($this->db_connect_id, true);
+					return false;
+				}
+				odbc_autocommit($this->db_connect_id, true);
+			}
+
+			return true;
+		}
+	}
+
+	//
+	// Other query methods
+	//
+	function sql_numrows($query_id = 0)
+	{
+		if( !$query_id ) 
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? $this->num_rows[$query_id] : false;
+	}
+
+	function sql_numfields($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? count($this->field_names[$query_id]) : false;
+	}
+
+	function sql_fieldname($offset, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? $this->field_names[$query_id][$offset] : false;
+	}
+
+	function sql_fieldtype($offset, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? $this->field_types[$query_id][$offset] : false;
+	}
+
+	function sql_fetchrow($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			return ( $this->num_rows[$query_id] && $this->current_row[$query_id] < $this->num_rows[$query_id] ) ? $this->result_rowset[$query_id][$this->current_row[$query_id]++] : false;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_fetchrowset($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			return ( $this->num_rows[$query_id] ) ? $this->result_rowset[$query_id] : false;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_fetchfield($field, $row = -1, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			if( $row < $this->num_rows[$query_id] )
+			{
+				$getrow = ($row == -1) ? $this->current_row[$query_id] - 1 : $row;
+
+				return $this->result_rowset[$query_id][$getrow][$this->field_names[$query_id][$field]];
+			}
+			else
+			{
+				return false;
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_rowseek($offset, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			$this->current_row[$query_id] = $offset - 1;
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_nextid()
+	{
+		return ( $this->next_id[$this->db_connect_id] ) ? $this->next_id[$this->db_connect_id] : false;
+	}
+
+	function sql_affectedrows()
+	{
+		return ( $this->affected_rows[$this->db_connect_id] ) ? $this->affected_rows[$this->db_connect_id] : false;
+	}
+
+	function sql_freeresult($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		unset($this->num_rows[$query_id]);
+		unset($this->current_row[$query_id]);
+		unset($this->result_rowset[$query_id]);
+		unset($this->field_names[$query_id]);
+		unset($this->field_types[$query_id]);
+
+		return true;
+	}
+
+	function sql_error()
+	{
+		$error['code'] = "";//odbc_error($this->db_connect_id);
+		$error['message'] = "Error";//odbc_errormsg($this->db_connect_id);
+
+		return $error;
+	}
+
+} // class sql_db
+
+} // if ... define
+
+?>
Index: /trunk/client/class/db/mssql-odbc.php
===================================================================
--- /trunk/client/class/db/mssql-odbc.php	(revision 232)
+++ /trunk/client/class/db/mssql-odbc.php	(revision 232)
@@ -0,0 +1,387 @@
+<?php
+/***************************************************************************
+ *                              mssql-odbc.php
+ *                            -------------------
+ *   begin                : Saturday, Feb 13, 2001
+ *   copyright            : (C) 2001 The phpBB Group
+ *   email                : support@phpbb.com
+ *
+ *   $Id: mssql-odbc.php,v 1.7 2002/03/20 17:48:30 psotfx Exp $
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+
+if(!defined("SQL_LAYER"))
+{
+
+define("SQL_LAYER","mssql-odbc");
+
+class sql_db
+{
+
+	var $db_connect_id;
+	var $result;
+
+	var $next_id;
+
+	var $num_rows = array();
+	var $current_row = array();
+	var $field_names = array();
+	var $field_types = array();
+	var $result_rowset = array();
+
+	var $num_queries = 0;
+
+	//
+	// Constructor
+	//
+	function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
+	{
+		$this->persistency = $persistency;
+		$this->server = $sqlserver;
+		$this->user = $sqluser;
+		$this->password = $sqlpassword;
+		$this->dbname = $database;
+
+		$this->db_connect_id = ($this->persistency) ? odbc_pconnect($this->server, $this->user, $this->password) : odbc_connect($this->server, $this->user, $this->password);
+
+		return ( $this->db_connect_id ) ? $this->db_connect_id : false;
+	}
+	//
+	// Other base methods
+	//
+	function sql_close()
+	{
+		if($this->db_connect_id)
+		{
+			if( $this->in_transaction )
+			{
+				@odbc_commit($this->db_connect_id);
+			}
+
+			if( count($this->result_rowset) )
+			{
+				unset($this->result_rowset);
+				unset($this->field_names);
+				unset($this->field_types);
+				unset($this->num_rows);
+				unset($this->current_row);
+			}
+
+			return @odbc_close($this->db_connect_id);
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Query method
+	//
+	function sql_query($query = "", $transaction = FALSE)
+	{
+		if( $query != "" )
+		{
+			$this->num_queries++;
+
+			if( $transaction == BEGIN_TRANSACTION && !$this->in_transaction )
+			{
+				if( !odbc_autocommit($this->db_connect_id, false) )
+				{
+					return false;
+				}
+				$this->in_transaction = TRUE;
+			}
+
+			if( preg_match("/^SELECT(.*?)(LIMIT ([0-9]+)[, ]*([0-9]+)*)?$/s", $query, $limits) )
+			{
+				$query = $limits[1];
+
+				if( !empty($limits[2]) )
+				{
+					$row_offset = ( $limits[4] ) ? $limits[3] : "";
+					$num_rows = ( $limits[4] ) ? $limits[4] : $limits[3];
+
+					$query = "TOP " . ( $row_offset + $num_rows ) . $query;
+				}
+
+				$this->result = odbc_exec($this->db_connect_id, "SELECT $query"); 
+
+				if( $this->result )
+				{
+					if( empty($this->field_names[$this->result]) )
+					{
+						for($i = 1; $i < odbc_num_fields($this->result) + 1; $i++)
+						{
+							$this->field_names[$this->result][] = odbc_field_name($this->result, $i);
+							$this->field_types[$this->result][] = odbc_field_type($this->result, $i);
+						}
+					}
+
+					$this->current_row[$this->result] = 0;
+					$this->result_rowset[$this->result] = array();
+
+					$row_outer = ( isset($row_offset) ) ? $row_offset + 1 : 1;
+					$row_outer_max = ( isset($num_rows) ) ? $row_offset + $num_rows + 1 : 1E9;
+					$row_inner = 0;
+
+					while( odbc_fetch_row($this->result, $row_outer) && $row_outer < $row_outer_max )
+					{
+						for($j = 0; $j < count($this->field_names[$this->result]); $j++)
+						{
+							$this->result_rowset[$this->result][$row_inner][$this->field_names[$this->result][$j]] = stripslashes(odbc_result($this->result, $j + 1));
+						}
+
+						$row_outer++;
+						$row_inner++;
+					}
+
+					$this->num_rows[$this->result] = count($this->result_rowset[$this->result]);	
+				}
+
+			}
+			else if( eregi("^INSERT ", $query) )
+			{
+				$this->result = odbc_exec($this->db_connect_id, $query);
+
+				if( $this->result )
+				{
+					$result_id = odbc_exec($this->db_connect_id, "SELECT @@IDENTITY");
+					if( $result_id )
+					{
+						if( odbc_fetch_row($result_id) )
+						{
+							$this->next_id[$this->db_connect_id] = odbc_result($result_id, 1);	
+							$this->affected_rows[$this->db_connect_id] = odbc_num_rows($this->result);
+						}
+					}
+				}
+			}
+			else
+			{
+				$this->result = odbc_exec($this->db_connect_id, $query);
+
+				if( $this->result )
+				{
+					$this->affected_rows[$this->db_connect_id] = odbc_num_rows($this->result);
+				}
+			}
+
+			if( !$this->result )
+			{
+				if( $this->in_transaction )
+				{
+					odbc_rollback($this->db_connect_id);
+					odbc_autocommit($this->db_connect_id, true);
+					$this->in_transaction = FALSE;
+				}
+
+				return false;
+			}
+
+			if( $transaction == END_TRANSACTION && $this->in_transaction )
+			{
+				$this->in_transaction = FALSE;
+
+				if ( !odbc_commit($this->db_connect_id) )
+				{
+					odbc_rollback($this->db_connect_id);
+					odbc_autocommit($this->db_connect_id, true);
+					return false;
+				}
+				odbc_autocommit($this->db_connect_id, true);
+			}
+
+			odbc_free_result($this->result);
+
+			return $this->result;
+		}
+		else
+		{
+			if( $transaction == END_TRANSACTION && $this->in_transaction )
+			{
+				$this->in_transaction = FALSE;
+
+				if ( !@odbc_commit($this->db_connect_id) )
+				{
+					odbc_rollback($this->db_connect_id);
+					odbc_autocommit($this->db_connect_id, true);
+					return false;
+				}
+				odbc_autocommit($this->db_connect_id, true);
+			}
+
+			return true;
+		}
+	}
+
+	//
+	// Other query methods
+	//
+	function sql_numrows($query_id = 0)
+	{
+		if( !$query_id ) 
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? $this->num_rows[$query_id] : false;
+	}
+
+	function sql_numfields($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? count($this->field_names[$query_id]) : false;
+	}
+
+	function sql_fieldname($offset, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? $this->field_names[$query_id][$offset] : false;
+	}
+
+	function sql_fieldtype($offset, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? $this->field_types[$query_id][$offset] : false;
+	}
+
+	function sql_fetchrow($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			return ( $this->num_rows[$query_id] && $this->current_row[$query_id] < $this->num_rows[$query_id] ) ? $this->result_rowset[$query_id][$this->current_row[$query_id]++] : false;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_fetchrowset($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			return ( $this->num_rows[$query_id] ) ? $this->result_rowset[$query_id] : false;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_fetchfield($field, $row = -1, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			if( $row < $this->num_rows[$query_id] )
+			{
+				$getrow = ( $row == -1 ) ? $this->current_row[$query_id] - 1 : $row;
+
+				return $this->result_rowset[$query_id][$getrow][$this->field_names[$query_id][$field]];
+
+			}
+			else
+			{
+				return false;
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_rowseek($offset, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			$this->current_row[$query_id] = $offset - 1;
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_nextid()
+	{
+		return ( $this->next_id[$this->db_connect_id] ) ? $this->next_id[$this->db_connect_id] : false;
+	}
+
+	function sql_affectedrows()
+	{
+		return ( $this->affected_rows[$this->db_connect_id] ) ? $this->affected_rows[$this->db_connect_id] : false;
+	}
+
+	function sql_freeresult($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		unset($this->num_rows[$query_id]);
+		unset($this->current_row[$query_id]);
+		unset($this->result_rowset[$query_id]);
+		unset($this->field_names[$query_id]);
+		unset($this->field_types[$query_id]);
+
+		return true;
+	}
+
+	function sql_error()
+	{
+		$error['code'] = odbc_error($this->db_connect_id);
+		$error['message'] = odbc_errormsg($this->db_connect_id);
+
+		return $error;
+	}
+
+} // class sql_db
+
+} // if ... define
+
+?>
Index: /trunk/client/class/db/mssql.php
===================================================================
--- /trunk/client/class/db/mssql.php	(revision 232)
+++ /trunk/client/class/db/mssql.php	(revision 232)
@@ -0,0 +1,418 @@
+<?php
+/***************************************************************************
+ *                                 mssql.php
+ *                            -------------------
+ *   begin                : Saturday, Feb 13, 2001
+ *   copyright            : (C) 2001 The phpBB Group
+ *   email                : supportphpbb.com
+ *
+ *   Id: mssql.php,v 1.22.2.4 2006/03/09 19:57:37 grahamje Exp $
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+
+if(!defined("SQL_LAYER"))
+{
+
+define("SQL_LAYER","mssql");
+
+class sql_db
+{
+
+	var $db_connect_id;
+	var $result;
+
+	var $next_id;
+	var $in_transaction = 0;
+
+	var $row = array();
+	var $rowset = array();
+	var $limit_offset;
+	var $query_limit_success;
+
+	var $num_queries = 0;
+
+	//
+	// Constructor
+	//
+	function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
+	{
+		$this->persistency = $persistency;
+		$this->user = $sqluser;
+		$this->password = $sqlpassword;
+		$this->server = $sqlserver;
+		$this->dbname = $database;
+
+		$this->db_connect_id = ( $this->persistency ) ? @mssql_pconnect($this->server, $this->user, $this->password) : @mssql_connect($this->server, $this->user, $this->password);
+
+		if( $this->db_connect_id && $this->dbname != "" )
+		{
+			if( !mssql_select_db($this->dbname, $this->db_connect_id) )
+			{
+				mssql_close($this->db_connect_id);
+				return false;
+			}
+		}
+
+		return $this->db_connect_id;
+	}
+
+	//
+	// Other base methods
+	//
+	function sql_close()
+	{
+		if($this->db_connect_id)
+		{
+			//
+			// Commit any remaining transactions
+			//
+			if( $this->in_transaction )
+			{
+				@mssql_query("COMMIT", $this->db_connect_id);
+			}
+
+			return @mssql_close($this->db_connect_id);
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+
+	//
+	// Query method
+	//
+	function sql_query($query = '', $transaction = FALSE)
+	{
+		//
+		// Remove any pre-existing queries
+		//
+		unset($this->result);
+		unset($this->row);
+
+		if ( $query != '' )
+		{
+			$this->num_queries++;
+
+			if ( $transaction == BEGIN_TRANSACTION && !$this->in_transaction )
+			{
+				if ( !@mssql_query('BEGIN TRANSACTION', $this->db_connect_id) )
+				{
+					return false;
+				}
+				$this->in_transaction = TRUE;
+			}
+
+			//
+			// Does query contain any LIMIT code? If so pull out relevant start and num_results
+			// This isn't terribly easy with MSSQL, whatever you do will potentially impact
+			// performance compared to an 'in-built' limit
+			//
+			// Another issue is the 'lack' of a returned true value when a query is valid but has
+			// no result set (as with all the other DB interfaces). It seems though that it's
+			// 'fair' to say that if a query returns a false result (ie. no resource id) then the
+			// SQL was valid but had no result set. If the query returns nothing but the rowcount
+			// returns something then there's a problem. This may well be a false assumption though
+			// ... needs checking under Windows itself.
+			//
+			if( preg_match('#^SELECT(.*?)(LIMIT ([0-9]+)[, ]*([0-9]+)*)?$#s', $query, $limits) )
+			{
+				$query = $limits[1];
+
+				if( !empty($limits[2]) )
+				{
+					$row_offset = ( $limits[4] ) ? $limits[3] : "";
+					$num_rows = ( $limits[4] ) ? $limits[4] : $limits[3];
+
+					$query = 'TOP ' . ( $row_offset + $num_rows ) . $query;
+				}
+
+				$this->result = @mssql_query("SELECT $query", $this->db_connect_id); 
+
+				if( $this->result )
+				{
+					$this->limit_offset[$this->result] = ( !empty($row_offset) ) ? $row_offset : 0;
+
+					if( $row_offset > 0 )
+					{
+						@mssql_data_seek($this->result, $row_offset);
+					}
+				}
+			}
+			else if( preg_match('#^INSERT #i', $query) )
+			{
+				if( @mssql_query($query, $this->db_connect_id) )
+				{
+					$this->result = time() + microtime();
+
+					$result_id = @mssql_query('SELECT @@IDENTITY AS id, @@ROWCOUNT as affected', $this->db_connect_id);
+					if( $result_id )
+					{
+						if( $row = @mssql_fetch_array($result_id) )
+						{
+							$this->next_id[$this->db_connect_id] = $row['id'];	
+							$this->affected_rows[$this->db_connect_id] = $row['affected'];
+						}
+					}
+				}
+			}
+			else
+			{
+				if( @mssql_query($query, $this->db_connect_id) )
+				{
+					$this->result = time() + microtime();
+
+					$result_id = @mssql_query('SELECT @@ROWCOUNT as affected', $this->db_connect_id);
+					if( $result_id )
+					{
+						if( $row = @mssql_fetch_array($result_id) )
+						{
+							$this->affected_rows[$this->db_connect_id] = $row['affected'];
+						}
+					}
+				}
+			}
+
+			if( !$this->result )
+			{
+				if( $this->in_transaction )
+				{
+					@mssql_query('ROLLBACK', $this->db_connect_id);
+					$this->in_transaction = FALSE;
+				}
+
+				return false;
+			}
+
+			if( $transaction == END_TRANSACTION && $this->in_transaction )
+			{
+				$this->in_transaction = FALSE;
+
+				if( !@mssql_query('COMMIT', $this->db_connect_id) )
+				{
+					@mssql_query("ROLLBACK", $this->db_connect_id);
+					return false;
+				}
+			}
+
+			return $this->result;
+		}
+		else
+		{
+			if( $transaction == END_TRANSACTION && $this->in_transaction  )
+			{
+				$this->in_transaction = FALSE;
+
+				if( !@mssql_query('COMMIT', $this->db_connect_id) )
+				{
+					@mssql_query('ROLLBACK', $this->db_connect_id);
+					return false;
+				}
+			}
+
+			return true;
+		}
+	}
+
+	//
+	// Other query methods
+	//
+	function sql_numrows($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			return ( !empty($this->limit_offset[$query_id]) ) ? @mssql_num_rows($query_id) - $this->limit_offset[$query_id] : @mssql_num_rows($query_id);
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_numfields($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? @mssql_num_fields($query_id) : false;
+	}
+
+	function sql_fieldname($offset, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? @mssql_field_name($query_id, $offset) : false;
+	}
+
+	function sql_fieldtype($offset, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? @mssql_field_type($query_id, $offset) : false;
+	}
+
+	function sql_fetchrow($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			empty($row);
+
+			$row = @mssql_fetch_array($query_id);
+
+			while( list($key, $value) = @each($row) )
+			{
+				$row[$key] = ($value === ' ') ? '' : stripslashes($value);
+			}
+			@reset($row);
+
+			return $row;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_fetchrowset($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			$i = 0;
+			empty($rowset);
+
+			while( $row = @mssql_fetch_array($query_id))
+			{
+				while( list($key, $value) = @each($row) )
+				{
+					$rowset[$i][$key] = ($value === ' ') ? '' : stripslashes($value);
+				}
+				$i++;
+			}
+			@reset($rowset);
+
+			return $rowset;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_fetchfield($field, $row = -1, $query_id)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			if( $row != -1 )
+			{
+				if( $this->limit_offset[$query_id] > 0 )
+				{
+					$result = ( !empty($this->limit_offset[$query_id]) ) ? @mssql_result($this->result, ($this->limit_offset[$query_id] + $row), $field) : false;
+				}
+				else
+				{
+					$result = @mssql_result($this->result, $row, $field);
+				}
+			}
+			else
+			{
+				if( empty($this->row[$query_id]) )
+				{
+					$this->row[$query_id] = @mssql_fetch_array($query_id);
+					$result = ($this->row[$query_id][$field] === ' ') ? '' : stripslashes($this->row[$query_id][$field]);
+				}
+			}
+
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_rowseek($rownum, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		if( $query_id )
+		{
+			return ( !empty($this->limit_offset[$query_id]) ) ? @mssql_data_seek($query_id, ($this->limit_offset[$query_id] + $rownum)) : @mssql_data_seek($query_id, $rownum);
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_nextid()
+	{
+		return ( $this->next_id[$this->db_connect_id] ) ? $this->next_id[$this->db_connect_id] : false;
+	}
+
+	function sql_affectedrows()
+	{
+		return ( $this->affected_rows[$this->db_connect_id] ) ? $this->affected_rows[$this->db_connect_id] : false;
+	}
+
+	function sql_freeresult($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->result;
+		}
+
+		return ( $query_id ) ? @mssql_free_result($query_id) : false;
+	}
+
+	function sql_error($query_id = 0)
+	{
+		$result['message'] = @mssql_get_last_message();
+		return $result;
+	}
+
+} // class sql_db
+
+} // if ... define
+
+?>
Index: /trunk/client/class/db/mysql.php
===================================================================
--- /trunk/client/class/db/mysql.php	(revision 232)
+++ /trunk/client/class/db/mysql.php	(revision 232)
@@ -0,0 +1,344 @@
+<?php
+/***************************************************************************
+ *                                 mysql.php
+ *                            -------------------
+ *   begin                : Saturday, Feb 13, 2001
+ *   copyright            : (C) 2001 The phpBB Group
+ *   email                : support@phpbb.com
+ *
+ *   $Id: mysql.php,v 1.16 2002/03/19 01:07:36 psotfx Exp $
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+
+if(!defined("SQL_LAYER"))
+{
+
+define("SQL_LAYER","mysql");
+
+class sql_db
+{
+
+	var $db_connect_id;
+	var $query_result;
+	var $row = array();
+	var $rowset = array();
+	var $num_queries = 0;
+
+	//
+	// Constructor
+	//
+	function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
+	{
+
+		$this->persistency = $persistency;
+		$this->user = $sqluser;
+		$this->password = $sqlpassword;
+		$this->server = $sqlserver;
+		$this->dbname = $database;
+
+		if($this->persistency)
+		{
+			$this->db_connect_id = @mysql_pconnect($this->server, $this->user, $this->password);
+		}
+		else
+		{
+			$this->db_connect_id = @mysql_connect($this->server, $this->user, $this->password);
+		}
+		if($this->db_connect_id)
+		{
+			if($database != "")
+			{
+				$this->dbname = $database;
+				$dbselect = @mysql_select_db($this->dbname);
+				if(!$dbselect)
+				{
+					@mysql_close($this->db_connect_id);
+					$this->db_connect_id = $dbselect;
+				}
+			}
+			return $this->db_connect_id;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Other base methods
+	//
+	function sql_close()
+	{
+		if($this->db_connect_id)
+		{
+			if($this->query_result)
+			{
+				@mysql_free_result($this->query_result);
+			}
+			$result = @mysql_close($this->db_connect_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Base query method
+	//
+	function sql_query($query = "", $transaction = FALSE)
+	{
+		// Remove any pre-existing queries
+		unset($this->query_result);
+		if($query != "")
+                {
+
+			$this->query_result = @mysql_query($query, $this->db_connect_id);
+
+		}
+		if($this->query_result)
+		{
+			unset($this->row[$this->query_result]);
+			unset($this->rowset[$this->query_result]);
+			return $this->query_result;
+		}
+		else
+		{
+			//return ( $transaction == END_TRANSACTION ) ? true : false;
+		}
+	}
+
+	//
+	// Other query methods
+	//
+	function sql_numrows($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @mysql_num_rows($query_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_affectedrows()
+	{
+		if($this->db_connect_id)
+		{
+			$result = @mysql_affected_rows($this->db_connect_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_numfields($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @mysql_num_fields($query_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fieldname($offset, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @mysql_field_name($query_id, $offset);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fieldtype($offset, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @mysql_field_type($query_id, $offset);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fetchrow($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$this->row[$query_id] = @mysql_fetch_array($query_id);
+			return $this->row[$query_id];
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fetchrowset($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			unset($this->rowset[$query_id]);
+			unset($this->row[$query_id]);
+			while($this->rowset[$query_id] = @mysql_fetch_array($query_id))
+			{
+				$result[] = $this->rowset[$query_id];
+			}
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fetchfield($field, $rownum = -1, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			if($rownum > -1)
+			{
+				$result = @mysql_result($query_id, $rownum, $field);
+			}
+			else
+			{
+				if(empty($this->row[$query_id]) && empty($this->rowset[$query_id]))
+				{
+					if($this->sql_fetchrow())
+					{
+						$result = $this->row[$query_id][$field];
+					}
+				}
+				else
+				{
+					if($this->rowset[$query_id])
+					{
+						$result = $this->rowset[$query_id][$field];
+					}
+					else if($this->row[$query_id])
+					{
+						$result = $this->row[$query_id][$field];
+					}
+				}
+			}
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_rowseek($rownum, $query_id = 0){
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @mysql_data_seek($query_id, $rownum);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_nextid(){
+		if($this->db_connect_id)
+		{
+			$result = @mysql_insert_id($this->db_connect_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_freeresult($query_id = 0){
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+
+		if ( $query_id )
+		{
+			unset($this->row[$query_id]);
+			unset($this->rowset[$query_id]);
+
+			@mysql_free_result($query_id);
+
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_error($query_id = 0)
+	{
+		$result["message"] = @mysql_error($this->db_connect_id);
+		$result["code"] = @mysql_errno($this->db_connect_id);
+
+		return $result;
+	}
+
+function sql_data_seek($query_id = 0)
+	{
+		# da implementare
+
+		return $result;
+	}
+
+
+
+} // class sql_db
+
+} // if ... define
+
+?>
Index: /trunk/client/class/db/mysql.php~
===================================================================
--- /trunk/client/class/db/mysql.php~	(revision 232)
+++ /trunk/client/class/db/mysql.php~	(revision 232)
@@ -0,0 +1,344 @@
+<?php
+/***************************************************************************
+ *                                 mysql.php
+ *                            -------------------
+ *   begin                : Saturday, Feb 13, 2001
+ *   copyright            : (C) 2001 The phpBB Group
+ *   email                : support@phpbb.com
+ *
+ *   $Id: mysql.php,v 1.16 2002/03/19 01:07:36 psotfx Exp $
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+
+if(!defined("SQL_LAYER"))
+{
+
+define("SQL_LAYER","mysql");
+
+class sql_db
+{
+
+	var $db_connect_id;
+	var $query_result;
+	var $row = array();
+	var $rowset = array();
+	var $num_queries = 0;
+
+	//
+	// Constructor
+	//
+	function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
+	{
+
+		$this->persistency = $persistency;
+		$this->user = $sqluser;
+		$this->password = $sqlpassword;
+		$this->server = $sqlserver;
+		$this->dbname = $database;
+
+		if($this->persistency)
+		{
+			$this->db_connect_id = @mysql_pconnect($this->server, $this->user, $this->password);
+		}
+		else
+		{
+			$this->db_connect_id = @mysql_connect($this->server, $this->user, $this->password);
+		}
+		if($this->db_connect_id)
+		{
+			if($database != "")
+			{
+				$this->dbname = $database;
+				$dbselect = @mysql_select_db($this->dbname);
+				if(!$dbselect)
+				{
+					@mysql_close($this->db_connect_id);
+					$this->db_connect_id = $dbselect;
+				}
+			}
+			return $this->db_connect_id;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Other base methods
+	//
+	function sql_close()
+	{
+		if($this->db_connect_id)
+		{
+			if($this->query_result)
+			{
+				@mysql_free_result($this->query_result);
+			}
+			$result = @mysql_close($this->db_connect_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Base query method
+	//
+	function sql_query($query = "", $transaction = FALSE)
+	{
+		// Remove any pre-existing queries
+		unset($this->query_result);
+		if($query != "")
+                {
+
+			$this->query_result = @mysql_query($query, $this->db_connect_id);
+
+		}
+		if($this->query_result)
+		{
+			unset($this->row[$this->query_result]);
+			unset($this->rowset[$this->query_result]);
+			return $this->query_result;
+		}
+		else
+		{
+			return ( $transaction == END_TRANSACTION ) ? true : false;
+		}
+	}
+
+	//
+	// Other query methods
+	//
+	function sql_numrows($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @mysql_num_rows($query_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_affectedrows()
+	{
+		if($this->db_connect_id)
+		{
+			$result = @mysql_affected_rows($this->db_connect_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_numfields($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @mysql_num_fields($query_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fieldname($offset, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @mysql_field_name($query_id, $offset);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fieldtype($offset, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @mysql_field_type($query_id, $offset);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fetchrow($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$this->row[$query_id] = @mysql_fetch_array($query_id);
+			return $this->row[$query_id];
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fetchrowset($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			unset($this->rowset[$query_id]);
+			unset($this->row[$query_id]);
+			while($this->rowset[$query_id] = @mysql_fetch_array($query_id))
+			{
+				$result[] = $this->rowset[$query_id];
+			}
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fetchfield($field, $rownum = -1, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			if($rownum > -1)
+			{
+				$result = @mysql_result($query_id, $rownum, $field);
+			}
+			else
+			{
+				if(empty($this->row[$query_id]) && empty($this->rowset[$query_id]))
+				{
+					if($this->sql_fetchrow())
+					{
+						$result = $this->row[$query_id][$field];
+					}
+				}
+				else
+				{
+					if($this->rowset[$query_id])
+					{
+						$result = $this->rowset[$query_id][$field];
+					}
+					else if($this->row[$query_id])
+					{
+						$result = $this->row[$query_id][$field];
+					}
+				}
+			}
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_rowseek($rownum, $query_id = 0){
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @mysql_data_seek($query_id, $rownum);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_nextid(){
+		if($this->db_connect_id)
+		{
+			$result = @mysql_insert_id($this->db_connect_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_freeresult($query_id = 0){
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+
+		if ( $query_id )
+		{
+			unset($this->row[$query_id]);
+			unset($this->rowset[$query_id]);
+
+			@mysql_free_result($query_id);
+
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_error($query_id = 0)
+	{
+		$result["message"] = @mysql_error($this->db_connect_id);
+		$result["code"] = @mysql_errno($this->db_connect_id);
+
+		return $result;
+	}
+
+function sql_data_seek($query_id = 0)
+	{
+		
+
+		return $result;
+	}
+
+
+
+} // class sql_db
+
+} // if ... define
+
+?>
Index: /trunk/client/class/db/mysql4.php
===================================================================
--- /trunk/client/class/db/mysql4.php	(revision 232)
+++ /trunk/client/class/db/mysql4.php	(revision 232)
@@ -0,0 +1,340 @@
+<?php
+/***************************************************************************
+ *                                 mysql4.php
+ *                            -------------------
+ *   begin                : Saturday, Feb 13, 2001
+ *   copyright            : (C) 2001 The phpBB Group
+ *   email                : supportphpbb.com
+ *
+ *   $Id: mysql4.php,v 1.5 2002/04/02 21:13:47 the_systech Exp $
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+
+if(!defined("SQL_LAYER"))
+{
+
+define("SQL_LAYER","mysql4");
+
+class sql_db
+{
+
+	var $db_connect_id;
+	var $query_result;
+	var $row = array();
+	var $rowset = array();
+	var $num_queries = 0;
+	var $in_transaction = 0;
+
+	//
+	// Constructor
+	//
+	function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
+	{
+		$this->persistency = $persistency;
+		$this->user = $sqluser;
+		$this->password = $sqlpassword;
+		$this->server = $sqlserver;
+		$this->dbname = $database;
+
+		$this->db_connect_id = ($this->persistency) ? mysql_pconnect($this->server, $this->user, $this->password) : mysql_connect($this->server, $this->user, $this->password);
+
+		if( $this->db_connect_id )
+		{
+			if( $database != "" )
+			{
+				$this->dbname = $database;
+				$dbselect = mysql_select_db($this->dbname);
+
+				if( !$dbselect )
+				{
+					mysql_close($this->db_connect_id);
+					$this->db_connect_id = $dbselect;
+				}
+			}
+
+			return $this->db_connect_id;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Other base methods
+	//
+	function sql_close()
+	{
+		if( $this->db_connect_id )
+		{
+			//
+			// Commit any remaining transactions
+			//
+			if( $this->in_transaction )
+			{
+				mysql_query("COMMIT", $this->db_connect_id);
+			}
+
+			return mysql_close($this->db_connect_id);
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Base query method
+	//
+	function sql_query($query = "", $transaction = FALSE)
+	{
+		//
+		// Remove any pre-existing queries
+		//
+		unset($this->query_result);
+
+		if( $query != "" )
+		{
+			$this->num_queries++;
+			if( $transaction == BEGIN_TRANSACTION && !$this->in_transaction )
+			{
+				$result = mysql_query("BEGIN", $this->db_connect_id);
+				if(!$result)
+				{
+					return false;
+				}
+				$this->in_transaction = TRUE;
+			}
+
+			$this->query_result = mysql_query($query, $this->db_connect_id);
+		}
+		else
+		{
+			if( $transaction == END_TRANSACTION && $this->in_transaction )
+			{
+				$result = mysql_query("COMMIT", $this->db_connect_id);
+			}
+		}
+
+		if( $this->query_result )
+		{
+			unset($this->row[$this->query_result]);
+			unset($this->rowset[$this->query_result]);
+
+			if( $transaction == END_TRANSACTION && $this->in_transaction )
+			{
+				$this->in_transaction = FALSE;
+
+				if ( !mysql_query("COMMIT", $this->db_connect_id) )
+				{
+					mysql_query("ROLLBACK", $this->db_connect_id);
+					return false;
+				}
+			}
+			
+			return $this->query_result;
+		}
+		else
+		{
+			if( $this->in_transaction )
+			{
+				mysql_query("ROLLBACK", $this->db_connect_id);
+				$this->in_transaction = FALSE;
+			}
+			return false;
+		}
+	}
+
+	//
+	// Other query methods
+	//
+	function sql_numrows($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ( $query_id ) ? mysql_num_rows($query_id) : false;
+	}
+
+	function sql_affectedrows()
+	{
+		return ( $this->db_connect_id ) ? mysql_affected_rows($this->db_connect_id) : false;
+	}
+
+	function sql_numfields($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ( $query_id ) ? mysql_num_fields($query_id) : false;
+	}
+
+	function sql_fieldname($offset, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ( $query_id ) ? mysql_field_name($query_id, $offset) : false;
+	}
+
+	function sql_fieldtype($offset, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ( $query_id ) ? mysql_field_type($query_id, $offset) : false;
+	}
+
+	function sql_fetchrow($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		if( $query_id )
+		{
+			$this->row[$query_id] = mysql_fetch_array($query_id, MYSQL_ASSOC);
+			return $this->row[$query_id];
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_fetchrowset($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		if( $query_id )
+		{
+			unset($this->rowset[$query_id]);
+			unset($this->row[$query_id]);
+
+			while($this->rowset[$query_id] = mysql_fetch_array($query_id, MYSQL_ASSOC))
+			{
+				$result[] = $this->rowset[$query_id];
+			}
+
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_fetchfield($field, $rownum = -1, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		if( $query_id )
+		{
+			if( $rownum > -1 )
+			{
+				$result = mysql_result($query_id, $rownum, $field);
+			}
+			else
+			{
+				if( empty($this->row[$query_id]) && empty($this->rowset[$query_id]) )
+				{
+					if( $this->sql_fetchrow() )
+					{
+						$result = $this->row[$query_id][$field];
+					}
+				}
+				else
+				{
+					if( $this->rowset[$query_id] )
+					{
+						$result = $this->rowset[$query_id][$field];
+					}
+					else if( $this->row[$query_id] )
+					{
+						$result = $this->row[$query_id][$field];
+					}
+				}
+			}
+
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_rowseek($rownum, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ( $query_id ) ? mysql_data_seek($query_id, $rownum) : false;
+	}
+
+	function sql_nextid()
+	{
+		return ( $this->db_connect_id ) ? mysql_insert_id($this->db_connect_id) : false;
+	}
+
+	function sql_freeresult($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		if ( $query_id )
+		{
+			unset($this->row[$query_id]);
+			unset($this->rowset[$query_id]);
+
+			mysql_free_result($query_id);
+
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_error()
+	{
+		$result['message'] = mysql_error($this->db_connect_id);
+		$result['code'] = mysql_errno($this->db_connect_id);
+
+		return $result;
+	}
+
+} // class sql_db
+
+} // if ... define
+
+?>
Index: /trunk/client/class/db/oracle.php
===================================================================
--- /trunk/client/class/db/oracle.php	(revision 232)
+++ /trunk/client/class/db/oracle.php	(revision 232)
@@ -0,0 +1,472 @@
+<?php
+/***************************************************************************
+ *                                oracle.php
+ *                            -------------------
+ *   begin                : Thrusday Feb 15, 2001
+ *   copyright            : (C) 2001 The phpBB Group
+ *   email                : support@phpbb.com
+ *
+ *   $Id: oracle.php,v 1.18 2002/01/28 17:24:45 psotfx Exp $
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+
+if(!defined("SQL_LAYER"))
+{
+
+define("SQL_LAYER","oracle");
+
+class sql_db
+{
+
+	var $db_connect_id;
+	var $query_result;
+	var $in_transaction = 0;
+	var $row = array();
+	var $rowset = array();
+	var $num_queries = 0;
+	var $last_query_text = "";
+
+	//
+	// Constructor
+	//
+	function sql_db($sqlserver, $sqluser, $sqlpassword, $database="", $persistency = true)
+	{
+		$this->persistency = $persistency;
+		$this->user = $sqluser;
+		$this->password = $sqlpassword;
+		$this->server = $sqlserver;
+		$this->dbname = $database;
+
+		if($this->persistency)
+		{
+			$this->db_connect_id = @OCIPLogon($this->user, $this->password, $this->server);
+		}
+		else
+		{
+			$this->db_connect_id = @OCINLogon($this->user, $this->password, $this->server);
+		}
+		if($this->db_connect_id)
+		{
+			return $this->db_connect_id;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Other base methods
+	//
+	function sql_close()
+	{
+		if($this->db_connect_id)
+		{
+			// Commit outstanding transactions
+			if($this->in_transaction)
+			{
+				OCICommit($this->db_connect_id);
+			}
+
+			if($this->query_result)
+			{
+				@OCIFreeStatement($this->query_result);
+			}
+			$result = @OCILogoff($this->db_connect_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Base query method
+	//
+	function sql_query($query = "", $transaction = FALSE)
+	{
+		// Remove any pre-existing queries
+		unset($this->query_result);
+
+		// Put us in transaction mode because with Oracle as soon as you make a query you're in a transaction
+		$this->in_transaction = TRUE;
+
+		if($query != "")
+		{
+			$this->last_query = $query;
+			$this->num_queries++;
+
+			if(eregi("LIMIT", $query))
+			{
+				preg_match("/^(.*)LIMIT ([0-9]+)[, ]*([0-9]+)*/s", $query, $limits);
+
+				$query = $limits[1];
+				if($limits[3])
+				{
+					$row_offset = $limits[2];
+					$num_rows = $limits[3];
+				}
+				else
+				{
+					$row_offset = 0;
+					$num_rows = $limits[2];
+				}
+			}
+
+			if(eregi("^(INSERT|UPDATE) ", $query))
+			{
+				$query = preg_replace("/\\\'/s", "''", $query);
+			}
+
+			$this->query_result = @OCIParse($this->db_connect_id, $query);
+			$success = @OCIExecute($this->query_result, OCI_DEFAULT);
+		}
+		if($success)
+		{
+			if($transaction == END_TRANSACTION)
+			{
+				OCICommit($this->db_connect_id);
+				$this->in_transaction = FALSE;
+			}
+
+			unset($this->row[$this->query_result]);
+			unset($this->rowset[$this->query_result]);
+			$this->last_query_text[$this->query_result] = $query;
+
+			return $this->query_result;
+		}
+		else
+		{
+			if($this->in_transaction)
+			{
+				OCIRollback($this->db_connect_id);
+			}
+			return false;
+		}
+	}
+
+	//
+	// Other query methods
+	//
+	function sql_numrows($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @OCIFetchStatement($query_id, $this->rowset);
+			// OCIFetchStatment kills our query result so we have to execute the statment again
+			// if we ever want to use the query_id again.
+			@OCIExecute($query_id, OCI_DEFAULT);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_affectedrows($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @OCIRowCount($query_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_numfields($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @OCINumCols($query_id);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fieldname($offset, $query_id = 0)
+	{
+		// OCIColumnName uses a 1 based array so we have to up the offset by 1 in here to maintain
+		// full abstraction compatibitly
+		$offset += 1;
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = strtolower(@OCIColumnName($query_id, $offset));
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fieldtype($offset, $query_id = 0)
+	{
+		// This situation is the same as fieldname
+		$offset += 1;
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result = @OCIColumnType($query_id, $offset);
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fetchrow($query_id = 0, $debug = FALSE)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$result_row = "";
+			$result = @OCIFetchInto($query_id, $result_row, OCI_ASSOC+OCI_RETURN_NULLS);
+			if($debug)
+			{
+				echo "Query was: ".$this->last_query . "<br>";
+				echo "Result: $result<br>";
+				echo "Query ID: $query_id<br>";
+				echo "<pre>";
+				var_dump($result_row);
+				echo "</pre>";
+			}
+			if($result_row == "")
+			{
+				return false;
+			}
+
+			for($i = 0; $i < count($result_row); $i++)
+			{
+				list($key, $val) = each($result_row);
+				$return_arr[strtolower($key)] = $val;
+			}
+			$this->row[$query_id] = $return_arr;
+
+			return $this->row[$query_id];
+		}
+		else
+		{
+			return false;
+		}
+	}
+	// This function probably isn't as efficant is it could be but any other way I do it
+	// I end up losing 1 row...
+	function sql_fetchrowset($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			$rows = @OCIFetchStatement($query_id, $results);
+			@OCIExecute($query_id, OCI_DEFAULT);
+			for($i = 0; $i <= $rows; $i++)
+			{
+				@OCIFetchInto($query_id, $tmp_result, OCI_ASSOC+OCI_RETURN_NULLS);
+
+				for($j = 0; $j < count($tmp_result); $j++)
+				{
+					list($key, $val) = each($tmp_result);
+					$return_arr[strtolower($key)] = $val;
+				}
+				$result[] = $return_arr;
+			}
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_fetchfield($field, $rownum = -1, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+			if($rownum > -1)
+			{
+				// Reset the internal rownum pointer.
+				@OCIExecute($query_id, OCI_DEFAULT);
+				for($i = 0; $i < $rownum; $i++)
+				  {
+						// Move the interal pointer to the row we want
+						@OCIFetch($query_id);
+				  }
+				// Get the field data.
+				$result = @OCIResult($query_id, strtoupper($field));
+			}
+			else
+			{
+				// The internal pointer should be where we want it
+				// so we just grab the field out of the current row.
+				$result = @OCIResult($query_id, strtoupper($field));
+			}
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	function sql_rowseek($rownum, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+				$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+				@OCIExecute($query_id, OCI_DEFAULT);
+			for($i = 0; $i < $rownum; $i++)
+				{
+					@OCIFetch($query_id);
+				}
+			$result = @OCIFetch($query_id);
+			return $result;
+		}
+		else
+		{
+				return false;
+		}
+	}
+	function sql_nextid($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id && $this->last_query_text[$query_id] != "")
+		{
+			if( eregi("^(INSERT{1}|^INSERT INTO{1})[[:space:]][\"]?([a-zA-Z0-9\_\-]+)[\"]?", $this->last_query_text[$query_id], $tablename))
+			{
+				$query = "SELECT ".$tablename[2]."_id_seq.currval FROM DUAL";
+				$stmt = @OCIParse($this->db_connect_id, $query);
+				@OCIExecute($stmt,OCI_DEFAULT );
+				$temp_result = @OCIFetchInto($stmt, $temp_result, OCI_ASSOC+OCI_RETURN_NULLS);
+				if($temp_result)
+				{
+					return $temp_result['CURRVAL'];
+				}
+				else
+				{
+					return false;
+				}
+			}
+			else
+			{
+				return false;
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_nextid($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		if($query_id && $this->last_query_text[$query_id] != "")
+		{
+			if( eregi("^(INSERT{1}|^INSERT INTO{1})[[:space:]][\"]?([a-zA-Z0-9\_\-]+)[\"]?", $this->last_query_text[$query_id], $tablename))
+			{
+				$query = "SELECT ".$tablename[2]."_id_seq.CURRVAL FROM DUAL";
+				$temp_q_id =  @OCIParse($this->db_connect_id, $query);
+				@OCIExecute($temp_q_id, OCI_DEFAULT);
+				@OCIFetchInto($temp_q_id, $temp_result, OCI_ASSOC+OCI_RETURN_NULLS);
+
+				if($temp_result)
+				{
+					return $temp_result['CURRVAL'];
+				}
+				else
+				{
+					return false;
+				}
+			}
+			else
+			{
+				return false;
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+
+
+	function sql_freeresult($query_id = 0)
+	{
+		if(!$query_id)
+		{
+				$query_id = $this->query_result;
+		}
+		if($query_id)
+		{
+				$result = @OCIFreeStatement($query_id);
+				return $result;
+		}
+		else
+		{
+				return false;
+		}
+	}
+	function sql_error($query_id  = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+		$result  = @OCIError($query_id);
+		return $result;
+	}
+
+} // class sql_db
+
+} // if ... define
+
+?>
Index: /trunk/client/class/db/postgres7.php
===================================================================
--- /trunk/client/class/db/postgres7.php	(revision 232)
+++ /trunk/client/class/db/postgres7.php	(revision 232)
@@ -0,0 +1,397 @@
+<?php
+  /***************************************************************************
+   *                               postgres7.php
+   *                            -------------------
+   *   begin                : Saturday, Feb 13, 2001
+   *   copyright            : (C) 2001 The phpBB Group
+   *   email                : supportphpbb.com
+   *
+   *   Id: postgres7.php,v 1.19.2.3 2005/05/06 20:50:10 acydburn Exp
+   *
+   ***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+
+if(!defined("SQL_LAYER"))
+{
+
+define("SQL_LAYER","postgresql");
+
+class sql_db
+{
+
+	var $db_connect_id;
+	var $query_result;
+	var $in_transaction = 0;
+	var $row = array();
+	var $rowset = array();
+	var $rownum = array();
+	var $num_queries = 0;
+
+	//
+	// Constructor
+	//
+	function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
+	{
+		$this->connect_string = "";
+
+		if( $sqluser )
+		{
+			$this->connect_string .= "user=$sqluser ";
+		}
+
+		if( $sqlpassword )
+		{
+			$this->connect_string .= "password=$sqlpassword ";
+		}
+
+		if( $sqlserver )
+		{
+			if( ereg(":", $sqlserver) )
+			{
+				list($sqlserver, $sqlport) = split(":", $sqlserver);
+				$this->connect_string .= "host=$sqlserver port=$sqlport ";
+			}
+			else
+			{
+				if( $sqlserver != "localhost" )
+				{
+					$this->connect_string .= "host=$sqlserver ";
+				}
+			}
+		}
+
+		if( $database )
+		{
+			$this->dbname = $database;
+			$this->connect_string .= "dbname=$database";
+		}
+
+		$this->persistency = $persistency;
+
+		$this->db_connect_id = ( $this->persistency ) ? pg_pconnect($this->connect_string) : pg_connect($this->connect_string);
+
+		return ( $this->db_connect_id ) ? $this->db_connect_id : false;
+	}
+
+	//
+	// Other base methods
+	//
+	function sql_close()
+	{
+		if( $this->db_connect_id )
+		{
+			//
+			// Commit any remaining transactions
+			//
+			if( $this->in_transaction )
+			{
+				@pg_exec($this->db_connect_id, "COMMIT");
+			}
+
+			if( $this->query_result )
+			{
+				@pg_freeresult($this->query_result);
+			}
+
+			return @pg_close($this->db_connect_id);
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//
+	// Query method
+	//
+	function sql_query($query = "", $transaction = false)
+	{
+		//
+		// Remove any pre-existing queries
+		//
+		unset($this->query_result);
+		if( $query != "" )
+		{
+			$this->num_queries++;
+
+			$query = preg_replace("/LIMIT ([0-9]+),([ 0-9]+)/", "LIMIT \\2 OFFSET \\1", $query);
+
+			if( $transaction == BEGIN_TRANSACTION && !$this->in_transaction )
+			{
+				$this->in_transaction = TRUE;
+
+				if( !@pg_exec($this->db_connect_id, "BEGIN") )
+				{
+					return false;
+				}
+			}
+
+			$this->query_result = @pg_exec($this->db_connect_id, $query);
+			if( $this->query_result )
+			{
+				if( $transaction == END_TRANSACTION )
+				{
+					$this->in_transaction = FALSE;
+
+					if( !@pg_exec($this->db_connect_id, "COMMIT") )
+					{
+						@pg_exec($this->db_connect_id, "ROLLBACK");
+						return false;
+					}
+				}
+
+				$this->last_query_text[$this->query_result] = $query;
+				$this->rownum[$this->query_result] = 0;
+
+				unset($this->row[$this->query_result]);
+				unset($this->rowset[$this->query_result]);
+
+				return $this->query_result;
+			}
+			else
+			{
+				if( $this->in_transaction )
+				{
+					@pg_exec($this->db_connect_id, "ROLLBACK");
+				}
+				$this->in_transaction = FALSE;
+
+				return false;
+			}
+		}
+		else
+		{
+			if( $transaction == END_TRANSACTION && $this->in_transaction )
+			{
+				$this->in_transaction = FALSE;
+
+				if( !@pg_exec($this->db_connect_id, "COMMIT") )
+				{
+					@pg_exec($this->db_connect_id, "ROLLBACK");
+					return false;
+				}
+			}
+
+			return true;
+		}
+	}
+
+	//
+	// Other query methods
+	//
+	function sql_numrows($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ( $query_id ) ? @pg_numrows($query_id) : false;
+	}
+
+	function sql_numfields($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ( $query_id ) ? @pg_numfields($query_id) : false;
+	}
+
+	function sql_fieldname($offset, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ( $query_id ) ? @pg_fieldname($query_id, $offset) : false;
+	}
+
+	function sql_fieldtype($offset, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ( $query_id ) ? @pg_fieldtype($query_id, $offset) : false;
+	}
+
+	function sql_fetchrow($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		if($query_id)
+		{
+			$this->row = @pg_fetch_array($query_id, $this->rownum[$query_id]);
+
+			if( $this->row )
+			{
+				$this->rownum[$query_id]++;
+				return $this->row;
+			}
+		}
+
+		return false;
+	}
+
+	function sql_fetchrowset($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		if( $query_id )
+		{
+			unset($this->rowset[$query_id]);
+			unset($this->row[$query_id]);
+			$this->rownum[$query_id] = 0;
+
+			while( $this->rowset = @pg_fetch_array($query_id, $this->rownum[$query_id], PGSQL_ASSOC) )
+			{
+				$result[] = $this->rowset;
+				$this->rownum[$query_id]++;
+			}
+
+			return $result;
+		}
+
+		return false;
+	}
+
+	function sql_fetchfield($field, $row_offset=-1, $query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		if( $query_id )
+		{
+			if( $row_offset != -1 )
+			{
+				$this->row = @pg_fetch_array($query_id, $row_offset, PGSQL_ASSOC);
+			}
+			else
+			{
+				if( $this->rownum[$query_id] )
+				{
+					$this->row = @pg_fetch_array($query_id, $this->rownum[$query_id]-1, PGSQL_ASSOC);
+				}
+				else
+				{
+					$this->row = @pg_fetch_array($query_id, $this->rownum[$query_id], PGSQL_ASSOC);
+
+					if( $this->row )
+					{
+						$this->rownum[$query_id]++;
+					}
+				}
+			}
+
+			return $this->row[$field];
+		}
+
+		return false;
+	}
+
+	function sql_rowseek($offset, $query_id = 0)
+	{
+
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+
+		if( $query_id )
+		{
+			if( $offset > -1 )
+			{
+				$this->rownum[$query_id] = $offset;
+				return true;
+			}
+			else
+			{
+				return false;
+			}
+		}
+
+		return false;
+	}
+
+	function sql_nextid()
+	{
+		$query_id = $this->query_result;
+
+		if($query_id && $this->last_query_text[$query_id] != "")
+		{
+			if( preg_match("/^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)/is", $this->last_query_text[$query_id], $tablename) )
+			{
+				$query = "SELECT currval('" . $tablename[1] . "_id_seq') AS last_value";
+				$temp_q_id =  @pg_exec($this->db_connect_id, $query);
+				if( !$temp_q_id )
+				{
+					return false;
+				}
+
+				$temp_result = @pg_fetch_array($temp_q_id, 0, PGSQL_ASSOC);
+
+				return ( $temp_result ) ? $temp_result['last_value'] : false;
+			}
+		}
+
+		return false;
+	}
+
+	function sql_affectedrows($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ( $query_id ) ? @pg_cmdtuples($query_id) : false;
+	}
+
+	function sql_freeresult($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ( $query_id ) ? @pg_freeresult($query_id) : false;
+	}
+
+	function sql_error($query_id = 0)
+	{
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		$result['message'] = @pg_errormessage($this->db_connect_id);
+		$result['code'] = -1;
+
+		return $result;
+	}
+
+} // class ... db_sql
+
+} // if ... defined
+
+?>
Index: /trunk/client/class/db/readmedatabase.txt
===================================================================
--- /trunk/client/class/db/readmedatabase.txt	(revision 232)
+++ /trunk/client/class/db/readmedatabase.txt	(revision 232)
@@ -0,0 +1,42 @@
+
+
+Nel file config.php, aggiungere la variabile:
+$dbtype = "MySQL"; 
+oppure 
+mysql4
+sqlite
+mssql
+oracle
+msaccess
+mssql-odbc
+db2
+postgres
+
+Caricare poi il file db.php :
+
+
+@require_once(config.php");
+@require_once(db/db.php");
+
+ed usare cosi'
+$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_config"));
+
+
+sostituendo, per esmpio, mysql_query con $db->sql_query 
+e cosi' via.
+Ecco i comandi sql supportati
+
+$db->sql_query
+$db->sql_numrows
+$db->sql_affectedrows
+$db->sql_numfields
+$db->sql_fieldname
+$db->sql_fieldtype
+$db->sql_fetchrow
+$db->sql_fetchrowset
+$db->sql_fetchfield
+$db->sql_rowseek
+$db->sql_nextid
+$db->sql_freeresult
+$db->sql_error
+
Index: /trunk/client/class/db/sqlite.php
===================================================================
--- /trunk/client/class/db/sqlite.php	(revision 232)
+++ /trunk/client/class/db/sqlite.php	(revision 232)
@@ -0,0 +1,314 @@
+<?php
+/***************************************************************************
+ *                                 sqlite.php
+ *                            -------------------
+ *   begin                : Saturday, Feb 13, 2001
+ *   copyright            : (C) 2001 The phpBB Group
+ *   email                : support@phpbb.com
+ *
+ *   $Id: sqlite.php,v 1.16 2002/03/19 01:07:36 psotfx Exp $
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+
+if(!defined('SQL_LAYER'))
+{
+
+define('SQL_LAYER', 'sqlite');
+
+class sql_db
+{
+
+	var $db_connect_id;
+	var $query_result;
+	var $row = array();
+	var $rowset = array();
+	var $num_queries = 0;
+
+	//
+	// Constructor
+	//
+	function sql_db($sqlserver, $trash, $trash, $trash, $persistency = true)
+	{
+		$this->persistency = $persistency;
+		$this->server = $sqlserver;
+
+		$this->db_connect_id = ($this->persistency) ? @sqlite_popen($this->server, 0666, $sqliteerror) : @sqlite_open($this->server, 0666, $sqliteerror);
+
+		return ($this->db_connect_id) ? $this->db_connect_id : false;
+	}
+
+	//
+	// Other base methods
+	//
+	function sql_close()
+	{
+		return ($this->db_connect_id) ? @sqlite_close($this->db_connect_id) : false;
+	}
+
+	//
+	// Base query method
+	//
+	function sql_query($query = '', $transaction = FALSE)
+	{
+		// Remove any pre-existing queries
+		unset($this->query_result);
+
+		if($query != '')
+		{
+			$this->num_queries++;
+
+			$this->query_result = @sqlite_query($query, $this->db_connect_id);
+		}
+
+		if($this->query_result)
+		{
+			unset($this->row[$this->query_result]);
+			unset($this->rowset[$this->query_result]);
+
+			return $this->query_result;
+		}
+		else
+		{
+			return ( $transaction == END_TRANSACTION ) ? true : false;
+		}
+	}
+
+	//
+	// Other query methods
+	//
+	function sql_numrows($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+
+		if($query_id)
+		{
+			return @sqlite_num_rows($query_id);
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_affectedrows()
+	{
+		return ($this->db_connect_id) ? @sqlite_changes($this->db_connect_id) : false;
+	}
+
+	function sql_numfields($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ($query_id) ? @sqlite_num_fields($query_id) : false;
+	}
+
+	function sql_fieldname($offset, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ($query_id) ? @sqlite_field_name($query_id, $offset) : false;
+	}
+
+	function sql_fieldtype($offset, $query_id = 0)
+	{
+		exit('sql_fieldtype called');
+
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+
+		// return ($query_id) ? @mysql_field_type($query_id, $offset) : false;
+		return ($query_id) ? 'varchar' : false;
+	}
+
+	function sql_fetchrow($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+
+		if($query_id)
+		{
+			//$this->row[$query_id] = @sqlite_fetch_array($query_id);
+			//return $this->row[$query_id];
+
+
+			$result = sqlite_fetch_array($query_id);
+
+			if ($result)
+			{
+				foreach ($result as $key => $value)
+				{
+					if ($pos = strpos($key, '.'))
+					{
+						$key = substr($key, $pos+1);
+					}
+
+					$array[$key] = $value;
+				}
+			}
+
+			$this->row[$query_id] = $array;
+
+			return $this->row[$query_id];
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_fetchrowset($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+
+		if($query_id)
+		{
+			unset(
+				$this->rowset[$query_id],
+				$this->row[$query_id]
+				);
+
+			while($this->rowset[$query_id] = @sqlite_fetch_array($query_id))
+			{
+				foreach ($this->rowset[$query_id] as $key => $value)
+				{
+					if ($pos = strpos($key, '.'))
+					{
+						$key = substr($key, $pos+1);
+					}
+
+					$array[$key] = $value;
+				}
+
+				$result[] = $array;
+			}
+
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_fetchfield($field, $rownum = -1, $query_id = 0)
+	{
+		exit('sql_fetchfield called');
+
+		if( !$query_id )
+		{
+			$query_id = $this->query_result;
+		}
+
+		if( $query_id )
+		{
+			if( $rownum > -1 )
+			{
+				$result = mysql_result($query_id, $rownum, $field);
+			}
+			else
+			{
+				if( empty($this->row[$query_id]) && empty($this->rowset[$query_id]) )
+				{
+					if( $this->sql_fetchrow() )
+					{
+						$result = $this->row[$query_id][$field];
+					}
+				}
+				else
+				{
+					if( $this->rowset[$query_id] )
+					{
+						$result = $this->rowset[$query_id][$field];
+					}
+					else if( $this->row[$query_id] )
+					{
+						$result = $this->row[$query_id][$field];
+					}
+				}
+			}
+
+			return $result;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_rowseek($rownum, $query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+
+		return ($query_id) ? @sqlite_seek($query_id, $rownum) : false;
+	}
+
+	function sql_nextid()
+	{
+		return ($this->db_connect_id) ? @sqlite_last_insert_rowid($this->db_connect_id) : false;
+	}
+
+	function sql_freeresult($query_id = 0)
+	{
+		if(!$query_id)
+		{
+			$query_id = $this->query_result;
+		}
+
+		if ( $query_id )
+		{
+			unset(
+				$this->row[$query_id],
+				$this->rowset[$query_id]
+				);
+
+			//@mysql_free_result($query_id);
+
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	function sql_error()
+	{
+		$result['code'] = sqlite_last_error($this->db_connect_id);
+		$result['message'] = sqlite_error_string($result['code']);
+
+		return $result;
+	}
+
+} // class sql_db
+
+} // if ... define
+
+?>
Index: /trunk/client/inc/mobile.php
===================================================================
--- /trunk/client/inc/mobile.php	(revision 232)
+++ /trunk/client/inc/mobile.php	(revision 232)
@@ -0,0 +1,37 @@
+<?php
+# riconoscimento  mobile 
+# per Eleonline
+# by l.apolito 2012
+# www.linuxap.it
+#####################################################
+/*
+	$is_mobile=is_mobile();
+	if($is_mobile){
+		setcookie ("mobile", "yes", time()+3600, "/");
+		$mobile="yes";
+	}else{
+		setcookie ("mobile", "no", time()+3600, "/"); 
+		$mobile="no";	
+	}
+
+*/
+
+ # funzione verifica se mobile    
+
+    function is_mobile(){
+     
+    // returns true if one of the specified mobile browsers is detected
+     
+    $regex_match="/(nokia|iphone|android|motorola|^mot\-|softbank|foma|docomo|kddi|up\.browser|up\.link|";
+    $regex_match.="htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|";
+    $regex_match.="blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam\-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|";
+    $regex_match.="symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte\-|longcos|pantech|gionee|^sie\-|portalmmm|";
+    $regex_match.="jig\s browser|hiptop|^ucweb|^benq|haier|^lct|opera\s*mobi|opera\*mini|320x320|240x320|176x220";
+    $regex_match.=")/i";
+    return isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE']) or preg_match($regex_match, strtolower($_SERVER['HTTP_USER_AGENT']));
+    }
+
+
+     
+?>
+
Index: /trunk/client/modules/Elezioni/grafici/ledex1.php
===================================================================
--- /trunk/client/modules/Elezioni/grafici/ledex1.php	(revision 232)
+++ /trunk/client/modules/Elezioni/grafici/ledex1.php	(revision 232)
@@ -0,0 +1,13 @@
+<?php
+
+include_once "jpgraph.php";
+include "jpgraph_led.php";
+$sez=$_GET['sez'];
+$max=$_GET['max'];
+// By default each "LED" circle has a radius of 3 pixels
+$led = new DigitalLED74($aRadius=1,$aMargin=0.6);
+$led->StrokeNumber($sez.' di '.$max,LEDC_GREEN); 
+
+
+
+?>
Index: /trunk/client/versione.php
===================================================================
--- /trunk/client/versione.php	(revision 231)
+++ /trunk/client/versione.php	(revision 232)
@@ -1,7 +1,7 @@
 <?php
 
-$versione = "2.0 rev 231";
+$versione = "2.0 rev 232";
 $version_number = $versione;
-$version = "Eleonline $version_number (<i>Data Release: 17 maggio 2015</i>)";
+$version = "Eleonline $version_number (<i>Data Release: 18 maggio 2015</i>)";
 
 ?> 
