From 6dcfdba0e0601d2a45f4098cd5f919018933ad54 Mon Sep 17 00:00:00 2001 From: Leblanc Simon Date: Fri, 21 Mar 2008 17:22:20 +0000 Subject: [PATCH] =?UTF-8?q?R=C3=A9ponse=20en=20partie=20=C3=A0=20la=20requ?= =?UTF-8?q?=C3=AAte=20#1886192.=20Une=20limitation=20du=20nombre=20de=20st?= =?UTF-8?q?rip=20affich=C3=A9=20dans=20le=20flux=20rss=20en=20appellant=20?= =?UTF-8?q?le=20RSS=20de=20cette=20mani=C3=A8re:=20http://site/rss.php=3Fl?= =?UTF-8?q?imit=3D10=20(on=20affiche=20alors=20les=2010=20derniers=20strip?= =?UTF-8?q?s)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rss.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rss.php b/rss.php index 7437443..444a8e0 100644 --- a/rss.php +++ b/rss.php @@ -52,8 +52,17 @@ class rss_manager $this->lang = $sm->lang; $sm->strips_list_get(); + + // limit the number of strip in RSS + $limit = 0; + if (isset($_GET['limit']) && is_numeric($_GET['limit'])) { + // check for have no infinite for + if ($_GET['limit'] > 0 && $_GET['limit'] < $sm->strips_count) { + $limit = $sm->strips_count - $_GET['limit']; + } + } - for( $i = $sm->strips_count-1; $i >= 0; $i-- ) { // reverser order + for( $i = $sm->strips_count-1; $i >= $limit; $i-- ) { // reverser order $sm->strip_info_get( $i ); // conversion iso8601 -> RFC822