Execute($q); $rw = $r->fields; $explo_level[0]="r".$rw['idr']; $explo_level[1]="r".$rw['idsr']; } } $GLOBALS['idr'] = str_replace("r","",$explo_level[0]); $GLOBALS['idsr'] = str_replace("r","",$explo_level[1]); //lettura dei servizi: li leggo tutti per mettere a disposizione sotto GLOBAL le variabili $q="SELECT * FROM CMZ_servizi WHERE ids=".$idx; $result = mysql_query($q); //echo $q.mysql_error(); $val1=mysql_fetch_array($result); for($x=0;$x$val-->
"; } ################################################################################ function passReq() { global $cmzLabel; echo "
"; include('login3parte.php'); echo "
"; /* echo "

".$cmzLabel['protetto']."

"; echo "
"; echo ""; echo ""; echo ""; echo ""; */ } ################################################################################ function fotoArticolo($ida){ global $cmzLabel; global $conn; $q = "select CMZ_allegati.*, nome from CMZ_allegati, CMZ_magazzino where CMZ_magazzino.id_mag=CMZ_allegati.id_mag AND ida=$ida AND (nome like '%jpg' OR nome like '%gif') order by ordine DESC"; $r = $conn->Execute($q); echo $conn->ErrorMsg(); $arrayImg = array(); $i=0; while(!$r->EOF){ $rw = $r->fields; $arrayImg[$i]['nome']=$rw['nome']; $arrayImg[$i]['didascalia']=$rw['didascalia']; $i++; $r->MoveNext(); } return $arrayImg; } ################################################################################ function wai_menuleft(){ global $cmzLabel; $m = new menuItem(); global $conn; echo "\n"; echo "\n"; echo "\n
"; echo "\n

Home

"; $r = $m->setQuery("r", "idu=".$GLOBALS['idx']); while(!$r->EOF){ $rw = $r->fields; $m->setMenu("r",$rw); if($m->isVisible()){ $GLOBALS['structure']['r'.$rw[lnkIdx]]['fields'] = $rw; echo $m->getLnkCode(); echo "\n
divDisplay."\">"; if($m->subOk){ $r2 = $m->setQuery("s", "CMZ_sottorubriche.idr=".$rw[lnkIdx]); while(!$r2->EOF){ $rw2 = $r2->fields; $m->setMenu("s",$rw2); if($m->isVisible()){ $GLOBALS['structure']['r'.$rw[lnkIdx]]['srb']['s'.$rw2[lnkIdx]]['fields'] = $rw2; if(!$m->cat_unica){ echo $m->getLnkCode(); echo "\n
divDisplay."\">"; } if($m->subOk){ $r3 = $m->setQuery("a", "CMZ_articoli.idsr=".$rw2[lnkIdx]); while(!$r3->EOF){ $rw3 = $r3->fields; $m->setMenu("a",$rw3); if($m->isVisible()){ $GLOBALS['structure']['r'.$rw[lnkIdx]]['srb']['s'.$rw2[lnkIdx]]['art'][] = $rw3; if(!$GLOBALS['structure']['r'.$rw[lnkIdx]]['srb']['s'.$rw2[lnkIdx]]['fields']['cat_unica'])echo $m->getLnkCode(); else echo "\n

".$m->getLnkLinkCode()."

"; } $r3->MoveNext(); } } if(!$GLOBALS['structure']['r'.$rw[lnkIdx]]['srb']['s'.$rw2[lnkIdx]]['fields']['cat_unica'])echo "\n
"; } $r2->MoveNext(); } } echo "\n
"; } $r->MoveNext(); } echo "
"; echo "

".$cmzLabel['ottimizzato']."

"; echo "
"; echo "\n
"; } ################################################################################ function heading(){ global $cmzLabel; echo "\n".$GLOBALS['titolo'].""; //echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; //alta accessibilità if($_GET['info']=="access")include_once $GLOBALS['pathfile']."accessibilty_functions.html"; //stampa if($_GET['info']=="stampa")include_once $GLOBALS['pathfile']."print_functions.html"; }//function ################################################################################ function wai_editoriale(){ global $cmzLabel; $lan=$_SESSION['lan']; echo "\n
"; if($GLOBALS['fotocopertina2']) echo "\n\"".$GLOBALS['keywords']."\""; if(!$GLOBALS['htmlarea']) $GLOBALS['editoriale'.$lan] = nl2br($GLOBALS['editoriale'.$lan]); echo "\n

".cleanString($GLOBALS['editoriale'.$lan])."

"; echo "\n
"; } ################################################################################ function wai_detail(){ global $cmzLabel; global $conn; global $DB3Parte; //carico le foto dell'articolo $artImages=fotoArticolo($GLOBALS['ida']); $lan=$_SESSION['lan']; $titoloart="titolo".$lan; $sovratit="sovratitolo".$lan; $sottotit="sottotitolo".$lan; $testox="testoit".$lan; $result = $conn->Execute("SELECT * FROM CMZ_articoli WHERE ida=".$GLOBALS['ida']); $val1 = $result->fields; $x=0; foreach($val1 as $key => $value) $$key=$value; $idr = substr($GLOBALS[explo_level][0],1); $GLOBALS['artImg']=$artImages[0]['nome']; $GLOBALS['artTit']=$val1[$titoloart]; /* gestione protezione con password */ if($_POST['registrami']) { $cognome=$_POST['cognome']; $nome=$_POST['nome']; $email=$_POST['email']; $username=$_POST['accediUsername']; $password=$_POST['accediPassword']; $lingua=$_POST['language']; $veroDB3Parte=$DB3Parte.$lingua; $_SESSION['lan']=$lingua; $q="SELECT id FROM $veroDB3Parte.persone WHERE username='$username'"; $r=$conn->Execute($q); if($r->NumRows()==0) //se non e' gia' presente { // lo inserisco $q="INSERT INTO $veroDB3Parte.persone SET email='$email', username='$username', password='$password',cognome='$cognome',nome='$nome', language='$lingua',dataRegistrazione=".time(); $r1=$conn->Execute($q); $idPersona=$conn->Insert_ID(); $_SESSION['idPersona']=$idPersona; $_SESSION['modifica']='si'; /* invio una mail a chi? */ $oggetto=$cmzLabel['m1']; // $testo="public_function.html riga 240 : testo provvisorio

"; $testo.=$cmzLabel['m2']."$cognome $nome ".$cmzLabel['m3']." $username ".$cmzLabel['m4']." $password ".$cmzLabel['m5']." $email ".$cmzLabel['m6']." ".$cmzLabel['m7']." ".$cmzLabel['m8']." ".$cmzLabel['m9']; // $testo.="username: $username
"; // $testo.="password: $password
email:$email"; $mailTo=$email; // $mailTo="carniel@valdocco.edu"; send_platform_mail($oggetto,$testo,$mailTo); } else { echo ""; passReq();die(); } //echo $_SESSION['idPersona']; } if($_SESSION['idPersona']||!$password || ($password && wai_perm_read($GLOBALS['idx'],$GLOBALS['ida'],'orientami',$_POST['accediPassword'],$_POST['accediUsername']))) { if($visibile) { echo "\n "; if($_POST['fotoSel']){ echo "\n
"; echo "\n\"\""; echo "\n
<< torna all'articolo"; echo "\n
"; } else { echo "\n"; echo "\n
"; // echo "

n. : ".$GLOBALS['ida']."

"; if($sovratit) echo "\n

".$val1[$sovratit]."

"; if($titoloart) echo "\n

".$val1[$titoloart]."

"; if($sottotit) echo "\n

".$val1[$sottotit]."

"; echo "\n"; if($artImages[0]['nome']){ $f=@getimagesize($GLOBALS['pathimg']."/".$artImages[0]['nome']); $fotosource=""; $fotosource.="\"\""; if($artImages[0]['didascalia']){ $fotosource.=""; } $fotosource.="
"; } $testoArticolo = $val1[$testox]; //commentato da elena del 20-09-2007 if(!$htmlcode && !$GLOBALS["htmlarea"])$testoArticolo = nl2br($testoArticolo); $testoArticolo = cleanString($testoArticolo,0,1); $testoArticolo = $fotosource."".$testoArticolo.""; echo "\n
".$testoArticolo."
"; //testo del messaggio switch($tipo){ case 2: if($htm){ $nome=topo($htm,"id_mag","nome","CMZ_magazzino"); echo "\n

".$nome."

"; } break; case 3: if($iframelink != 1) echo "\n

".$link."

"; else echo "\n"; break; } echo "\n"; if(count($artImages)>1){ echo "\n
"; for($x=1;$x"; echo "\n"; echo "\n\"\"/"; echo "\n"; echo "\n".$artImages[$x]['didascalia'].""; echo "\n
"; } echo "\n
"; } echo "\n"; echo "\n"; $q1 = "SELECT CMZ_allegati.*,nome,size FROM CMZ_allegati,CMZ_magazzino WHERE CMZ_magazzino.id_mag=CMZ_allegati.id_mag AND nome not like '%jpg' AND nome not like '%gif' AND ida=".$GLOBALS['ida']." order by ordine DESC"; $r1 = $conn->Execute($q1); while(!$r1->EOF){ $rw1 = $r1->fields; $kon++; if($rw1[didascalia])$testoAll=$rw1[didascalia];else $testoAll=$rw1[nome]; echo "\n

".$testoAll." - [".$rw1[size]." bytes]

"; $r1->MoveNext(); } echo "\n"; echo "\n"; //stampo i link allegati $q2 = "select * from CMZ_allegati where CMZ_allegati.ida=".$GLOBALS['ida']." AND id_mag=0 order by ordine DESC"; $r2 = $conn->Execute($q2); while(!$r2->EOF){ $rw2 = $r2->fields; if($rw2[didascalia])$testoAll=$rw2[didascalia];else $testoAll=$rw2[link]; echo "\n

".$testoAll."

"; $r2->MoveNext(); } echo "\n"; $q = "SELECT * FROM CMZ_blog_comm WHERE ida=".$GLOBALS[ida]." ORDER BY data ASC"; $r = $conn->Execute($q); if($r->RecordCount()){ echo "\n
"; echo "\n

Commenti

"; while(!$r->EOF){ $rw = $r->fields; echo "\n
"; echo "\n

".$rw[autore]." | ".date("d-m-Y, H:i",$rw[data])."

"; echo "\n

".stripslashes(nl2br($rw[testo]))."

"; echo "\n
"; $r->MoveNext(); } echo "\n
"; } echo "\n"; //navigatore tra gli articoli $r = $conn->Execute("SELECT articoli_seq FROM CMZ_sottorubriche WHERE idsr=".$idsr); $isnav = $r->fields; if($isnav['articoli_seq']){ $m = new menuItem(); $maxOrd = count($GLOBALS['structure']['r'.$idr]['srb']['s'.$idsr]['art']); echo "\n
"; if($ordine > 1){ $m->setMenu('a',$GLOBALS['structure']['r'.$idr]['srb']['s'.$idsr]['art'][($ordine-2)]); echo "\ngetLnkLink()."\"><< ".$cmzLabel['218'].""; } if(($ordine > 1) && ($maxOrd != $ordine))echo "\n   |   "; if($maxOrd != $ordine){ $m->setMenu('a',$GLOBALS['structure']['r'.$idr]['srb']['s'.$idsr]['art'][($ordine)]); echo "\n getLnkLink()."\">".$cmzLabel['179']." >>"; } echo "\n
"; } } } }// fine gestione protezione con password else passReq(); } ################################################################## function wai_homepagenews($columns=3){ global $cmzLabel; $m = new menuItem(); echo "\n\n"; echo "\n
"; $r = $m->setQuery("a", "homenews_pos<>0 AND idu=".$GLOBALS['idx'],"homenews_pos ASC, "," GROUP BY ida"); while(!$r->EOF){ $rw = $r->fields; $m->setMenu("a",$rw); if($m->isVisible()){ if(($cnt%$columns) == 0 )echo "\n
"; $cnt++; echo "\n
"; echo "\n

getLnkLink()."\">".$m->getLnkName()."

"; if($m->homenews_foto==1){ $fotoA = fotoArticolo($rw[lnkIdx]); if($fotoA[0]){ echo "\n getLnkLink()."\">"; echo "\"\""; echo ""; } } echo "\n

"; echo "\ngetLnkLink()."\">"; echo subString(strip_tags($m->text,""; echo "\n

"; } /** funzione che permette di visualizzare la rubrica dei credits *@author elena carniel * inseerita il 04-07-2007 */ ################################################################################ function viewCredits() { global $cmzLabel; global $conn; $lan=$_SESSION['lan']; // $idr=substr($GLOBALS['explo_level'][0],1); // seleziono la sottorubrica che ha i testi per i credits di questa seleziono articolo $q="SELECT r.*,a.* FROM CMZ_sottorubriche as r,CMZ_servizi as s, CMZ_articoli as a WHERE s.creditsIdsr=r.idsr AND a.idsr=s.creditsIdsr AND s.ids=".$GLOBALS['idx']; $r = $conn->Execute($q); $rw = $r->fields; echo "\n
"; echo "\n"; echo "\n

".$rw['nome'.$lan]."

"; if($rw[foto]>0)echo "\n

\"\"

"; $text=nl2br($rw['testoit'.$lan]); echo "\n

".cleanString($text)."

"; echo "\n"; echo "\n "; echo "
"; } /** funzione che permette di controllare i permessi *@author elena carniel * inserita il 05-07-2007 * tipo == r Rubriche * tipo == s Sottorubriche * tipo == a Articoli */ ################################################################################ function wai_perm_read($idEnte,$id,$tipo,$pass,$user) { global $conn; global $DB3Parte; if($_SESSION['lan']) $DB3Parte=$DB3Parte.$_SESSION['lan']; else $DB3Parte=$DB3Parte."it"; $_SESSION['dataBaseQuestions']=$DB3Parte; switch($tipo) { case "r": $tabella="CMZ_rubriche"; $campo="idr"; break; case "s": $tabella="CMZ_sottorubriche"; $campo="idsr"; break; case "a": $tabella="CMZ_articoli"; $campo="ida"; break; case "orientami": // cerco sul DB di orientarsiQuestions if($user&&$pass) { $q="SELECT id,cognome,nome FROM $DB3Parte.persone WHERE username='$user'AND password='$pass'"; $r=$conn->Execute($q); if($r->NumRows()!=0) //se e' presente { $idPersona=$r->fields['id']; $cognome=$r->fields['cognome']; $nome=$r->fields['nome']; $_SESSION['idPersona']=$idPersona; $_SESSION['infoNome']=$nome." ".$cognome; // qui richiamo una funzione ajax che mi modifica il campo in alto (div#login) echo ""; //aggiorno il dato dell'ultimo accesso $q="UPDATE $DB3Parte.persone SET ultimoAccesso=".time()." WHERE id=$idPersona"; $r=$conn->Execute($q); return true; } else return false; } else return false; break; } $q="SELECT password FROM $tabella WHERE $campo=$id"; $r=$conn->Execute($q); if($pass===$r->fields['password']) return true; else return false; } function wai_photogallery(){ global $conn; $myLan = $_SESSION[lan]; $cell = 3; echo "\n"; echo "\n
"; echo "\n

Photogallery

"; $q = "SELECT idr,if(nome".$myLan."<>'',nome".$myLan.",nome) AS nome,foto FROM CMZ_rubriche WHERE idu=".$GLOBALS['idx']." AND cancellato=0 AND visibile=1 ORDER BY ordine"; $r = $conn->Execute($q); while(!$r->EOF){ $rw = $r->fields; $i=0; //if(!$disp)$disp=" style=\"\""; else $disp=" style=\"display:none;\""; echo "\n

".$rw[nome]."

"; echo "\n
"; echo "\n"; if($i==0)$stlback=" style=\"background:url('style/windows/T_arancio.png') no-repeat left -30px\"";else $stlback=""; echo "\n"; $nomeFoto = topo($rw[foto],"id_mag","nome","magazzino"); if(file_exists($GLOBALS[pathimg]."/".$nomeFoto)){ if($i!=0 && (($i%$cell)==0))echo ""; if($GLOBALS[oldLink])$myLink = "?explo_level[0]=r".$rw[idr]; else $myLink = strip_tags(str_replace("\"","",str_replace(" ","_","cmz".$rw[idr]."/".$rw[nome]."/a.html"))); echo "\n"; $i++; } $q2 = "SELECT idsr,if(nome".$myLan."<>'',nome".$myLan.",nome) AS nome,foto FROM CMZ_sottorubriche WHERE idr=".$rw[idr]." AND cancellato=0 AND visibile=1 ORDER BY ordine"; $r2 = $conn->Execute($q2); while(!$r2->EOF){ $rw2 = $r2->fields; $nomeFoto = topo($rw2[foto],"id_mag","nome","magazzino"); if(file_exists($GLOBALS[pathimg]."/".$nomeFoto)){ if($i!=0 && (($i%$cell)==0))echo ""; if($GLOBALS[oldLink])$myLink = "?explo_level[0]=r".$rw[idr]."&explo_level[1]=r".$rw2[idsr]; else $myLink = strip_tags(str_replace("\"","",str_replace(" ","_","cmz".$rw[idr]."-".$rw2[idsr]."/".$rw[nome]."/".$rw2[nome]."/a.html"))); echo "\n"; $i++; } $q3 = "SELECT CMZ_articoli.ida,if(titolo".$myLan."<>'',titolo".$myLan.",titolo) AS titolo, nome, didascalia FROM CMZ_articoli, CMZ_allegati, CMZ_magazzino WHERE idsr =".$rw2[idsr]." AND CMZ_articoli.ida = CMZ_allegati.ida AND CMZ_allegati.id_mag = CMZ_magazzino.id_mag AND CMZ_articoli.cancellato=0 AND CMZ_articoli.visibile=1 AND (nome LIKE '%.jpg' OR nome LIKE '%.jpeg') ORDER BY CMZ_articoli.ordine , CMZ_articoli.ida "; $r3 = $conn->Execute($q3); while(!$r3->EOF){ $rw3 = $r3->fields; if($rw3[didascalia])$dida=$rw3[didascalia]; else $dida=$rw3[titolo]; if(file_exists($GLOBALS[pathimg]."/".$rw3[nome])){ if($i!=0 && (($i%$cell)==0))echo ""; if($GLOBALS[oldLink])$myLink = "?explo_level[0]=r".$rw[idr]."&explo_level[1]=r".$rw2[idsr]."&ida=".$rw3[ida]; else $myLink = strip_tags(str_replace("\"","",str_replace(" ","_","cmz".$rw[idr]."-".$rw2[idsr]."-".$rw3[ida]."/".$rw[nome]."/".$rw2[nome]."/".$rw3[titolo]."/a.html"))); echo "\n"; $i++; } $r3->MoveNext(); } $r2->MoveNext(); } echo "\n"; echo "\n

".$cmzLabel['6']."

".$rw2[nome]."

".$dida."

"; echo "\n

 

"; echo "\n
"; $r->MoveNext(); } echo "\n
"; echo "\n"; } ?>