Index: trunk/admin/temi/facebook/index.php
===================================================================
--- trunk/admin/temi/facebook/index.php	(revision 253)
+++ trunk/admin/temi/facebook/index.php	(revision 257)
@@ -95,6 +95,9 @@
 // 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";
+	$sth = $dbi->prepare("$sql");
+	$sth->execute();	
+	$row = $sth->fetchAll();
+    if ($sth->rowCount() == 0) {
 	echo "</td></tr></table>";
         echo "</div></td><td>";
@@ -103,5 +106,6 @@
     } else {
 	echo "<h5>"._LINK."</h5><p>";
-	while (list($mid, $title, $preamble,$content,  $editimage) = mysql_fetch_row($result)) {
+	foreach($row as $row2) {
+		list($mid, $title,$preamble,$content,$editimage) = explode($row2)) {
   		if ($title != "" && $content != "") {
 			$content = stripslashes($content);
Index: trunk/admin/temi/facebook/menu.php
===================================================================
--- trunk/admin/temi/facebook/menu.php	(revision 253)
+++ trunk/admin/temi/facebook/menu.php	(revision 257)
@@ -19,7 +19,9 @@
 	$button="<br /><object><noscript><div><input name=\"vai\" type=\"image\" src=\"modules/Elezioni/images/ok2.jpg\" alt=\"ok\" title=\"ok\" /></div></noscript></object>";
 	
-	$sqlcomu="select descrizione,fascia from ".$prefix."_ele_comuni where id_comune=$id_comune";
-	$rescomu= mysql_query("$sqlcomu",$dbi);
-	list($descr_com,$fascia)=mysql_fetch_row($rescomu);
+	$sql="select descrizione,fascia from ".$prefix."_ele_comuni where id_comune=$id_comune";
+	$sth = $dbi->prepare("$sql");
+	$sth->execute();	
+	$row = $sth->fetch(PDO::FETCH_BOTH);
+	list($descr_com,$fascia)=explode($row);
         echo '<style type="text/css">
 		html,body{margin:0;padding:0}
@@ -52,7 +54,9 @@
 	if ($multicomune=='1')
 	{
-	      $sqlcomu="select t1.id_comune,t1.descrizione,count(0) from ".$prefix."_ele_comuni as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_comune=t2.id_comune group by t1.id_comune,t1.descrizione order by t1.descrizione asc";
-	      $rescomu= mysql_query("$sqlcomu",$dbi);
-	      $esiste_multi=mysql_num_rows($rescomu);
+	      $sql="select t1.id_comune,t1.descrizione,count(0) from ".$prefix."_ele_comuni as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_comune=t2.id_comune group by t1.id_comune,t1.descrizione order by t1.descrizione asc";
+	$sth = $dbi->prepare("$sql");
+	$sth->execute();	
+	$row = $sth->fetch(PDO::FETCH_BOTH);	      
+	$esiste_multi=mysql_num_rows($rescomu);
 	      if ($esiste_multi>=1) {
 		    echo " <li>
@@ -61,5 +65,5 @@
 			  <ul>";
 			
-		      while (list($id,$descrizione,)=mysql_fetch_row($rescomu)){
+		      while (list($id,$descrizione,)=$sth->fetch(PDO::FETCH_NUM)){
 			    echo "<li><a href=\"modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id&amp;file=index\">$descrizione</a></li>";
 			}
@@ -75,6 +79,8 @@
 	***********************************/
        
-	$res = mysql_query("SELECT t1.id_cons_gen,t1.descrizione FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune='$id_comune' and t2.chiusa!='2' order by t1.data_fine desc" , $dbi); 
-	$esiste=mysql_num_rows($res);
+	$sql = "SELECT t1.id_cons_gen,t1.descrizione FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune='$id_comune' and t2.chiusa!='2' order by t1.data_fine desc"; 
+	$sth = $dbi->prepare("$sql");
+	$sth->execute();	
+	$esiste=$sth->rowCount();
 	//se esiste consultazione fa vedere i dati
 	if ($esiste>=1) {
@@ -83,5 +89,5 @@
 	    <ul>";
 	 
-	    while(list($id,$descrizione) = mysql_fetch_row($res)) {
+	    while(list($id,$descrizione) = $sth->fetch(PDO::FETCH_NUM)) {
 		echo "<li><a href=\"modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id_comune&amp;file=index&amp;id_cons_gen=$id\">
 	      ".substr($descrizione,0,31)."</a></li>";
@@ -124,5 +130,8 @@
 
  	$res = mysql_query("SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ", $dbi);
-	list($num_circ) = mysql_fetch_row($res);
+	$sql = "SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons'"; 
+	$sth = $dbi->prepare("$sql");
+	$sth->execute();	
+	list($num_circ) = $sth->fetch(PDO::FETCH_NUM);
        	 echo " <li><a href=\"#\"><strong>"._RISULTATI."</strong></a>
 	    <ul>";
