";
}
//le contenu du catalogue est calculé dans 2 cas :
// 1- la recherche affiliée n'est pas activée, c'est donc le seul résultat affichable
// 2- la recherche affiliée est active et on demande l'onglet catalog...
if(!$opac_allow_affiliate_search || ($opac_allow_affiliate_search && $tab == "catalog")){
print "
$count $msg[categs_found] '".htmlentities(stripslashes($user_query),ENT_QUOTES,$charset)."'";
if ($opac_search_other_function) {
require_once($include_path."/".$opac_search_other_function);
print pmb_bidi(" ".search_other_function_human_query($_SESSION["last_query"]));
}
print "";
print activation_surlignage();
print "
";
if(!$opac_allow_affiliate_search) print "
";
print "
";
$first_clause.= "catdef.libelle_categorie not like '~%' ";
$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');
$list_thes = array();
if ($id_thes == -1) {
//recherche dans tous les thesaurus
$list_thes = thesaurus::getThesaurusList();
} else {
//recherche dans le thesaurus transmis
$thes = new thesaurus($id_thes);
$list_thes[$id_thes]=$thes->libelle_thesaurus;
}
$q = "drop table if exists catjoin ";
$r = mysql_query($q, $dbh);
$q = "create temporary table catjoin ENGINE=MyISAM as select ";
foreach ($list_thes as $id_thesaurus=>$libelle_thesaurus) {
$thes = new thesaurus($id_thesaurus);
if(($lang==$thes->langue_defaut) || (in_array($lang, thesaurus::getTranslationsList())===false)){
$q.= "noeuds.num_thesaurus, ";
$q.= "noeuds.id_noeud as num_noeud, ";
$q.= "catdef.note_application as note_application, ";
$q.= "catdef.comment_public as comment_public, ";
$q.= "noeuds.num_renvoi_voir, ";
$q.= "catdef.libelle_categorie as libelle_categorie, ";
$q.= "catdef.index_categorie as index_categorie, ";
$q.= " ".$members_catdef['select']." as pert ";
$q.= "from noeuds ";
$q.= "join categories as catdef on noeuds.id_noeud = catdef.num_noeud and catdef.langue = '".$thes->langue_defaut."' ";
$q.= "where 1 ";
$q.= "and noeuds.num_thesaurus = '".$thes->id_thesaurus."' ";
$q.= "and ".$first_clause." ";
$q.= "and ".$members_catdef['where']." ";
}else{
$q.= "noeuds.num_thesaurus, ";
$q.= "noeuds.id_noeud as num_noeud, ";
$q.= "if (catlg.num_noeud is null, catdef.note_application, catlg.note_application) as note_application, ";
$q.= "if (catlg.num_noeud is null, catdef.comment_public, catlg.comment_public) as comment_public, ";
$q.= "noeuds.num_renvoi_voir, ";
$q.= "if (catlg.num_noeud is null, catdef.libelle_categorie, catlg.libelle_categorie) as libelle_categorie, ";
$q.= "if (catlg.num_noeud is null, catdef.index_categorie, catlg.index_categorie) as index_categorie, ";
$q.= "if (catlg.num_noeud is null, ".$members_catdef['select'].", ".$members_catlg['select'].") as pert ";
$q.= "from noeuds ";
$q.= "join categories as catdef on noeuds.id_noeud = catdef.num_noeud and catdef.langue = '".$thes->langue_defaut."' ";
$q.= "join categories as catlg on catdef.num_noeud = catlg.num_noeud and catlg.langue = '".$lang."' ";
$q.= "where 1 ";
$q.= "and noeuds.num_thesaurus = '".$thes->id_thesaurus."' ";
$q.= "and ".$first_clause." ";
$q.= "and ( if (catlg.num_noeud is null, ".$members_catdef['where'].", ".$members_catlg['where'].") ) ";
}
$r = mysql_query($q, $dbh);
$q = "INSERT INTO catjoin SELECT ";
}
$q = 'select distinct catjoin.num_noeud, catjoin.* from catjoin '.$clause.' ORDER BY pert desc, catjoin.index_categorie '.$limiter;
$found = mysql_query($q, $dbh);
while($mesCategories_trouvees = mysql_fetch_object($found)) {
print "- ";
if ($mesCategories_trouvees->num_renvoi_voir) {// Affichage des renvois_voir
if (categories::exists($mesCategories_trouvees->num_renvoi_voir, $lang)) $lg=$lang;
else {
$thes = thesaurus::getByEltId($mesCategories_trouvees->num_noeud);
$lg = $thes->langue_defaut;
}
$q = "select * from noeuds, categories where num_noeud='".$mesCategories_trouvees->num_renvoi_voir."' and langue = '".$lg."' and noeuds.id_noeud = categories.num_noeud limit 1";
$found_see = mysql_query ($q, $dbh);
$mesCategories = @mysql_fetch_object($found_see) ;
print pmb_bidi("".$mesCategories_trouvees->libelle_categorie." ".$msg['term_show_see']." ") ;
} else $mesCategories = $mesCategories_trouvees ;
// Affichage de l'arborescence des renvois voir
if ($mesCategories->num_parent) {
$bar = categories::listAncestors($mesCategories->num_noeud, $lang);
$bar = array_reverse($bar);
if ($bar[3]) print pmb_bidi("... > ");
if ($bar[2]) print pmb_bidi("".$bar[2]['libelle_categorie'].' > ');
if ($bar[1]) print pmb_bidi("".$bar[1]['libelle_categorie'].' > ');
}
print "num_noeud.">";
// Si il y a présence d'un commentaire affichage du layer
$result_com = categorie::zoom_categ($mesCategories_trouvees->num_noeud, $mesCategories_trouvees->note_application);
if(category::has_notices($mesCategories_trouvees->num_noeud))
print " ";
else
print "";
print pmb_bidi("num_noeud.$result_com['java_com']. ">".$mesCategories->libelle_categorie.''.$result_com['zoom']);
print "
";
}
print "
";
print "
";
if($opac_allow_affiliate_search) print $catal_navbar;
else print "";
}else{
if($tab == "affiliate"){
//l'onglet source affiliées est actif, il faut son contenu...
$as=new affiliate_search_category($user_query,"authorities");
//un peu crade, mais dans l'immédiat ca fait ce qu'on lui demande...
$as->filter = $author_type;
print $as->getResults();
}
print "