Ejemplo n.º 1
0
 function search_keywords()
 {
     global $typdoc, $dbh, $charset;
     $search_keywords = new searcher_keywords(stripslashes($this->user_query));
     $notices = $search_keywords->get_result();
     $nb_result_keywords = $search_keywords->get_nb_results();
     $l_typdoc = implode(",", $search_keywords->get_typdocs());
     /*$search_terms = $aq->get_positive_terms($aq->tree);
     		//On enlève le dernier terme car il s'agit de la recherche booléenne complète
     		unset($search_terms[count($search_terms)-1]);*/
     if ($nb_result_keywords) {
         $form = "<form name=\"search_keywords\" action=\"./index.php?lvl=more_results\" method=\"post\">";
         if (function_exists("search_other_function_post_values")) {
             $form .= search_other_function_post_values();
         }
         $form .= "<input type=\"hidden\" name=\"mode\" value=\"keyword\">\n\t\t\t\t<input type=\"hidden\" name=\"search_type_asked\" value=\"simple_search\">\n\t\t\t\t<input type=\"hidden\" name=\"typdoc\" value=\"" . $typdoc . "\">\n\t\t\t  \t<input type=\"hidden\" name=\"count\" value=\"" . $nb_result_keywords . "\">\n\t\t\t  \t<input type=\"hidden\" name=\"user_query\" value=\"" . htmlentities(stripslashes($this->user_query), ENT_QUOTES, $charset) . "\">\n\t\t\t  \t<input type=\"hidden\" name=\"l_typdoc\" value=\"" . htmlentities($l_typdoc, ENT_QUOTES, $charset) . "\">\n\t\t\t  </form>";
         $_SESSION["level1"]["keywords"]["form"] = $form;
         $_SESSION["level1"]["keywords"]["count"] = $nb_result_keywords;
     }
     return $nb_result_keywords;
 }
Ejemplo n.º 2
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: keyword.inc.php,v 1.43 2013-10-30 15:00:54 dgoron Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
// premier niveau de recherche OPAC sur mot-clé
require_once $class_path . "/searcher.class.php";
if ($opac_search_other_function) {
    require_once $include_path . "/" . $opac_search_other_function;
}
$search_keywords = new searcher_keywords(stripslashes($user_query));
$notices = $search_keywords->get_result();
$nb_result_keywords = $search_keywords->get_nb_results();
$l_typdoc = implode(",", $search_keywords->get_typdocs());
$search_terms = $aq->get_positive_terms($aq->tree);
//On enlève le dernier terme car il s'agit de la recherche booléenne complète
unset($search_terms[count($search_terms) - 1]);
$form = "<form name=\"search_keywords\" action=\"./index.php?lvl=more_results\" method=\"post\">";
if (function_exists("search_other_function_post_values")) {
    $form .= search_other_function_post_values();
}
$form .= "<input type=\"hidden\" name=\"mode\" value=\"keyword\">\n\t<input type=\"hidden\" name=\"typdoc\" value=\"" . $typdoc . "\">\n  \t<input type=\"hidden\" name=\"count\" value=\"" . $nb_result_keywords . "\">\n  \t<input type=\"hidden\" name=\"user_query\" value=\"" . htmlentities(stripslashes($user_query), ENT_QUOTES, $charset) . "\">\n  \t<input type=\"hidden\" name=\"l_typdoc\" value=\"" . htmlentities($l_typdoc, ENT_QUOTES, $charset) . "\">\n  </form>";
if ($opac_allow_affiliate_search) {
    if ($auto_submit) {
        if ($nb_result_keywords) {
            print "<div style='search_result'>" . $form . "</div><script type=\"text/javascript\" >\n\t\t\t\tdocument.search_keywords.action = './index.php?lvl=more_results&tab=catalog';\n\t\t\t\tdocument.search_keywords.submit();\n\t\t\t</script>";
        }
Ejemplo n.º 3
0
 //changement de plan !
 switch ($mode) {
     case "tous":
         $searcher = new searcher_all_fields(stripslashes($user_query));
         $notices = $searcher->get_result();
         add_notices_to_cart($notices);
         break;
     case "title":
     case "titre":
         $searcher = new searcher_title(stripslashes($user_query));
         $notices = $searcher->get_result();
         add_notices_to_cart($notices);
         break;
     case "keyword":
         $searcher = new searcher_keywords(stripslashes($user_query));
         $notices = $searcher->get_result();
         add_notices_to_cart($notices);
         break;
     case "abstract":
         $searcher = new searcher_abstract(stripslashes($user_query));
         $notices = $searcher->get_result();
         add_notices_to_cart($notices);
         break;
     case "extended":
         $es = new search();
         $table = $es->make_search();
         $notices = '';
         $q = "select distinct notice_id from {$table} ";
         $res = mysql_query($q, $dbh);
         if (mysql_num_rows($res)) {
             while ($row = mysql_fetch_object($res)) {