From 96813748b40718924d3e22581db3b3ece9de7218 Mon Sep 17 00:00:00 2001 From: erics Date: Tue, 22 Jul 2003 16:48:53 +0000 Subject: [PATCH] pour les rss externes dans des boiboites c'est mieux que dans le menu --- htdocs/includes/boxes/box_external_rss.php | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 htdocs/includes/boxes/box_external_rss.php diff --git a/htdocs/includes/boxes/box_external_rss.php b/htdocs/includes/boxes/box_external_rss.php new file mode 100644 index 00000000000..78dcf63f707 --- /dev/null +++ b/htdocs/includes/boxes/box_external_rss.php @@ -0,0 +1,45 @@ + + * Copyright (C) 2003 Éric Seigne + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ + +require_once("includes/magpierss/rss_fetch.inc"); + +//rq erics: +// A changer si on a plus d'un site syndiqué ? je n'ai pas encore tout +// compris aux boxes, sorry ! +for($site = 0; $site < 1; $site++) { + $info_box_head = array(); + $info_box_head[] = array('text' => "Les 5 dernières infos du site " . @constant("EXTERNAL_RSS_TITLE_". $site)); + $info_box_contents = array(); + $rss = fetch_rss( @constant("EXTERNAL_RSS_URLRSS_" . $site) ); + for($i = 0; $i < 5 ; $i++){ + $item = $rss->items[$i]; + $href = $item['link']; + $title = $item['title']; + $info_box_contents["$href"]="$title"; + $info_box_contents[$i][0] = array('align' => 'left', + 'text' => $title, + 'url' => $href); + } + new infoBox($info_box_head, $info_box_contents); +} +?>