libelle_thesaurus; $id_thes_for_link=$opac_thesaurus_defaut; } $aq=new analyse_query(stripslashes($user_query),0,0,1,0,$opac_stemming_active); $members_catdef = $aq->get_query_members('catdef','catdef.libelle_categorie','catdef.index_categorie','catdef.num_noeud'); $members_catlg = $aq->get_query_members('catlg','catlg.libelle_categorie','catlg.index_categorie','catlg.num_noeud'); foreach ($list_thes as $id_thesaurus=>$libelle_thesaurus) { $thes = new thesaurus($id_thesaurus); $q="INSERT INTO catjoin SELECT noeuds.num_thesaurus, noeuds.id_noeud FROM "; if(($lang==$thes->langue_defaut) || (in_array($lang, thesaurus::getTranslationsList())===false)){ $q.="noeuds JOIN categories as catdef on noeuds.id_noeud = catdef.num_noeud AND catdef.langue = '".$thes->langue_defaut."'"; //$q.=" WHERE noeuds.num_thesaurus='".$id_thesaurus."' AND not_use_in_indexation='0' AND catdef.libelle_categorie not like '~%' and ".$members_catdef["where"]; $q.=" WHERE noeuds.num_thesaurus='".$id_thesaurus."' AND catdef.libelle_categorie not like '~%' and ".$members_catdef["where"]; }else{ $q.="noeuds JOIN categories as catdef on noeuds.id_noeud = catdef.num_noeud AND catdef.langue='".$thes->langue_defaut."' JOIN categories as catlg on catdef.num_noeud=catlg.num_noeud and catlg.langue = '".$lang."'"; //$q.=" WHERE noeuds.num_thesaurus='".$id_thesaurus."' AND not_use_in_indexation='0' AND if(catlg.num_noeud is null, ".$members_catdef["where"].", ".$members_catlg["where"].") AND if(catlg.num_noeud is null,catdef.libelle_categorie not like '~%',catlg.libelle_categorie not like '~%')"; $q.=" WHERE noeuds.num_thesaurus='".$id_thesaurus."' AND if(catlg.num_noeud is null, ".$members_catdef["where"].", ".$members_catlg["where"].") AND if(catlg.num_noeud is null,catdef.libelle_categorie not like '~%',catlg.libelle_categorie not like '~%')"; } $r = mysql_query($q, $dbh); } $clause = ''; $add_notice = ''; if ($opac_search_other_function) $add_notice=search_other_function_clause(); if ($typdoc || $add_notice){ $clause.= ' JOIN notices_categories ON notices_categories.num_noeud=catjoin.num_noeud JOIN notices ON notices_categories.notcateg_notice=notices.notice_id WHERE 1 '; }else{ $clause.= ' WHERE 1 '; } if ($typdoc) $clause.=" and typdoc='".$typdoc."' "; if ($add_notice) $clause.= ' and notice_id in ('.$add_notice.')'; $q = 'select count(distinct catjoin.num_noeud) from catjoin '.$clause; $r=mysql_query($q); $nb_result_categories = mysql_result($r, 0 , 0); //Enregistrement des stats if($pmb_logs_activate){ global $nb_results_tab; $nb_results_tab['categories'] = $nb_result_categories; } $form = "
\n"; $form .= " \n"; if($opac_allow_affiliate_search){ $search_result_affiliate_all = str_replace("!!mode!!","category",$search_result_affiliate_lvl1); $search_result_affiliate_all = str_replace("!!search_type!!","authorities",$search_result_affiliate_all); $search_result_affiliate_all = str_replace("!!label!!",$msg['categories'],$search_result_affiliate_all); $search_result_affiliate_all = str_replace("!!nb_result!!",$nb_result_categories,$search_result_affiliate_all); if($nb_result_categories){ $link = "$msg[suite] "; if ($opac_thesaurus) { //mode multithesaurus dans l'opac $nb_thes=0; foreach ($list_thes as $id_thesaurus=>$libelle_thesaurus) { $q = 'select count(distinct catjoin.num_noeud) from catjoin '.$clause; $q.= " and catjoin.num_thesaurus = '".$id_thesaurus."' "; $clause_link=$clause." and catjoin.num_thesaurus = '".$id_thesaurus."' "; $r = mysql_query($q, $dbh); $nb = mysql_result($r, 0, 0); if ($nb) { $nb_thes++; if($nb_thes==1) $link .= ''; $link .= htmlentities($msg['thes_libelle'],ENT_QUOTES, $charset).' '.htmlentities($libelle_thesaurus,ENT_QUOTES, $charset).' '.$nb.' '.htmlentities($msg[results],ENT_QUOTES, $charset); $link .= "$msg[suite] "; $link .= ''; } }else $link = ""; $search_result_affiliate_all = str_replace("!!link!!",$link,$search_result_affiliate_all); $search_result_affiliate_all = str_replace("!!style!!","",$search_result_affiliate_all); $search_result_affiliate_all = str_replace("!!user_query!!",rawurlencode(stripslashes($user_query)),$search_result_affiliate_all); $search_result_affiliate_all = str_replace("!!form_name!!","search_categorie",$search_result_affiliate_all); $search_result_affiliate_all = str_replace("!!form!!",$form,$search_result_affiliate_all); print $search_result_affiliate_all; }else{ if($nb_result_categories) { // tout bon, y'a du résultat, on lance le pataquès d'affichage print "
'; } } if($nb_thes)$link .= '
'; print htmlentities($msg['thes_libelle'],ENT_QUOTES, $charset).' '.htmlentities($libelle_thesaurus,ENT_QUOTES, $charset).' '.$nb.' '.htmlentities($msg[results],ENT_QUOTES, $charset); print "$msg[suite] "; print ''; } // Le lien validant le formulaire est inséré dans le code avant le formulaire, cela évite les blancs à l'écran $form = "
'; } } if($nb_thes)print '