id_rss_flux&suite=acces';\" ";
$flux_list .= "
";
$flux_list .= "
".htmlentities($flux->nom_rss_flux,ENT_QUOTES, $charset)."
| ";
$flux_list .= "
...
| ";
$flux_list .= "
";
$parity += 1;
}
mysql_free_result($res);
// constitution des liens
$nbepages = ceil($nbr_lignes/$nb_per_page);
$suivante = $page+1;
$precedente = $page-1;
// affichage du lien précédent si nécéssaire
if ($precedente > 0) $nav_bar .= "";
for($i = 1; $i <= $nbepages; $i++) {
if($i==$page) $nav_bar .= "page $i/$nbepages";
}
if ($suivante<=$nbepages) $nav_bar .= " ";
if ($flux_trouves>0) $dsi_list_tmpl = str_replace("", "(".$flux_trouves.")", $dsi_list_tmpl);
$dsi_list_tmpl = str_replace("!!cle!!", $form_cb, $dsi_list_tmpl);
$dsi_list_tmpl = str_replace("!!list!!", $flux_list, $dsi_list_tmpl);
$dsi_list_tmpl = str_replace("!!nav_bar!!", $nav_bar, $dsi_list_tmpl);
$dsi_list_tmpl = str_replace("!!message_trouve!!", $msg['dsi_flux_trouves'], $dsi_list_tmpl);
return $dsi_list_tmpl;
} else return $msg['dsi_no_flux_found'] ;
}
function dsi_list_flux_info($form_cb="", $id_rss_flux=0) {
global $dbh, $msg, $charset;
global $page, $nbr_lignes;
global $dsi_list_tmpl;
global $opac_url_base ;
// nombre de références par pages
$nb_per_page = 10;
if ($form_cb) {
$form_cb_save = $form_cb ;
$form_cb = str_replace("*", "%", $form_cb) ;
$clause = "WHERE nom_rss_flux like '$form_cb%' " ;
} else {
$form_cb_save = "*" ;
$clause = "WHERE 1 " ;
}
if(!$nbr_lignes) {
$requete = "SELECT COUNT(1) FROM rss_flux $clause ";
$res = mysql_query($requete, $dbh);
$nbr_lignes = @mysql_result($res, 0, 0);
}
if (!$page) $page=1;
$debut = ($page-1)*$nb_per_page;
if($nbr_lignes) {
// on lance la vraie requête
$requete = "SELECT id_rss_flux FROM rss_flux $clause ORDER BY nom_rss_flux, id_rss_flux LIMIT $debut,$nb_per_page ";
$res = mysql_query($requete, $dbh);
$flux_list .= "";
$flux_list .= "
".htmlentities($msg[dsi_flux_form_nom],ENT_QUOTES, $charset)." | ";
$flux_list .= "
".htmlentities($msg[dsi_flux_nb_paniers],ENT_QUOTES, $charset)."
| ";
$flux_list .= "
".htmlentities($msg[dsi_flux_nb_bannettes],ENT_QUOTES, $charset)."
| ";
$flux_list .= "
".htmlentities($msg[dsi_flux_format],ENT_QUOTES, $charset)."
| ";
$flux_list .= "
";
$parity = 0;
$flux_trouves = mysql_num_rows($res) ;
while(($flux=mysql_fetch_object($res))) {
$flux = new rss_flux($flux->id_rss_flux) ;
if ($parity % 2) $pair_impair = "even";
else $pair_impair = "odd";
$tr_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" ";
$flux_list .= "";
$td_javascript=" onmousedown=\"document.location='./dsi.php?categ=fluxrss&sub=&id_rss_flux=$flux->id_rss_flux";
$td_javascript.="&suite=acces";
$td_javascript.="&form_cb=".urlencode($form_cb_save);
$td_javascript.="';\" ";
$flux_list .= "
".htmlentities($flux->nom_rss_flux,ENT_QUOTES, $charset)."
| ";
$flux_list .= "$flux->nb_paniers | ";
$flux_list .= "$flux->nb_bannettes | ";
$flux_list .= "".$opac_url_base."rss.php?id=".$flux->id_rss_flux." | ";
$flux_list .= "
";
$parity += 1;
}
mysql_free_result($res);
// constitution des liens
$nbepages = ceil($nbr_lignes/$nb_per_page);
$suivante = $page+1;
$precedente = $page-1;
// affichage du lien précédent si nécéssaire
if ($precedente > 0) $nav_bar .= "";
for($i = 1; $i <= $nbepages; $i++) {
if($i==$page) $nav_bar .= "page $i/$nbepages";
}
if ($suivante<=$nbepages) $nav_bar .= " ";
if ($flux_trouves>0) $dsi_list_tmpl = str_replace("", "(".$flux_trouves.")", $dsi_list_tmpl);
$dsi_list_tmpl = str_replace("!!cle!!", $form_cb, $dsi_list_tmpl);
$dsi_list_tmpl = str_replace("!!list!!", $flux_list, $dsi_list_tmpl);
$dsi_list_tmpl = str_replace("!!nav_bar!!", $nav_bar, $dsi_list_tmpl);
$dsi_list_tmpl = str_replace("!!message_trouve!!", $msg['dsi_flux_trouves'], $dsi_list_tmpl);
return $dsi_list_tmpl;
} else return $msg['dsi_no_flux_found'] ;
}