public function setRecords($notices_list)
 {
     global $dbh;
     $this->notices_list = array();
     if (!count($notices_list)) {
         return array();
     }
     $req = "SELECT notice_id FROM  notices\tWHERE notice_is_new=1 and notice_id in (" . implode(",", $notices_list) . ") ORDER by notice_date_is_new";
     $res = pmb_mysql_query($req, $dbh);
     if (pmb_mysql_num_rows($res)) {
         while ($r = pmb_mysql_fetch_object($res)) {
             $this->notices_list[] = $r->notice_id;
         }
     }
     if (!count($this->notices_list)) {
         return array();
     }
     $filter = new filter_results($this->notices_list);
     $this->notices_list = $filter->get_array_results();
     return $this->notices_list;
 }
 protected function filter_notices($datas)
 {
     if (count($datas)) {
         $notices_ids = "";
         for ($i = 0; $i < count($datas); $i++) {
             if ($notices_ids) {
                 $notices_ids .= ",";
             }
             $notices_ids .= $datas[$i];
         }
         $filter = new filter_results($notices_ids);
         $notices_ids = $filter->get_results();
         //les données sont déjà filtrées...dont on s'assure que ca ne bouge pas !
         $tmpdatas = explode(",", $notices_ids);
         $finaldatas = array_intersect($datas, $tmpdatas);
     }
     return $finaldatas;
 }
Exemple #3
0
                    $tab_notices = array();
                    while ($row = pmb_mysql_fetch_object($r)) {
                        $tab_notices[] = $row->notice_id;
                    }
                    $notices = implode(',', $tab_notices);
                    $fr = new filter_results($notices);
                    $notices = $fr->get_results();
                }
                add_notices_to_cart($notices);
                break;
            case "concept_see":
                require_once $class_path . "/skos/skos_concept.class.php";
                $notices = '';
                $concept = new skos_concept($id);
                $notices = implode(",", $concept->get_indexed_notices());
                $fr = new filter_results($notices);
                $notices = $fr->get_results();
                add_notices_to_cart($notices);
                break;
        }
    } else {
        $message = "";
    }
}
if (!count($cart_)) {
    echo $msg["cart_empty"];
} else {
    echo $message . " <a href='#' onClick=\"parent.document.location='index.php?lvl=show_cart'; return false;\">" . sprintf($msg["cart_contents"], count($cart_)) . "</a>";
}
$_SESSION["cart"] = $cart_;
?>
 public function filter_notices($datas, $user = 0)
 {
     if (count($datas)) {
         $filtre = new filter_results(implode(',', $datas), $user);
         return explode(',', $filtre->get_results());
     } else {
         return array();
     }
 }
 protected function _filter_results()
 {
     $this->_get_objects_ids();
     if ($this->objects_ids != '') {
         $fr = new filter_results($this->objects_ids);
         $this->objects_ids = $fr->get_results();
     }
 }
 protected function filter_notices($datas)
 {
     if (count($datas)) {
         $notices_ids = "";
         for ($i = 0; $i < count($datas); $i++) {
             if ($notices_ids) {
                 $notices_ids .= ",";
             }
             $notices_ids .= $datas[$i];
         }
         $filter = new filter_results($notices_ids);
         $notices_ids = $filter->get_results();
         $datas = explode(",", $notices_ids);
     }
     return $datas;
 }