has_forbidden_fields()){ $allow_search_affiliate_and_external=false; } } if($opac_allow_affiliate_search && $allow_search_affiliate_and_external){ $sr_form.= $search_result_extended_affiliate_lvl2_head; } else { $sr_form.= "

".$msg['resultat_recherche']."

\n
"; } //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")){ //gestion du tri if (isset($_GET["sort"])) { $_SESSION["last_sortnotices"]=$_GET["sort"]; } if ($count>$opac_nb_max_tri) { $_SESSION["last_sortnotices"]=""; } if($facette_test==1){ global $search; global $name; global $value; global $champ; global $ss_champ; global $check_facette; //si rien en multi-sélection, il n'y a qu'une seule facette de cliquée //on l'ajoute au tableau pour avoir un traitement unique après if(!isset($check_facette) || !count($check_facette)){ $check_facette = array(); //on encode en utf-8 pour être compatible avec json_encode if ($charset!='utf-8') { $check_facette[] = json_encode(array(utf8_encode($name),utf8_encode($value),$champ,$ss_champ)); } else { $check_facette[] = json_encode(array($name,$value,$champ,$ss_champ)); } }else{ //le tableau est addslashé automatiquement foreach($check_facette as $k=>$v){ $check_facette[$k]=stripslashes($v); } } facettes::checked_facette_search($check_facette); $_SESSION["lq_facette"]=$_SESSION["facette"]; $_SESSION["lq_facette_search"]["lq_search"]=search::serialize_search(); } $lib_recherche=$es->make_human_query(); $searcher = new searcher_extended(); if($opac_visionneuse_allow){ $nbexplnum_to_photo = $searcher->get_nb_explnums(); } $count = $searcher->get_nb_results(); $l_typdoc= implode(",",$searcher->get_typdocs());// La variable global $l_typdoc est utilisée pour la photothèque //Enregistrement des stats if($pmb_logs_activate){ global $nb_results_tab; $nb_results_tab['extended'] = $count; } if($count){ if(isset($_SESSION["last_sortnotices"]) && $_SESSION["last_sortnotices"]!==""){ $notices = $searcher->get_sorted_result($_SESSION["last_sortnotices"],$debut,$opac_search_results_per_page); }else{ $notices = $searcher->get_sorted_result("default",$debut,$opac_search_results_per_page); } } $sr_form.= pmb_bidi("

$count $msg[titles_found] ".$lib_recherche."

"); // pour la DSI if ($opac_allow_bannette_priv && $allow_dsi_priv && ($_SESSION['abon_cree_bannette_priv']==1 || $opac_allow_bannette_priv==2)) { $sr_form.= " "; } if(!$opac_allow_affiliate_search || !$allow_search_affiliate_and_external) { $sr_form.= "
"; } $sr_form.= "
"; if ($count) { if ($opac_notices_depliable) { $sr_form.= $begin_result_liste; } //gestion du tri if ($count<=$opac_nb_max_tri) { $pos=strpos($_SERVER['REQUEST_URI'],"?"); $pos1=strpos($_SERVER['REQUEST_URI'],"get"); if ($pos1==0) $pos1=strlen($_SERVER['REQUEST_URI']); else $pos1=$pos1-3; $para=urlencode(substr($_SERVER['REQUEST_URI'],$pos+1,$pos1-$pos+1)); $para1=substr($_SERVER['REQUEST_URI'],$pos+1,$pos1-$pos+1); $affich_tris_result_liste=str_replace("!!page_en_cours!!",$para,$affich_tris_result_liste); $affich_tris_result_liste=str_replace("!!page_en_cours1!!",$para1,$affich_tris_result_liste); $sr_form.= $affich_tris_result_liste; if ($_SESSION["last_sortnotices"]!="") { $sort=new sort('notices','session'); $sr_form.= " ".$msg['tri_par']." ".$sort->descriptionTriParId($_SESSION["last_sortnotices"])." "; } elseif ($opac_default_sort_display) { $sort=new sort('notices','session'); $sr_form.= " ".$msg['tri_par']." ".$sort->descriptionTriParId("default")." "; } } else { $sr_form.= " "; } //fin gestion du tri $sr_form.= $add_cart_link; if($opac_visionneuse_allow && $nbexplnum_to_photo){ $search_to_post = $es->serialize_search(); $sr_form.= "   ".$link_to_visionneuse; $sr_form.= " "; } } //affinage //enregistrement de l'endroit actuel dans la session if ($_SESSION["last_query"]) { $n=$_SESSION["last_query"]; } else { $n=$_SESSION["nb_queries"]; } if(count($_SESSION['facette'])==0){ $_SESSION["notice_view".$n]["search_mod"]="extended"; $_SESSION["notice_view".$n]["search_page"]=$page; } //affichage $sr_form.= "  ".$msg["affiner_recherche"].""; //fin affinage //Etendre if ($opac_allow_external_search && $allow_search_affiliate_and_external) { $sr_form.= "  ".$msg["connecteurs_external_search_sources"].""; } //fin etendre if ($opac_show_suggest) { $bt_sugg = "   "; $sr_form.= $bt_sugg; } $sr_form.= "
"; $sr_form.= aff_notice(-1); $nb=0; $recherche_ajax_mode=0; for ($i =0 ; $i4)$recherche_ajax_mode=1; $sr_form.= pmb_bidi(aff_notice($notices[$i], 0, 1, 0, "", "", 0, 0, $recherche_ajax_mode)); } $sr_form.= aff_notice(-2); $sr_form.= "
"; // constitution des liens $nbepages = ceil($count/$opac_search_results_per_page); $sr_form.= "
 
"; if(!$opac_allow_affiliate_search){ $url_page = "javascript:document.form_values.page.value=!!page!!; document.form_values.submit()"; $action = "javascript:document.form_values.page.value=document.form.page.value; document.form_values.submit()"; }else{ $url_page = "javascript:document.form_values.page.value=!!page!!; document.form_values.catalog_page.value=document.form_values.page.value; document.form_values.action = \"./index.php?lvl=more_results&mode=extended&tab=catalog\"; document.form_values.submit()"; $action = "javascript:document.form_values.page.value=document.form.page.value; document.form_values.catalog_page.value=document.form_values.page.value; document.form_values.action = \"./index.php?lvl=more_results&mode=extended&tab=catalog\"; document.form_values.submit()"; } //Si pas de résultats, affichage des suggestions if(!$count && $opac_simple_search_suggestions){ $tableSuggest=""; if ($opac_autolevel2==2) { $actionSuggest = $base_path."/index.php?lvl=more_results&autolevel1=1"; } else { $actionSuggest = $base_path."/index.php?lvl=search_result&search_type_asked=simple_search"; } $termes = ""; //on va chercher le premier champ $s=explode("_",$search[0]); $field_="field_0_".$search[0]; global $$field_; $field=$$field_; $termes=str_replace('*','',stripslashes($_SESSION["user_query".$field[0]])); if (trim($termes)){ $suggestion = new suggest($termes); $tmpArray = array(); $tmpArray = $suggestion->listUniqueSimilars(); if(count($tmpArray)){ $tableSuggest.=""; foreach($tmpArray as $word){ $tableSuggest.=""; } $tableSuggest.="
".$word."
"; $sr_form.= "

".$msg['facette_suggest']."

".$tableSuggest; } } } if ($count) { $sr_form.=""; } if(!$opac_allow_affiliate_search || !$allow_search_affiliate_and_external) { $sr_form.= "
"; } $sr_form = str_replace('',$search_result_extended_affiliate_lvl2_head_wo_link,$sr_form); } else { if($tab == "affiliate"){ //l'onglet source affiliées est actif, il faut son contenu... $query = $es->serialize_search(); $as=new affiliate_search_extended($query); $as->getResults(); $sr_form.= $as->results; } $sr_form.= "
 
"; //Enregistrement des stats if($pmb_logs_activate){ global $nb_results_tab; $nb_results_tab['extended_affiliate'] = $as->getTotalNbResults(); } $es->unserialize_search($query); } print $sr_form;