getRecords();
$this->title=$msg["newrecord_rss_flux_name"];
}
public function getRecords() {
global $dbh;
$this->notices_list=array();
$req = "SELECT notice_id FROM notices WHERE notice_is_new=1 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;
}
public function setRecords($notices_list) {
global $dbh;
$this->notices_list=array();
if(!count($notices_list)) return array();
$req = "SELECT notice_id FROM notices WHERE 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;
}
public function setTitle($title) {
$this->title=$title;
}
public function setDescription($description) {
$this->description=$description;
}
public function setCopyright($copyright) {
$this->copyright=$copyright;
}
public function setLanguage($language) {
$this->language=$language;
}
public function setManagingEditor($managingEditor) {
$this->managingEditor=$managingEditor;
}
public function setWebMaster($webMaster) {
$this->webMaster=$webMaster;
}
public function setLink($link) {
$this->link=$link;
}
public function setImageUrl($url) {
$this->imageUrl=$url;
}
public function setImageTitle($title) {
$this->imageTitle=$title;
}
public function setImageLink($link) {
$this->imageLink=$link;
}
// ---------------------------------------------------------------
// generation du fichier XML
// ---------------------------------------------------------------
public function xmlfile() {
global $pmb_bdd_version, $charset, $msg;
if (!$charset) $charset='ISO-8859-1';
$this->envoi="
".htmlspecialchars ($this->title,ENT_QUOTES, $charset)."
".htmlspecialchars ($this->link,ENT_QUOTES, $charset)."
".htmlspecialchars ($this->description,ENT_QUOTES, $charset)."
".htmlspecialchars ($this->language,ENT_QUOTES, $charset)."
".htmlspecialchars ($this->copyright,ENT_QUOTES, $charset)."
".addslashes(date("D, d M Y H:i:s O"))."
http://backend.userland.com/rss
PMB Version ".$pmb_bdd_version."
".htmlspecialchars ($this->managingEditor,ENT_QUOTES, $charset)."
".htmlspecialchars ($this->webMaster,ENT_QUOTES, $charset)."
".$this->ttl_rss_flux."";
if ($this->img_url_rss_flux) {
$this->envoi.="
".htmlspecialchars ($this->imageUrl,ENT_QUOTES, $charset)."
".htmlspecialchars ($this->imageTitle,ENT_QUOTES, $charset)."
".htmlspecialchars ($this->imageLink,ENT_QUOTES, $charset)."
" ;
}
$this->envoi.=$this->aff_notices_list($this->notices_list)."
";
if($charset=='utf-8') {
$this->envoi = preg_replace('/[\x00-\x08\x10\x0B\x0C\x0E-\x19\x7F]'.
'|[\x00-\x7F][\x80-\xBF]+'.
'|([\xC0\xC1]|[\xF0-\xFF])[\x80-\xBF]*'.
'|[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})'.
'|[\xE0-\xEF](([\x80-\xBF](?![\x80-\xBF]))|(?![\x80-\xBF]{2})|[\x80-\xBF]{3,})/S',
'', $this->envoi );
} else {
$this->envoi = preg_replace('/[\x00-\x08\x10\x0B\x0C\x0E-\x19\x7F]/S',
'', $this->envoi );
}
return $this->envoi;
}
private function aff_notices_list($notices_list){
global $dbh,$charset,$opac_url_base ;
global $opac_notice_affichage_class;
$retour_aff="";
foreach($notices_list as $notice_id){
$req = "select notice_id, notice_date_is_new from notices where notice_id=$notice_id";
$res = @pmb_mysql_query($req,$dbh);
if($r=pmb_mysql_fetch_object($res)){
if($opac_notice_affichage_class != ""){
$notice = new $opac_notice_affichage_class($r->notice_id, "", "", 1);
}else $notice = new notice_affichage($r->notice_id, "", "", 1);
$notice->visu_expl = 0 ;
$notice->visu_explnum = 0 ;
$notice->do_header_without_html();
$retour_aff .= "-
".htmlspecialchars ($notice->notice_header_without_html,ENT_QUOTES, $charset)."
".htmlspecialchars ($r->notice_date_is_new,ENT_QUOTES, $charset)."
".htmlspecialchars ($opac_url_base."index.php?lvl=notice_display&id=".$r->notice_id,ENT_QUOTES, $charset)."" ;
$notice->do_isbd(1,0);
$desc=$notice->notice_isbd;
$retour_aff .= " ".htmlspecialchars($desc,ENT_QUOTES, $charset)."";
$retour_aff .= "
" ;
}
}
return $retour_aff;
}
} # fin de definition