ne pas afficher les flux vide (fixes #10)
This commit is contained in:
parent
f93b2980b2
commit
fd260e096c
|
@ -847,16 +847,12 @@ class PagewidgetController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
// Trie des fluxs
|
||||
$fluxsordered = $fluxs->getIterator();
|
||||
$fluxsordered->uasort(function ($first, $second) {
|
||||
return (int) $first->getRowOrder() > (int) $second->getRowOrder() ? 1 : -1;
|
||||
});
|
||||
|
||||
|
||||
$feeds=array();
|
||||
$filesystem = new Filesystem();
|
||||
|
||||
foreach($fluxsordered as $flux) {
|
||||
foreach($fluxs as $keyflux => $flux) {
|
||||
// On regarde si le flux a été lu il y a peu
|
||||
$toregen=true;
|
||||
$url=$flux->getUrl();
|
||||
|
@ -887,6 +883,7 @@ class PagewidgetController extends Controller
|
|||
$toregen=false;
|
||||
$backup = unserialize(file_get_contents($filecache));
|
||||
$feeds=array_merge($feeds,$backup);
|
||||
if(empty($backup)) unset($fluxs[$keyflux]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -996,12 +993,22 @@ class PagewidgetController extends Controller
|
|||
$nbflux++;
|
||||
if($nbflux>=$flux->getMaxread()&&$flux->getMaxread()>0) break;
|
||||
}
|
||||
|
||||
|
||||
if($nbflux==0) unset($fluxs[$keyflux]);
|
||||
|
||||
// On sauvegarde le résultat en fichier on rechargera son contenu que s'il n'a pas été lu depuis 30mn
|
||||
$filesystem->dumpFile($filecache, serialize($backup));
|
||||
}
|
||||
}
|
||||
|
||||
// Trie des fluxs
|
||||
$fluxsordered = $fluxs->getIterator();
|
||||
$fluxsordered->uasort(function ($first, $second) {
|
||||
return (int) $first->getRowOrder() > (int) $second->getRowOrder() ? 1 : -1;
|
||||
});
|
||||
|
||||
// Trie des feeds
|
||||
$libelle=array();
|
||||
foreach ($feeds as $key => $valeur) {
|
||||
$libelle[$key] = $valeur["date"];
|
||||
|
|
Loading…
Reference in New Issue