diff --git a/functions.php b/functions.php index 26eb09b..b91015d 100755 --- a/functions.php +++ b/functions.php @@ -17,7 +17,9 @@ setlocale(LC_TIME, 'fr_FR.UTF-8', 'fr_FR', 'fr'); if( !defined('DOCS_CACHE_DURATION')) define( 'DOCS_CACHE_DURATION', 1800 ); +if( !defined('DOCS_CACHE_FILENAME')) define( 'DOCS_CACHE_FILENAME', 'cache_docs' ); if( !defined('AUTOBLOGS_CACHE_DURATION')) define( 'AUTOBLOGS_CACHE_DURATION', 1800 ); +if( !defined('AUTOBLOGS_CACHE_FILENAME')) define( 'AUTOBLOGS_CACHE_FILENAME', 'cache_autoblogs' ); if( !defined('ALLOW_FULL_UPDATE')) define( 'ALLOW_FULL_UPDATE', TRUE ); if( !defined('ALLOW_CHECK_UPDATE')) define( 'ALLOW_CHECK_UPDATE', TRUE ); @@ -136,6 +138,7 @@ function createAutoblog($type, $sitename, $siteurl, $rssurl) { throw new Exception('Impossible de créer le répertoire.'); updateXML('new_autoblog_added', 'new', $foldername, $sitename, $siteurl, $rssurl); + unlink(AUTOBLOGS_CACHE_FILENAME); } function getArticlesPerPage( $type ) { diff --git a/index.php b/index.php index 0f4a83f..49c928d 100644 --- a/index.php +++ b/index.php @@ -703,6 +703,18 @@ function check( $folder ) } } +/** + * RESET CACHE + **/ + if( !empty($_GET['reset_cache']) ) { + if( $_GET['reset_cache'] == 'docs' ) { + unlink(DOCS_CACHE_FILENAME); + } + if( $_GET['reset_cache'] == 'autoblogs' ) { + unlink(AUTOBLOGS_CACHE_FILENAME); + } + } + ?> @@ -886,7 +898,7 @@ function check( $folder ) +
'.count($autoblogs).' autoblogs hébergés
'; // on recuperre le contenu du buffer diff --git a/resources/autoblog.css b/resources/autoblog.css index 5c736db..c72538b 100644 --- a/resources/autoblog.css +++ b/resources/autoblog.css @@ -48,3 +48,10 @@ section#autoblogs > ul > li .source a:hover {color:darkred; text-decoration:none #logo { max-width: 250px; } input[type="text"]{width:15em;} } +.cache_link { + float:right; +} +.cache_link a { + font-weight:normal; + color: #CCC; +}