Index: /trunk/admin/admin.php
===================================================================
--- /trunk/admin/admin.php	(revision 20)
+++ /trunk/admin/admin.php	(revision 30)
@@ -71,17 +71,17 @@
 
 foreach ($_GET as $sec_key => $secvalue) {
-    if ((eregi("<[^>]*script*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*object*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*iframe*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*applet*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*meta*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*style*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*form*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*img*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*body*\"?[^>]*>", $secvalue)) ||
-	(eregi("\([^>]*\"?[^)]*\)", $secvalue)) ||
-	(eregi("\"", $secvalue)) ||
-	(eregi("inside_mod", $sec_key))) {
+    if ((preg_match("/<[^>]*script*\"?[^>]*>/i",$secvalue)) ||
+	(preg_match("/<[^>]*object*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*iframe*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*applet*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*meta*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*style*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*form*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*img*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*onmouseover*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*body*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/\([^>]*\"?[^)]*\)/", $secvalue)) ||
+	(preg_match("/\"/", $secvalue)) ||
+	(preg_match("/inside_mod/i", $sec_key))) {
         die ("Operazione non consentita");
      }
@@ -89,5 +89,5 @@
 
   foreach ($_POST as $secvalue) {
-    if ((eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) || (eregi("<[^>]script*\"?[^>]*>", $secvalue)) || (eregi("<[^>]*body*\"?[^>]*>", $secvalue)) || (eregi("<[^>]style*\"?[^>]*>", $secvalue))) {
+    if ((preg_match("/<[^>]*onmouseover*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]script*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]*body*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]style*\"?[^>]*>/i", $secvalue))) {
       die ('Operazione non consentita');
     }
@@ -124,5 +124,5 @@
 		$dbi=mysql_connect($dbhost, $dbuname, $dbpass) or die("Connessione non riuscita: " . mysql_error());
 		mysql_select_db($dbname)or die("Connessione non riuscita:" . mysql_error());
-		mysql_set_charset('utf8', $dbi);
+	mysql_query("SET NAMES 'utf8'", $dbi);
 //---10/05/2009  gestione consultazione predefinita
 		$res_config = mysql_query("select * from ".$prefix."_config ",$dbi);
@@ -161,5 +161,5 @@
         if (strlen($aid)>25 ) { die ("Nome utente troppo lungo: $aid"); }	
 	if (!isset($param['id_ses']) or $param['id_ses'] != session_id()) logout();
-	if (ereg(" ", $aid)) { die ("Gli spazi non sono ammessi nel nome utente: $aid"); }
+	if (strstr( $aid," ")) { die ("Gli spazi non sono ammessi nel nome utente: $aid"); }
 	if (isset($_SESSION['aid'])){
 		logout();//se hai gia' una sessione aperta non puoi postare 'aid'
Index: /trunk/admin/footer.php
===================================================================
--- /trunk/admin/footer.php	(revision 20)
+++ /trunk/admin/footer.php	(revision 30)
@@ -8,5 +8,5 @@
 
 $PHP_SELF=$_SERVER['PHP_SELF'];
-if (eregi("footer.php",$PHP_SELF)) {
+if (preg_match("/footer.php/i",$PHP_SELF)) {
     Header("Location: admin.php");
     die();
Index: /trunk/admin/inc/FCKeditor/editor/filemanager/browser/default/connectors/php/connector.php
===================================================================
--- /trunk/admin/inc/FCKeditor/editor/filemanager/browser/default/connectors/php/connector.php	(revision 20)
+++ /trunk/admin/inc/FCKeditor/editor/filemanager/browser/default/connectors/php/connector.php	(revision 30)
@@ -53,5 +53,5 @@
 	$GLOBALS["UserFilesPath"] = $strBP ;
 }
-if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
+if ( ! preg_match( '/\/$/', $GLOBALS["UserFilesPath"] ) )
 	$GLOBALS["UserFilesPath"] .= '/' ;
 
@@ -60,5 +60,5 @@
 	$GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePath'] ;
 
-	if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) )
+	if ( ! preg_match( '/\/$/', $GLOBALS["UserFilesDirectory"] ) )
 		$GLOBALS["UserFilesDirectory"] .= '/' ;
 }
@@ -86,5 +86,5 @@
 
 	// Check the current folder syntax (must begin and start with a slash).
-	if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
+	if ( ! preg_match( '/\/$/', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
 	if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ;
 	
Index: /trunk/admin/index.php
===================================================================
--- /trunk/admin/index.php	(revision 20)
+++ /trunk/admin/index.php	(revision 30)
@@ -10,5 +10,5 @@
 		$dbi=mysql_connect($dbhost, $dbuname, $dbpass) or die("Connessione non riuscita: " . mysql_error());
 		mysql_select_db($dbname)or die("Connessione non riuscita:" . mysql_error());
-		mysql_set_charset('utf8', $dbi);
+	mysql_query("SET NAMES 'utf8'", $dbi);
 //---10/05/2009  gestione consultazione predefinita
 //if (!isset($_SESSION['id_comune'])){
Index: /trunk/admin/modules/Elezioni/controllo_votanti.php
===================================================================
--- /trunk/admin/modules/Elezioni/controllo_votanti.php	(revision 20)
+++ /trunk/admin/modules/Elezioni/controllo_votanti.php	(revision 30)
@@ -130,5 +130,5 @@
 		}
 //	$ar['riga2'][$data1.$ora1]="<hr>";
-		if (intval(ereg("[1-9]",$tot[$data1.$ora1]))>0) {
+		if (intval(preg_match("/[1-9]/",$tot[$data1.$ora1]))>0) {
 			for ($i=1;$i<=$num_sez;$i++)
 			{
Index: /trunk/admin/modules/Elezioni/ele_come.php
===================================================================
--- /trunk/admin/modules/Elezioni/ele_come.php	(revision 20)
+++ /trunk/admin/modules/Elezioni/ele_come.php	(revision 30)
@@ -138,5 +138,5 @@
 
 $temp=$title.$preamble.$content;
-	if (eregi("script",$temp)) die("La parola script e' proibita, devi toglierla dal testo.");
+	if (preg_match("/script/i",$temp)) die("La parola script e' proibita, devi toglierla dal testo.");
     $result = mysql_query("update ".$prefix.$tab." set title='$title', preamble='$preamble', content='$content' WHERE mid='$mid' AND id_cons='$id_cons'", $dbi);
     Header("Location: admin.php?op=$op&vai=come&id_cons_gen=$id_cons_gen");
Index: /trunk/admin/modules/Elezioni/ele_voti.php
===================================================================
--- /trunk/admin/modules/Elezioni/ele_voti.php	(revision 20)
+++ /trunk/admin/modules/Elezioni/ele_voti.php	(revision 30)
@@ -1112,5 +1112,5 @@
 
 
- 	if (!ereg("rec",$op)) {
+ 	if (!preg_match("/rec/",$op)) {
 		ele(); //menu
 		numeri_sezione();
Index: /trunk/admin/modules/Elezioni/language/lang-it.php
===================================================================
--- /trunk/admin/modules/Elezioni/language/lang-it.php	(revision 20)
+++ /trunk/admin/modules/Elezioni/language/lang-it.php	(revision 30)
@@ -164,5 +164,5 @@
 define("_TESTATA","Immagine per la testata");
 define("_BLOCCO","Visualizzare il blocco laterale?");
-define("_MULTICOMUNE","Si gestiscono più comuni?");
+define("_MULTICOMUNE",htmlentities("Si gestiscono più comuni?"));
 define("_PREFIX","Prefisso delle tabelle");
 define("_ADMINMAIL","mail dell'amministratore");
Index: /trunk/admin/temi/facebook/menu.php
===================================================================
--- /trunk/admin/temi/facebook/menu.php	(revision 20)
+++ /trunk/admin/temi/facebook/menu.php	(revision 30)
@@ -227,6 +227,6 @@
     	for ($i=0; $i < sizeof($menulist); $i++) {
 		if($menulist[$i]!="") {
-	    		$tl = ereg_replace("lang-","",$menulist[$i]);
-	    		$tl = ereg_replace(".php","",$tl);
+	    		$tl = preg_replace("/lang-/","",$menulist[$i]);
+	    		$tl = preg_replace("/.php/","",$tl);
 	    		$altlang = ucfirst($tl);
                         
Index: /trunk/admin/temi/facebook/tema.php
===================================================================
--- /trunk/admin/temi/facebook/tema.php	(revision 20)
+++ /trunk/admin/temi/facebook/tema.php	(revision 30)
@@ -19,5 +19,5 @@
     	while ($file = readdir($handle)) {
 
-			if ( (ereg("^([_0-9a-zA-Z]+)([_0-9a-zA-Z]{3})$",$file)) ) {
+			if ( (preg_match("/^([_0-9a-zA-Z]+)([_0-9a-zA-Z]{3})$/",$file)) ) {
 
 		   $tlist .= "$file ";
Index: /trunk/client/file.php
===================================================================
--- /trunk/client/file.php	(revision 20)
+++ /trunk/client/file.php	(revision 30)
@@ -10,5 +10,5 @@
 die("<center><img src=src=\"images/logo.gif\" target=\"Logo Avviso Errore\"><br><br><b>Ci sono dei problemi di connessione al DataBase $dbtype, chiediamo scusa per l'inconveniente.<br><br>Provate piu' tardi, Grazie.</b><br><font color=\"#ff0000\">". mysql_error()."</font></center>");
 }
-mysql_set_charset('utf8', $dbi);
+mysql_query("SET NAMES 'utf8'", $dbi);
 if ($fase=='1'){
 	$res = mysql_query("SELECT id_cons_gen,descrizione from ".$prefix."_ele_consultazione order by descrizione",$dbi);
Index: /trunk/client/modules.php
===================================================================
--- /trunk/client/modules.php	(revision 20)
+++ /trunk/client/modules.php	(revision 30)
@@ -35,17 +35,17 @@
 
 foreach ($_GET as $sec_key => $secvalue) {
-    if ((preg_match('/<[^>]*script*\"?[^>]*>/i', $secvalue)) ||
-	(eregi("<[^>]*object*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*iframe*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*applet*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*meta*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*style*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*form*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*img*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) ||
-	(eregi("<[^>]*body*\"?[^>]*>", $secvalue)) ||
-	(eregi("\([^>]*\"?[^)]*\)", $secvalue)) ||
-	(eregi("\"", $secvalue)) ||
-	(eregi("inside_mod", $sec_key))) {
+    if ((preg_match("/<[^>]*script*\"?[^>]*>/i",$secvalue)) ||
+	(preg_match("/<[^>]*object*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*iframe*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*applet*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*meta*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*style*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*form*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*img*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*onmouseover*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/<[^>]*body*\"?[^>]*>/i", $secvalue)) ||
+	(preg_match("/\([^>]*\"?[^)]*\)/", $secvalue)) ||
+	(preg_match("/\"/", $secvalue)) ||
+	(preg_match("/inside_mod/i", $sec_key))) {
         die ("Operazione non consentita");
      }
@@ -53,5 +53,5 @@
 
   foreach ($_POST as $secvalue) {
-    if ((eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) || (eregi("<[^>]script*\"?[^>]*>", $secvalue)) || (eregi("<[^>]*body*\"?[^>]*>", $secvalue)) || (eregi("<[^>]style*\"?[^>]*>", $secvalue))) {
+    if ((preg_match("/<[^>]*onmouseover*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]script*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]*body*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]style*\"?[^>]*>/i", $secvalue))) {
       die ($htmltags);
     }
@@ -74,7 +74,7 @@
 global $op,$name;
 if(!isset($_GET['js'])){
-$querystring= @eregi_replace($_SERVER['DOCUMENT_ROOT'],'http://'.$_SERVER['HTTP_HOST'].'/',$_SERVER['SCRIPT_FILENAME']);
-if (eregi("modules.php",$_SERVER['SCRIPT_NAME'])) $pagina="name=$name"; // reindirizza
-if (eregi("admin.php",$_SERVER['SCRIPT_NAME'])) $pagina="op=$op"; // reindirizza
+$querystring= @preg_replace('/'.$_SERVER['DOCUMENT_ROOT'].'/i','http://'.$_SERVER['HTTP_HOST'].'/',$_SERVER['SCRIPT_FILENAME']);
+if (preg_match("/modules.php/i",$_SERVER['SCRIPT_NAME'])) $pagina="name=$name"; // reindirizza
+if (preg_match("/admin.php/i",$_SERVER['SCRIPT_NAME'])) $pagina="op=$op"; // reindirizza
  echo "<noscript><meta http-equiv=\"refresh\" content=\"0; url=".$querystring."?js=b&amp;$pagina\"/></noscript>";
   }
@@ -104,5 +104,5 @@
 die("<center><img src=src=\"images/logo.gif\" target=\"Logo Avviso Errore\"><br/><br/><b>Ci sono dei problemi di connessione al DataBase $dbtype, chiediamo scusa per l'inconveniente.<br/><br/>Provate piu' tardi, Grazie.</b><br/><font color=\"#ff0000\">". mysql_error()."</font></center>");
 }
-mysql_set_charset('utf8', $dbi);
+mysql_query("SET NAMES 'utf8'", $dbi);
 
 # carica i parametri di default sulla tabella
@@ -210,11 +210,11 @@
         $tema=$param['tema'];
         $tema=htmlentities($tema); // evita xss
-        if(eregi("%", $tema)) $tema="default";// evita xss
+        if(preg_match("/%/i", $tema)) $tema="default";// evita xss
         $_SESSION['newtema']="$tema";
         }
-
-if (eregi("%",$_SESSION['newtema'])) $_SESSION['newtema']="default"; // xss
-if (isset($_SESSION['newtema'])) $tema=$_SESSION['newtema']; 
-
+if (isset($_SESSION['newtema'])) {
+	$tema=$_SESSION['newtema']; 
+	if (preg_match("/%/i",$_SESSION['newtema'])) $_SESSION['newtema']="default"; // xss
+}
 $PHP_SELF=$_SERVER['PHP_SELF'];
 $file=(isset($_GET['file'])) ? $_GET['file']:"index";
@@ -223,5 +223,5 @@
 $name=htmlentities($name); 
 $file=htmlentities($file); 
-$id_comune=intval($id_comune); 
+#$id_comune=intval($id_comune); 
 
 $modpath = "modules/$name/$file.php";
Index: /trunk/client/modules/Elezioni/funzioni.php
===================================================================
--- /trunk/client/modules/Elezioni/funzioni.php	(revision 20)
+++ /trunk/client/modules/Elezioni/funzioni.php	(revision 30)
@@ -208,11 +208,11 @@
 	    
 	    for ($i=0;$i<20;$i++) {
-		$link = preg_replace(".*<link>","",$items[$i]);
-		$link = preg_replace("</link>.*","",$link);
-		$title2 = preg_replace(".*<title>","",$items[$i]);
-		$title2 = preg_replace("</title>.*","",$title2);
+		$link = preg_replace("/.*<link>/","",$items[$i]);
+		$link = preg_replace("/</link>.*/","",$link);
+		$title2 = preg_replace("/.*<title>/","",$items[$i]);
+		$title2 = preg_replace("/</title>.*/","",$title2);
 		$title2 = stripslashes($title2);
-		$descr = preg_replace(".*<description>","",$items[$i]);
-		$descr  = preg_replace("</description>.*","",$descr );
+		$descr = preg_replace("/.*<description>/","",$items[$i]);
+		$descr  = preg_replace("/</description>.*/","",$descr );
 		$descr  = stripslashes($descr );
 
Index: /trunk/client/modules/Elezioni/grafici.php
===================================================================
--- /trunk/client/modules/Elezioni/grafici.php	(revision 20)
+++ /trunk/client/modules/Elezioni/grafici.php	(revision 30)
@@ -67,4 +67,6 @@
 	        // numero sezioni scrutinate
                 //if ($circo)$circos="and id_circ='$id_circ'";
+        if (!isset($data1)) $data1='';
+        if (!isset($ora_ril)) $ora_ril='';
   		$res1 = mysql_query("SELECT count(data) FROM ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' and data='$data1' and orario='$ora_ril' $circos group by t3.id_gruppo", $dbi);
 # mysql_query("select *  from ".$prefix."_ele_voti_parziale where id_cons='$id_cons' $circos  group by id_sez ",$dbi);
@@ -217,5 +219,8 @@
 	 */
 	$res = mysql_query("select t1.*  from ".$prefix."_ele_voti_".$tab." as t1 left join ".$prefix."_ele_$tab as t2 on t1.id_gruppo=t2.id_gruppo where t1.id_cons='$id_cons' $circos group by t1.id_sez ",$dbi);
-	$numero=mysql_num_rows($res);
+	if($res)
+		$numero=mysql_num_rows($res);
+	else
+		$numero=0;
 	$res = mysql_query("select t1.*  from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' $circos",$dbi);
 	$sezioni=mysql_num_rows($res);
@@ -442,6 +447,6 @@
 				//$descrizione=taglio(4,$descrizione);
 				
-				$gruppo[$i]=utf8_encode(substr($descrizione,0,21));
-				$gruppos[$e]=utf8_encode(substr($descrizione,0,21)); //flash
+				$gruppo[$i]=(substr($descrizione,0,21));
+				$gruppos[$e]=(substr($descrizione,0,21)); //flash
 
 				
Index: /trunk/client/modules/Elezioni/grafici/affluenze_graf.php
===================================================================
--- /trunk/client/modules/Elezioni/grafici/affluenze_graf.php	(revision 20)
+++ /trunk/client/modules/Elezioni/grafici/affluenze_graf.php	(revision 30)
@@ -10,4 +10,9 @@
 include ("jpgraph.php");
 include ("jpgraph_pie.php");
+if(file_exists(TTF_DIR))
+	define("CURFONT1",FF_DV_SANSSERIF);
+else 
+	define ("CURFONT1",FF_FONT1);
+
 
 $e=$_GET['e'];$f=$_GET['f'];$e1=$_GET['e1'];$f1=$_GET['f1'];
@@ -22,5 +27,5 @@
 
 $graph->title->Set($titolo);
-$graph->title->SetFont(FF_FONT1,FS_BOLD);
+$graph->title->SetFont(CURFONT1,FS_BOLD);
 $graph ->legend->Pos( 0.02,0.85,"left" ,"center");
 $graph->SetBackgroundImage("../images/logo.jpg",BGIMG_COPY);
Index: /trunk/client/modules/Elezioni/grafici/barre.php
===================================================================
--- /trunk/client/modules/Elezioni/grafici/barre.php	(revision 20)
+++ /trunk/client/modules/Elezioni/grafici/barre.php	(revision 30)
@@ -9,5 +9,8 @@
 include ("jpgraph.php");
 include ("jpgraph_bar.php");
-
+if(file_exists(TTF_DIR))
+	define("CURFONT1",FF_DV_SANSSERIF);
+else 
+	define ("CURFONT1",FF_FONT1);
 
 $dati1=$_GET['dati1'];$dati2=$_GET['dati2'];$i=$_GET['i'];$l=$_GET['l'];$w=$_GET['w'];
@@ -46,10 +49,10 @@
 // Setup title
 $graph->title->Set("$titolo");
-$graph->title->SetFont(FF_FONT1,FS_BOLD,10);
+$graph->title->SetFont(CURFONT1,FS_BOLD,10);
 $graph->subtitle->Set("$descr");
 
 // Setup X-axis
 $graph->xaxis->SetTickLabels($datax);
-$graph->xaxis->SetFont(FF_FONT1,FS_BOLD,8);
+$graph->xaxis->SetFont(CURFONT1,FS_BOLD,8);
 $graph->xaxis->SetColor("black","darkred");
 // Some extra margin looks nicer
@@ -88,10 +91,10 @@
 //$graph->yaxis->title->Align('center');
 
-$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD,12);
+$graph->yaxis->title->SetFont(CURFONT1,FS_BOLD,12);
 $graph->yaxis->title->SetAngle(0);
 
 
 
-$graph->yaxis->SetFont(FF_FONT2,FS_NORMAL);
+$graph->yaxis->SetFont(CURFONT1,FS_NORMAL); #era FF_FONT2
 // If you want the labels at an angle other than 0 or 90
 // you need to use TTF fonts
@@ -123,8 +126,8 @@
 // We want to display the value of each bar at the top
 $bplot->value->Show();
-$bplot->value->SetFont(FF_FONT1,FS_BOLD,12);
+$bplot->value->SetFont(CURFONT1,FS_BOLD,12);
 $bplot->value->SetAlign('left','center');
 $bplot->value->SetColor("black","darkred");
-$bplot->value->SetFormat('%.2f perc');
+$bplot->value->SetFormat("%.2f &#37;");
 
 // Add the bar to the graph
Index: /trunk/client/modules/Elezioni/grafici/jpg-config.inc.php
===================================================================
--- /trunk/client/modules/Elezioni/grafici/jpg-config.inc.php	(revision 20)
+++ /trunk/client/modules/Elezioni/grafici/jpg-config.inc.php	(revision 30)
@@ -31,4 +31,5 @@
 //   MBTTF_DIR /usr/share/fonts/ja/TrueType/
 //
+define("TTF_DIR","/usr/share/fonts/truetype/ttf-dejavu/");
 // WINDOWS:
 //   CACHE_DIR $SERVER_TEMP/jpgraph_cache/
Index: /trunk/client/modules/Elezioni/gruppo.php
===================================================================
--- /trunk/client/modules/Elezioni/gruppo.php	(revision 20)
+++ /trunk/client/modules/Elezioni/gruppo.php	(revision 30)
@@ -365,4 +365,5 @@
 
 				# nome della lista
+				if (!isset($list2)) $list2='';
 				if (strstr( $op,'candidato')) { 
 					$res_lis2 = mysql_query("SELECT num_lista, descrizione from ".$prefix."_ele_lista where id_lista=$id_lista",$dbi);
@@ -426,4 +427,5 @@
 					$pos[$z]=$res[0];
 				}
+			if (!isset($pos)) $pos[0]=0;
 			$minpos=min($pos);
 			$maxpos=max($pos);
Index: /trunk/client/modules/Elezioni/language/lang-en.php
===================================================================
--- /trunk/client/modules/Elezioni/language/lang-en.php	(revision 20)
+++ /trunk/client/modules/Elezioni/language/lang-en.php	(revision 30)
@@ -153,5 +153,5 @@
 define("_LISTE","Lists");
 define("_TEST","If you wont to test Eleonline start inserting username \"suser\" and password \"test\"");
-define("_GESTIONE","managing vote counting and publishing results");
+#define("_GESTIONE","managing vote counting and publishing results");
 define("_TUTTESEDI","All electoral centers");
 define("_ATT_VOTI","Warning! ballots");
@@ -265,5 +265,5 @@
 define("_SEZNOS","Sections to be counted");
 define("_SEZSCR","Counted Sections");
-define("_LISTA","List");
+#define("_LISTA","List");
 define("_PREFLISTA","Ballots to the list");
 define("_CANDIDATO","Candidate");
@@ -402,5 +402,5 @@
 define("_EDIFICIO","Building");
 define("_MAPPA","Map");
-define("_LINK","Link");
+#define("_LINK","Link");
 define("_NUMERITEL","Telephon");
 define("_DESCRAPP","Deep Description");
@@ -410,5 +410,5 @@
 define("_ADMIN","A<br/>D<br/>M<br/>I<br/>N<br/>I<br/>S<br/>T<br/>R<br/>A<br/>T<br/>O<br/>R");
 define("_OPER","O<br/>P<br/>E<br/>R<br/>A<br/>T<br/>O<br/>R");
-define("_SCELTA_CONS","Choose an Election");
+#define("_SCELTA_CONS","Choose an Election");
 define("_GESRIS","managing elections");
 define("_INVIOSEGN","To contact us for signallings, demands or suggestions");
Index: /trunk/client/modules/Elezioni/language/lang-it.php
===================================================================
--- /trunk/client/modules/Elezioni/language/lang-it.php	(revision 20)
+++ /trunk/client/modules/Elezioni/language/lang-it.php	(revision 30)
@@ -199,5 +199,5 @@
 define("_SCELTA_LISTE","ASSEGNA LE LISTE AI RAGGRUPPAMENTI");
 define("_ALTRI","Altri sotto il 3%");
-define("_CNFR_CONS","RAFFRONTO TRA CONSULTAZIONI<br/>si può impostare su liste singole o su raggruppamenti");
+define("_CNFR_CONS",htmlentities("RAFFRONTO TRA CONSULTAZIONI<br/>si può impostare su liste singole o su raggruppamenti"));
 define("_SCELTA_CONS","<b>Scegli le consultazioni da mettere a confronto</b>");
 
Index: /trunk/client/modules/Elezioni/votanti.php
===================================================================
--- /trunk/client/modules/Elezioni/votanti.php	(revision 20)
+++ /trunk/client/modules/Elezioni/votanti.php	(revision 30)
@@ -224,4 +224,5 @@
 		}
 	}
+	$righet='';
 	if($num_scr){
 	$righet = "<tr class=\"bggray\">
Index: /trunk/client/temi/facebook/index.php
===================================================================
--- /trunk/client/temi/facebook/index.php	(revision 20)
+++ /trunk/client/temi/facebook/index.php	(revision 30)
@@ -1,7 +1,19 @@
 <?php
+/************************************************************************/
+/* Eleonline - Raccolta e diffusione dei dati elettorali                */
+/* by Luciano Apolito & Roberto Gigli                                   */
+/* http://www.eleonline.it                                              */
+/* info@eleonline.it  luciano@aniene.net rgigli@libero.it               */
+/************************************************************************/
+
+if (!defined('MODULE_FILE')) {
+    die ("You can't access this file directly...");
+}
+
 # tema like-facebook
 # for eleonline
 include_once("modules/Elezioni/funzioni.php");
 ########## no blocco x grafici e risultati
+if (!isset($param['op'])) $param['op']=''; 
 if($blocco!=1 || $param['op']=="graf_gruppo" || $param['op']=="gruppo_circo" || $param['op']=="gruppo_sezione"
 || $param['op']=="lista_circo" || $param['op']=="lista_sezione"  || $param['op']=="candidato_circo" || $param['op']=="candidato_sezione"
Index: /trunk/client/temi/facebook/menu.php
===================================================================
--- /trunk/client/temi/facebook/menu.php	(revision 20)
+++ /trunk/client/temi/facebook/menu.php	(revision 30)
@@ -243,6 +243,6 @@
     	for ($i=0; $i < sizeof($menulist); $i++) {
 		if($menulist[$i]!="") {
-	    		$tl = preg_replace("lang-","",$menulist[$i]);
-	    		$tl = preg_replace(".php","",$tl);
+	    		$tl = preg_replace("/lang-/","",$menulist[$i]);
+	    		$tl = preg_replace("/.php/","",$tl);
 	    		$altlang = ucfirst($tl);
                         
Index: /trunk/client/temi/inc/button.php
===================================================================
--- /trunk/client/temi/inc/button.php	(revision 20)
+++ /trunk/client/temi/inc/button.php	(revision 30)
@@ -22,6 +22,6 @@
     	for ($i=0; $i < sizeof($menulist); $i++) {
 		if($menulist[$i]!="") {
-	    		$tl = preg_replace("lang-","",$menulist[$i]);
-	    		$tl = preg_replace(".php","",$tl);
+	    		$tl = preg_replace("/lang-/","",$menulist[$i]);
+	    		$tl = preg_replace("/.php/","",$tl);
 	    		$altlang = ucfirst($tl);
                         
Index: /trunk/client/temi/tour/button.php
===================================================================
--- /trunk/client/temi/tour/button.php	(revision 20)
+++ /trunk/client/temi/tour/button.php	(revision 30)
@@ -31,6 +31,6 @@
     	for ($i=0; $i < sizeof($menulist); $i++) {
 		if($menulist[$i]!="") {
-	    		$tl = preg_replace("lang-","",$menulist[$i]);
-	    		$tl = preg_replace(".php","",$tl);
+	    		$tl = preg_replace("/lang-/","",$menulist[$i]);
+	    		$tl = preg_replace("/.php/","",$tl);
 	    		$altlang = ucfirst($tl);
                         
