Index: trunk/admin/modules/Elezioni/ele_associazioni.php
===================================================================
--- trunk/admin/modules/Elezioni/ele_associazioni.php	(revision 281)
+++ trunk/admin/modules/Elezioni/ele_associazioni.php	(revision 282)
@@ -18,4 +18,9 @@
 $prefix=$_SESSION['prefix'];
 $id_comune=$_SESSION['id_comune'];
+$sql = $dbi->prepare("SELECT * FROM ".$prefix."_config");
+$sql->execute();
+$riga = $sql->fetchAll(PDO::FETCH_ASSOC);
+$row=$riga[0];
+$language = $row['language'];
 $id_cons_gen=intval($_GET['id_cons_gen']);
 $perms=ChiSei(0);
@@ -37,14 +42,14 @@
 if (isset($_GET['do'])) get_magic_quotes_gpc() ? $do=$param['do']:$do=addslashes($param['do']); else $do='';
 if (isset($_GET['ok'])) $ok=intval($_GET['ok']); else $ok='';
-if (isset($_GET['id_cons_comu'])) $id_cons_comu=intval($_GET['id_cons_comu']); else $id_cons_comu='';
-if (isset($_GET['id_collegio'])) $id_collegio=intval($_GET['id_collegio']); else $id_collegio='';
+if (isset($_GET['id_cons_comu'])) $id_cons_comu=intval($_GET['id_cons_comu']); else $id_cons_comu='0';
+if (isset($_GET['id_collegio'])) $id_collegio=intval($_GET['id_collegio']); else $id_collegio='0';
 if (isset($_GET['idcomune'])) $idcomune=intval($_GET['idcomune']); else $idcomune='';
-if (isset($_GET['idcomunenew'])) $idcomunenew=intval($_GET['idcomunenew']); else $idcomunenew='';
-if (isset($_GET['chiusa'])) $chiusa=intval($_GET['chiusa']); else $chiusa='';
+if (isset($_GET['idcomunenew'])) $idcomunenew=intval($_GET['idcomunenew']); else $idcomunenew='0';
+if (isset($_GET['chiusa'])) $chiusa=intval($_GET['chiusa']); else $chiusa='0';
 if (isset($_GET['id_conf'])) $id_conf=intval($_GET['id_conf']);  else $id_conf=0;
 if (isset($_GET['idfascia'])) $idfascia=intval($_GET['idfascia']);  else $idfascia=0;
 if (isset($_GET['min'])) $min=intval($_GET['min']); else $min=0;
-if (isset($_GET['help'])) $help=intval($_GET['help']);
-if (isset($_GET['pwd4'])) $pwd4=intval($_GET['pwd4']);
+if (isset($_GET['help'])) $help=intval($_GET['help']); else $help='';
+if (isset($_GET['pwd4'])) $pwd4=intval($_GET['pwd4']); else $pwd4='';
 if (isset($_GET['preferenze'])) $preferenze=intval($_GET['preferenze']); else $preferenze=1;
 if (isset($_GET['vismf'])) $vismf=intval($_GET['vismf']); else $vismf=0;
@@ -117,5 +122,5 @@
 
 #########################
-	if (isset($help)) include("language/$language/ele_associazioni.html");
+	if ($help) include("language/$language/ele_associazioni.html");
 	OpenTable();
 	echo "<tr><td><hr><br>";	
@@ -214,5 +219,5 @@
 	}
 	unset($sel);
-	$sql = "SELECT vismf,vismf,solo_gruppo,disgiunto from ".$prefix."_ele_cons_comune where id_cons='$id_cons_comu'";
+	$sql = "SELECT vismf,solo_gruppo,disgiunto from ".$prefix."_ele_cons_comune where id_cons='$id_cons_comu'";
 	$rescomu = $dbi->prepare("$sql");
 	$rescomu->execute();	
Index: trunk/admin/modules/Elezioni/query.sql
===================================================================
--- trunk/admin/modules/Elezioni/query.sql	(revision 281)
+++ trunk/admin/modules/Elezioni/query.sql	(revision 282)
@@ -87,7 +87,6 @@
 	$sth->execute();	
 	if ($sth->rowCount()){
-		$row2 = $sth->fetchAll();
-		$limite=$row2[0];
-	}
+		$limite = $sth->fetch(PDO::FETCH_NUM); 
+	} else $limite=0;
 	return($row);
 }
Index: trunk/client/modules/Elezioni/menu.php
===================================================================
--- trunk/client/modules/Elezioni/menu.php	(revision 281)
+++ trunk/client/modules/Elezioni/menu.php	(revision 282)
@@ -182,6 +182,6 @@
 	 		echo "<option value=\"gruppo_sezione\" ".$temp['gruppo_sezione'].">".substr(_GRUPPO." "._PER." "._SEZIONI,0,33)."</option>";
 		} 
-		if (!$votol and $fascia>$limite){ // si vota per la lista
-			if ($genere>2) {
+		if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
+			if ($genere>2) { 
 				if (!$circo and $num_circ>1)
 			              echo "<option value=\"lista_circo\" ".$temp['lista_circo']." >".substr(_LISTA." "._PER." "._CIRCO,0,33)."</option>";
Index: trunk/client/modules/Elezioni/rss.php
===================================================================
--- trunk/client/modules/Elezioni/rss.php	(revision 281)
+++ trunk/client/modules/Elezioni/rss.php	(revision 282)
@@ -160,5 +160,5 @@
 		
 					
-				$gruppinum=mysql_num_rows($res);
+				$gruppinum=$res->fetch(PDO::FETCH_NUM);
 				$altrivoti=0;
 				while (list($id,$num,$descrizione,$voti)  = $res->fetch(PDO::FETCH_NUM)){
Index: trunk/client/temi/altro/menu.php
===================================================================
--- trunk/client/temi/altro/menu.php	(revision 281)
+++ trunk/client/temi/altro/menu.php	(revision 282)
@@ -134,5 +134,5 @@
 	  }
 
-	if (!$votol and $fascia>$limite){ // si vota per la lista
+	if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
 			if ($genere>2) {
 				if (!$circo and $num_circ>1)
Index: trunk/client/temi/blog/menu.php
===================================================================
--- trunk/client/temi/blog/menu.php	(revision 281)
+++ trunk/client/temi/blog/menu.php	(revision 282)
@@ -133,5 +133,5 @@
 	  }
 
-	if (!$votol and $fascia>$limite){ // si vota per la lista
+	if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
 			if ($genere>2) {
 				if (!$circo and $num_circ>1)
Index: trunk/client/temi/default/menu.php
===================================================================
--- trunk/client/temi/default/menu.php	(revision 281)
+++ trunk/client/temi/default/menu.php	(revision 282)
@@ -134,5 +134,5 @@
 	  }
 
-	if (!$votol and $fascia>$limite){ // si vota per la lista
+	if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
 			if ($genere>2) {
 				if (!$circo and $num_circ>1)
Index: trunk/client/temi/facebook/menu.php
===================================================================
--- trunk/client/temi/facebook/menu.php	(revision 281)
+++ trunk/client/temi/facebook/menu.php	(revision 282)
@@ -156,5 +156,5 @@
 	  }
 
-	if (!$votol and $fascia>$limite){ // si vota per la lista
+	if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
 			if ($genere>2) {
 				if (!$circo and $num_circ>1)
Index: trunk/client/temi/realistic/index.php
===================================================================
--- trunk/client/temi/realistic/index.php	(revision 281)
+++ trunk/client/temi/realistic/index.php	(revision 282)
@@ -15,7 +15,9 @@
 global $tema,$file,$sitename,$blocco,$dbi,$prefix,$id_comune;
 
-$res = mysql_query("SELECT descrizione,simbolo FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi);
-	list($descr_com,$simbolo) = mysql_fetch_row($res);
-        $descr_com =stripslashes($descr_com); 
+$sql="SELECT descrizione,simbolo FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
+$res = $dbi->prepare("$sql");
+$res->execute();
+list($descr_com,$simbolo) = $res->fetch(PDO::FETCH_NUM);
+$descr_com =stripslashes($descr_com); 
 
 
Index: trunk/client/temi/realistic/menu.php
===================================================================
--- trunk/client/temi/realistic/menu.php	(revision 281)
+++ trunk/client/temi/realistic/menu.php	(revision 282)
@@ -146,5 +146,5 @@
 	  }
 
-	if (!$votol and $fascia>$limite){ // si vota per la lista
+	if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
 			if ($genere>2) {
 				if (!$circo and $num_circ>1)
Index: trunk/client/temi/spectral/index.php
===================================================================
--- trunk/client/temi/spectral/index.php	(revision 281)
+++ trunk/client/temi/spectral/index.php	(revision 282)
@@ -15,6 +15,9 @@
 global $tema,$file,$sitename,$blocco,$dbi,$prefix,$id_comune,$descr_cons,$op;
 
-$res = mysql_query("SELECT descrizione,simbolo FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi);
-	list($descr_com,$simbolo) = mysql_fetch_row($res);
+$sql="SELECT descrizione,simbolo FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
+$res = $dbi->prepare("$sql");
+$res->execute();
+
+	list($descr_com,$simbolo) = $res->fetch(PDO::FETCH_NUM);
         $descr_com =stripslashes($descr_com); 
 
@@ -148,6 +151,8 @@
 	if($pos=="dx") $p=0; elseif($pos=="sx")$p=1;else $p='';
 	
-	$resblk = mysql_query("SELECT * FROM ".$prefix."_ele_widget where pos_or='$p' and attivo='1' order by pos_ver asc", $dbi);
-	if($resblk){
+	$sql="SELECT * FROM ".$prefix."_ele_widget where pos_or='$p' and attivo='1' order by pos_ver asc";
+$resblk = $dbi->prepare("$sql");
+$resblk->execute();
+	if($resblk->rowCount()){
 		
 		while ($row = mysql_fetch_array($resblk)) {
Index: trunk/client/temi/spectral/menu.php
===================================================================
--- trunk/client/temi/spectral/menu.php	(revision 281)
+++ trunk/client/temi/spectral/menu.php	(revision 282)
@@ -146,5 +146,5 @@
 	  }
 
-	if (!$votol and $fascia>$limite){ // si vota per la lista
+	if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
 			if ($genere>2) {
 				if (!$circo and $num_circ>1)
Index: trunk/client/temi/stylized/menu.php
===================================================================
--- trunk/client/temi/stylized/menu.php	(revision 281)
+++ trunk/client/temi/stylized/menu.php	(revision 282)
@@ -134,5 +134,5 @@
 	  }
 
-	if (!$votol and $fascia>$limite){ // si vota per la lista
+	if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
 			if ($genere>2) {
 				if (!$circo and $num_circ>1)
Index: trunk/client/temi/tour/index.php
===================================================================
--- trunk/client/temi/tour/index.php	(revision 281)
+++ trunk/client/temi/tour/index.php	(revision 282)
@@ -61,6 +61,8 @@
 if (isset($param['id_comune'])) $id_comune=intval($param['id_comune']); else $id_comune=$siteistat;
 
-$res = mysql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi);
-	list($descr_com) = mysql_fetch_row($res);
+$sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
+$res = $dbi->prepare("$sql");
+$res->execute();
+list($descr_com) = $res->fetch(PDO::FETCH_NUM);
 
 
@@ -163,6 +165,8 @@
 // Blocco link
 
-$result = mysql_query("select mid, title, preamble, content,editimage from ".$prefix."_ele_link where id_cons='$id_cons' order by mid ", $dbi);
-    if (mysql_num_rows($result) == 0) {
+$sql="select mid, title, preamble, content,editimage from ".$prefix."_ele_link where id_cons='$id_cons' order by mid ";
+$result = $dbi->prepare("$sql");
+$result->execute();
+   if ($result->rowCount() == 0) {
 	//echo "</div></td></tr></table>";
         
@@ -171,5 +175,5 @@
     } else {
 	echo "<h5>"._LINK."</h5><p>";
-	while (list($mid, $title, $preamble,$content,  $editimage) = mysql_fetch_row($result)) {
+	while (list($mid, $title, $preamble,$content,  $editimage) = $result->fetch(PDO::FETCH_NUM)) {
   		if ($title != "" && $content != "") {
 			$content = stripslashes($content);
Index: trunk/client/temi/tour/menu.php
===================================================================
--- trunk/client/temi/tour/menu.php	(revision 281)
+++ trunk/client/temi/tour/menu.php	(revision 282)
@@ -133,5 +133,5 @@
 	  }
 
-	if (!$votol and $fascia>$limite){ // si vota per la lista
+	if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
 			if ($genere>2) {
 				if (!$circo and $num_circ>1)
Index: trunk/client/temi/yellowblu/index.php
===================================================================
--- trunk/client/temi/yellowblu/index.php	(revision 281)
+++ trunk/client/temi/yellowblu/index.php	(revision 282)
@@ -18,6 +18,8 @@
 if (isset($param['id_comune'])) $id_comune=intval($param['id_comune']); else $id_comune=$siteistat;
 
-$res = mysql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi);
-	list($descr_com) = mysql_fetch_row($res);
+$sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
+$res = $dbi->prepare("$sql");
+$res->execute();
+	list($descr_com) = $res->fetch(PDO::FETCH_NUM);
 
 
Index: trunk/client/temi/yellowblu/menu.php
===================================================================
--- trunk/client/temi/yellowblu/menu.php	(revision 281)
+++ trunk/client/temi/yellowblu/menu.php	(revision 282)
@@ -134,5 +134,5 @@
 	  }
 
-	if (!$votol and $fascia>$limite){ // si vota per la lista
+	if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
 			if ($genere>2) {
 				if (!$circo and $num_circ>1)
