" .""; $sql="SELECT * FROM ".$prefix."_config"; $sth = $dbi->prepare("$sql"); $sth->execute(); $gru = $sth->fetch(PDO::FETCH_BOTH); echo ""; echo ""; echo "
"; echo ""; echo ""; echo ""; verificatema(); //funzione alla fine del file ########## $sql="SELECT tema FROM ".$prefix."_ele_temi order by tema"; $sth = $dbi->prepare("$sql"); $sth->execute(); $row = $sth->fetchAll(); echo ""; $sel= ($gru['blocco']==1) ? "selected":""; echo ""; $sel= ($gru['flash']==1) ? "selected":""; echo ""; echo ""; $sel= ($gru['multicomune']==1) ? "selected":""; echo ""; // echo ""; # echo "" # ."" echo "" .""; echo""; echo ""; echo""; $sql = "SELECT id_comune,descrizione FROM ".$prefix."_ele_comuni order by descrizione"; $sth = $dbi->prepare("$sql"); $sth->execute(); $row = $sth->fetchAll(); echo ""; echo ""; ########## echo ""; $sel= ($gru['googlemaps']==1) ? "selected":""; echo ""; /* tolta la chiave echo ""; */ $sel= ($gru['editor']==1) ? "selected":""; echo ""; /* echo ""; echo ""; */ echo ""; # $sel= ($gru['displayerrors']==1) ? "selected":""; # echo ""; echo ""; echo "
"._CONFIGDEFAULT."
 
"; $sel= ($gru['tema_on']==1) ? "selected":""; echo ""._TEMAATTIVO.""; echo ""._TEMA."
"._BLOCCO.""._FLASH."
"._MULTICOMUNE.""._FILEOUT."".$gru['fileout']."
"._PREFIX.""._ADMINMAIL."
"._SITEURL.""._TESTATA."
"._SITENAME."
"._SITEISTAT.""._LANGUAGE."
"._GOOGLEMAPS.""._GKEY."
"._EDITOR."
"._EDUSER."
"._DISPLAYERRORS.""; echo ""; echo "
"; echo "
"; } //*********************************************************** //Funzione di inserimento e gestione dei gruppi //************************************************************ function confcons() { global $id_cons_gen, $prefix, $dbi, $blocco,$tema2,$multicomune,$fileout,$prefix2,$adminmail,$siteurl,$sitename,$siteistat,$language2,$flash2,$displayerrors; global $gkey,$ed_user,$googlemaps,$editor,$tema_on; $aid=$_SESSION['aid']; $perms=ChiSei($id_cons_gen); if ($perms >128) { $stemmablob=''; $stemmanome=''; $STEMM=$_FILES['sitelogo']; $filestemma=$STEMM['tmp_name']; $nomestemma=$STEMM['name']; $sqlset=''; if ($filestemma){ $fdstemma = fopen ("$filestemma", "rb"); $stemmacontents = fread ($fdstemma, filesize ("$filestemma")); fclose ($fdstemma); $stemmablob=addslashes($stemmacontents); $stemmanome=addslashes($nomestemma); } #displayerrors='$displayerrors', #per il momento non รจ usato: , site_logo='$site_logo' $sql = "update ".$prefix."_config set sitename='$sitename', testata='$stemmablob', nome_testata='$stemmanome', blocco='$blocco', multicomune='$multicomune', language='$language2', siteistat='$siteistat', adminmail='$adminmail', siteurl='$siteurl', flash='$flash2', tema='$tema2',gkey='$gkey',ed_user='$ed_user',googlemaps='$googlemaps',editor='$editor',tema_on='$tema_on'"; $sth = $dbi->prepare("$sql"); $sth->execute(); if ($tema2=='facebook') $_SESSION['tema']=$tema2; else $_SESSION['tema']='default'; Header("Location: admin.php?id_cons_gen=$id_cons_gen"); } } if ($do and $do="modify") confcons(); ele(); all(); echo""; include("footer.php"); function verificatema(){ ############# verifica tema - presenti nella dir temi global $dbi,$prefix; $tlist='';$files=''; $path = "../client/temi"; $handle=opendir($path); while ($file = readdir($handle)) { $tlist .= "$file "; } closedir($handle); $tlist = explode(" ", $tlist); sort($tlist); for ($i=0; $i < sizeof($tlist); $i++) { if ( (preg_match('/^([_0-9a-zA-Z]+)([_0-9a-zA-Z]{3})$/',$tlist[$i])) ) $files=$tlist[$i]; if($files!=''){ $sql = "SELECT id FROM ".$prefix."_ele_temi where tema='$files'"; $sth = $dbi->prepare("$sql"); $sth->execute(); if($sth->rowCount()) { $row = $sth->fetch(PDO::FETCH_BOTH); $id = intval($row[0]); } else { $id=0; } if (empty($id)) { // inserisce widget db se non esiste $sql="insert into ".$prefix."_ele_temi (id,tema) values ( NULL,'$files')"; $sth = $dbi->prepare("$sql"); $sth->execute(); } } } # se non esiste cancella dal db $sql = "SELECT * FROM ".$prefix."_ele_temi"; $sth = $dbi->prepare("$sql"); $sth->execute(); while( $row = $sth->fetch(PDO::FETCH_BOTH)) { # foreach($sql2 as $row){ $esi=0; for ($i=0; $i < sizeof($tlist); $i++) { $files=$tlist[$i]; if($row['tema']==$files) $esi=1; } if($esi!=1){ $sql="DELETE FROM ".$prefix."_ele_temi WHERE id = '$row[id]'"; $sth = $dbi->prepare("$sql"); $sth->execute(); } } ################# fine } ?>