fix session lost

This commit is contained in:
quenousimporte 2024-03-18 17:22:22 +01:00
parent 020545feb3
commit 0fe64adb7f
1 changed files with 11 additions and 10 deletions

View File

@ -22,6 +22,17 @@
session_start(); session_start();
if (!isset($_SESSION['index']) || isset($_GET['reindex']) || empty($_SESSION['index']))
{
echo '<div class="grey">performed reindexing</div>';
$files = glob($dir . '/*');
usort($files, function($a, $b)
{
return filemtime($b) - filemtime($a);
});
$_SESSION['index'] = $files;
}
function removefromindex($title) function removefromindex($title)
{ {
global $dir; global $dir;
@ -173,16 +184,6 @@
echo '<div>'; echo '<div>';
if (!isset($_SESSION['index']) || isset($_GET['reindex']) || empty($_SESSION['index']))
{
$files = glob($dir . '/*');
usort($files, function($a, $b)
{
return filemtime($b) - filemtime($a);
});
$_SESSION['index'] = $files;
}
foreach($_SESSION['index'] as $path) foreach($_SESSION['index'] as $path)
{ {
$tags = ''; $tags = '';