diff --git a/index.php b/index.php
index 777938c..74f48bb 100644
--- a/index.php
+++ b/index.php
@@ -22,6 +22,17 @@
session_start();
+ if (!isset($_SESSION['index']) || isset($_GET['reindex']) || empty($_SESSION['index']))
+ {
+ echo '
performed reindexing
';
+ $files = glob($dir . '/*');
+ usort($files, function($a, $b)
+ {
+ return filemtime($b) - filemtime($a);
+ });
+ $_SESSION['index'] = $files;
+ }
+
function removefromindex($title)
{
global $dir;
@@ -173,16 +184,6 @@
echo '';
- 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)
{
$tags = '';