" .""; $resl = mysql_query("SELECT * FROM ".$prefix."_config", $dbi); $gru=mysql_fetch_array($resl); echo ""; echo ""; echo "
"; echo ""; echo ""; echo ""; verificatema(); //funzione alla fine del file ########## $resmod = mysql_query("SELECT tema FROM ".$prefix."_ele_temi order by tema", $dbi); 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""; $resmod = mysql_query("SELECT id_comune,descrizione FROM ".$prefix."_ele_comuni order by descrizione", $dbi); 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' $result = mysql_query("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'", $dbi) || die("Errore di aggiornamento dei dati!".mysql_error()); 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 = mysql_query("SELECT id FROM ".$prefix."_ele_temi where tema='$files'", $dbi); list($idwid) = mysql_fetch_row($sql); $id = intval($idwid); if (empty($id)) { // inserisce widget db se non esiste $result = mysql_query("insert into ".$prefix."_ele_temi (id,tema) values ( NULL,'$files')", $dbi); } } } # se non esiste cancella dal db $sql2 = mysql_query("SELECT * FROM ".$prefix."_ele_temi", $dbi); while ($row = mysql_fetch_array($sql2)) { $esi=0; for ($i=0; $i < sizeof($tlist); $i++) { $files=$tlist[$i]; if($row['tema']==$files) $esi=1; } if($esi!=1){ $del=mysql_query("DELETE FROM ".$prefix."_ele_tema WHERE id = '$row[id]'",$dbi); } } ################# fine } ?>