get_query_members("sub_collections","sub_coll_name","index_sub_coll","sub_coll_id");
$clause.= "where ".$members["where"];
if ($opac_search_other_function) $add_notice=search_other_function_clause();
if ($typdoc || $add_notice) $clause = ', notices '.$clause.' and subcoll_id=sub_coll_id ';
if ($typdoc) $clause.=" and typdoc='".$typdoc."' ";
if ($add_notice) $clause.= ' and notice_id in ('.$add_notice.')';
$tri = 'order by pert desc, index_sub_coll';
$pert=$members["select"]." as pert";
$subcollections = mysql_query("SELECT COUNT(sub_coll_id) FROM sub_collections $clause", $dbh);
$nb_result_subcollections = mysql_result($subcollections, 0 , 0);
//Enregistrement des stats
if($pmb_logs_activate){
global $nb_results_tab;
$nb_results_tab['subcollections'] = $nb_result_subcollections;
}
//définition du formulaire
$form = "
\n";
if($opac_allow_affiliate_search){
$search_result_affiliate_all = str_replace("!!mode!!","subcollection",$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['subcollections'],$search_result_affiliate_all);
$search_result_affiliate_all = str_replace("!!nb_result!!",$nb_result_subcollections,$search_result_affiliate_all);
if($nb_result_subcollections){
$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_sub_collection",$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_subcollections) {
// tout bon, y'a du résultat, on lance le pataquès d'affichage
$requete = "select sub_coll_id,sub_coll_name from sub_collections $clause $tri LIMIT $opac_search_results_first_level";
// ??? ER : $found = mysql_query($requete, $dbh);
print "
";
print "
$msg[subcollections] ".$nb_result_subcollections." $msg[results] ";
print "
$msg[suite] \n";
print $form;
print "
";
}
}
if ($nb_result_subcollections) {
$_SESSION["level1"]["subcollection"]["form"]=$form;
$_SESSION["level1"]["subcollection"]["count"]=$nb_result_subcollections;
}