get_query_members("publishers","ed_name","index_publisher","ed_id");
$clause.= "where ".$members["where"];
if ($opac_search_other_function) $add_notice=search_other_function_clause();
if ($typdoc || $add_notice) $clause = ', notices '.$clause.' and (ed1_id=ed_id or ed2_id=ed_id) ';
if ($typdoc) $clause.=" and typdoc='".$typdoc."' ";
if ($add_notice) $clause.= ' and notice_id in ('.$add_notice.')';
$tri = 'order by pert desc, index_publisher';
$pert=$members["select"]." as pert";
$editeurs = mysql_query("SELECT COUNT(distinct ed_id) FROM publishers $clause", $dbh);
$nb_result_editeurs = mysql_result($editeurs, 0 , 0);
//Enregistrement des stats
if($pmb_logs_activate){
global $nb_results_tab;
$nb_results_tab['editeurs'] = $nb_result_editeurs;
}
//définition du formulaire
$form = "
\n";
$form .= "
";
if($opac_allow_affiliate_search){
$search_result_affiliate_all = str_replace("!!mode!!","publisher",$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['publishers'],$search_result_affiliate_all);
$search_result_affiliate_all = str_replace("!!nb_result!!",$nb_result_editeurs,$search_result_affiliate_all);
if($nb_result_editeurs){
$link = "".$msg['suite']." ";
}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_publishers",$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_editeurs ) {
// tout bon, y'a du résultat, on lance le pataquès d'affichage
$requete = "select ed_id,ed_name from publishers $clause $tri LIMIT $opac_search_results_first_level";
// ??? ER : $found = mysql_query($requete, $dbh);
print "";
print "
$msg[publishers] ".$nb_result_editeurs." $msg[results] ";
/* while($mesEditeurs = mysql_fetch_object($found)) {
print "
".$mesEditeurs->ed_name."\n";
} */
// si il y a d'autres résultats, je met le lien 'plus de résultats'
// Le lien validant le formulaire est inséré dans le code avant le formulaire, cela évite les blancs à l'écran
print "
$msg[suite] ";
print $form;
print "
";
}
}
if ($nb_result_editeurs) {
$_SESSION["level1"]["publisher"]["form"]=$form;
$_SESSION["level1"]["publisher"]["count"]=$nb_result_editeurs;
}