public function generate_rss($context, $hash) { global $opac_url_base, $dbh; $this->notices_list = array(); $mc = unserialize($context); $search = new search($mc["search_type"]); $search->unserialize_search(serialize($mc["serialized_search"])); $table = $search->make_search(); $q = "select distinct notice_id from {$table} "; $res = pmb_mysql_query($q, $dbh); if (pmb_mysql_num_rows($res)) { while ($row = pmb_mysql_fetch_object($res)) { $this->notices_list[] = $row->notice_id; } } $flux = new newrecords_flux(0); $flux->setRecords($this->notices_list); $flux->setLink($opac_url_base . "s.php?h={$hash}"); $flux->setDescription(strip_tags($mc["human_query"])); $flux->xmlfile(); if (!$flux->envoi) { return; } @header('Content-type: text/xml'); echo $flux->envoi; }
<?php // +-------------------------------------------------+ // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $Id: newrecords_rss.php,v 1.1 2015-04-16 12:31:00 ngantier Exp $ $base_path = "."; $include_path = $base_path . "/includes"; $class_path = $base_path . "/classes"; require_once $base_path . "/includes/includes_rss.inc.php"; require_once "{$class_path}/newrecords_flux.class.php"; $flux = new newrecords_flux(); $flux->xmlfile(); if (!$flux->envoi) { die; } @header('Content-type: text/xml'); echo $flux->envoi;