From 32e040465f8c7c2bb18a17f26019aca3fb64c031 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sat, 23 Feb 2013 15:27:29 +0100 Subject: [PATCH] modified: 0.3/functions.php modified: 0.3/index.php modified: 0.3/xsaf3.php - fix valeurs VVB.ini pour microblog & shaarli - fix CSS - suppression code inutile de xsaf3.php --- 0.3/functions.php | 26 ++++++++++++++++++++++++-- 0.3/index.php | 11 +++++++---- 0.3/xsaf3.php | 19 +------------------ 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/0.3/functions.php b/0.3/functions.php index ad2bcb9..54001a5 100755 --- a/0.3/functions.php +++ b/0.3/functions.php @@ -71,9 +71,9 @@ SITE_TITLE="'. $sitename .'" SITE_DESCRIPTION="Site original : '. $sitename .'" SITE_URL="'. $siteurl .'" FEED_URL="'. $rssurl .'" -ARTICLES_PER_PAGE="5" +ARTICLES_PER_PAGE="'. getArticlesPerPage( $type ) .'" UPDATE_INTERVAL="'. getInterval( $type ) .'" -UPDATE_TIMEOUT="30"') ) +UPDATE_TIMEOUT="'. getTimeout( $type ) .'"') ) $error[] = "Impossible d'écrire le fichier vvb.ini"; fclose($fp); } @@ -83,6 +83,17 @@ UPDATE_TIMEOUT="30"') ) return $error; } +function getArticlesPerPage( $type ) { + switch( $type ) { + case 'microblog': + return 20; + case 'shaarli': + return 20; + default: + return 5; + } +} + function getInterval( $type ) { switch( $type ) { case 'microblog': @@ -94,6 +105,17 @@ function getInterval( $type ) { } } +function getTimeout( $type ) { + switch( $type ) { + case 'microblog': + return 30; + case 'shaarli': + return 30; + default: + return 30; + } +} + function updateType($siteurl) { if( strpos($siteurl, 'twitter.com') !== FALSE ) { return array('type' => 'microblog', 'name' => 'twitter'); diff --git a/0.3/index.php b/0.3/index.php index 5cb89ed..5d33fd5 100755 --- a/0.3/index.php +++ b/0.3/index.php @@ -1,4 +1,6 @@
-

Ajout par fichier OPML

+

Ajouter par fichier OPML

diff --git a/0.3/xsaf3.php b/0.3/xsaf3.php index 4fa9735..dcd9bbb 100755 --- a/0.3/xsaf3.php +++ b/0.3/xsaf3.php @@ -78,23 +78,6 @@ function xsafimport($xsafremote, $max_exec_time) { // Do not use DetectRedirect because it's slow and it has been used when the feed was added //$rssurl = DetectRedirect(escape($value['FEED_URL'])); $rssurl = escape($value['FEED_URL']); - - if($sitetype == 'shaarli') { - $articles_per_page = "20"; - $update_interval = "1800"; - $update_timeout = "30"; - } - else if( $sitetype == 'microblog' ) { - $articles_per_page = "20"; - $update_interval = "300"; - $update_timeout = "30"; - } - else { - $articles_per_page = "5"; - $update_interval = "3600"; - $update_timeout = "30"; - } - $foldername = urlToFolder($siteurl); } @@ -187,4 +170,4 @@ if(DEBUG) { echo "

XSAF import finished

"; } if( DEBUG ) echo ''; -?> \ No newline at end of file +?>