explnum_bulletin != 0){ //si bulletin, les droits sont rattachés à la notice du pério... $req = "select bulletin_notice from bulletins where bulletin_id =".$ligne->explnum_bulletin; $res = mysql_query($req); if(mysql_num_rows($res)){ $perio_id = mysql_result($res,0,0); } }else $perio_id = 0; //droits d'acces emprunteur/notice if ($gestion_acces_active==1 && $gestion_acces_empr_notice==1) { $ac= new acces(); $dom_2= $ac->setDomain(2); $rights= $dom_2->getRights($_SESSION['id_empr_session'],($perio_id != 0 ? $perio_id : $ligne->explnum_notice)); } //Accessibilité des documents numériques aux abonnés en opac if ($ligne->explnum_notice) { $req_restriction_abo = "SELECT explnum_visible_opac, explnum_visible_opac_abon FROM notices,notice_statut WHERE notice_id='".$ligne->explnum_notice."' AND statut=id_notice_statut "; } else { $req_restriction_abo = "SELECT explnum_visible_opac, explnum_visible_opac_abon FROM bulletins,notices,notice_statut WHERE bulletin_id='".$ligne->explnum_bulletin."' and bulletin_notice=notice_id AND statut=id_notice_statut "; } $result=mysql_query($req_restriction_abo,$dbh); $expl_num=mysql_fetch_object($result); if( $rights & 16 || (is_null($dom_2) && $expl_num->explnum_visible_opac && (!$expl_num->explnum_visible_opac_abon || ($expl_num->explnum_visible_opac_abon && $_SESSION["user_code"])))){ if ($ligne->explnum_data) { if($ligne->explnum_mimetype == 'application/pdf'){ $contenu_vignette = $ligne->explnum_data; header('Content-type: application/pdf'); }else $contenu_vignette=reduire_image_middle($ligne->explnum_data); if ($contenu_vignette) { header('Content-type: image/png'); }else { $contenu_vignette = file_get_contents("./images/mimetype/unknown.gif"); header('Content-type: image/gif'); } } elseif($ligne->explnum_repertoire != 0){ $rep = new upload_folder($ligne->explnum_repertoire); $filepath = $rep->repertoire_path.$ligne->explnum_path.$ligne->explnum_nomfichier; $filepath = str_replace("//","/",$filepath); $contenu_vignette = file_get_contents($filepath); if($ligne->explnum_mimetype == 'application/pdf'){ header('Content-type: application/pdf'); }else{ $contenu_vignette=reduire_image_middle($contenu_vignette); header('Content-type: image/png'); } } else{ $contenu_vignette = file_get_contents("./images/mimetype/unknown.gif"); header('Content-type: image/gif'); } print $contenu_vignette ; } ?>