diff options
author | monaco <mr.hedho@yahoo.com> | 2021-05-15 17:54:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-15 17:54:09 +0000 |
commit | 94c23185b1d0d95bb44cfd6f889f1a6ca166bb57 (patch) | |
tree | 2ba16243ab2163d4e5b806f547ef3a0120e0cb74 | |
parent | Update archive.php (diff) | |
download | KISSmo-94c23185b1d0d95bb44cfd6f889f1a6ca166bb57.tar.gz KISSmo-94c23185b1d0d95bb44cfd6f889f1a6ca166bb57.zip |
Update archive.php
-rw-r--r-- | archive.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/archive.php b/archive.php index 4b43a8b..54bd4a1 100644 --- a/archive.php +++ b/archive.php @@ -64,15 +64,35 @@ echo "</pre><br>"; <center><a href="./">Paste</a> | <a href="./archive.php">Archive</a></center> <?php +// Set the current working directory +$directory = getcwd()."/p/"; + +// Initialize filecount variavle +$filecount = 0; + +$files2 = glob( $directory ."*" ); + +if( $files2 ) { + $filecount = count($files2); +} + +echo "Currently archiving: "; +echo $filecount . " paste files "; + +echo "<br><br>"; + +?> + + <?php $options = array( - 'quantity' => 15, // how many item to display for each page - 'around' => 2, // how many page btn to show around the current page btn + 'quantity' => 30, // how many item to display for each page + 'around' => 7, // how many page btn to show around the current page btn 'directory' => './p', // dir to scan for items ); $page = isset($_GET['page']) ? $_GET['page'] : 1; $offset = ($page - 1) * $options['quantity']; // $page base index is 1 - $filelist = array_diff(scandir($options['directory']), array('..', '.','index.txt')); + $filelist = array_diff(scandir($options['directory']), array('..', '.')); //get subset of file array $selectedFiles = array_slice($filelist, $offset, $options['quantity']); |