-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewsletter.php
26 lines (23 loc) · 1.12 KB
/
newsletter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
require "header.php";
?>
<p>Editions of the RCSA newsletter, 'The Brick', are to be found below in sizzling PDF format. Please note that the views expressed in the newsletters are only those of the newsletter editor, if anyone, and very probably do not represent the opinions or policy of the RCSA. If you wish submit an article to 'The Brick' then please email it to the current <a href="mailto:[email protected]">newsletter editor</a>. ....Please! Hope you enjoy reading through them.</p>
<div class="list-group">
<?php
$directory = new RecursiveDirectoryIterator('files/brick/');
$iterator = new RecursiveIteratorIterator($directory);
$regex = new RegexIterator($iterator, '/brick_[0-9]*\.pdf$/i', RecursiveRegexIterator::GET_MATCH);
$files_array = array();
foreach ($regex as $name => $object) {
array_push($files_array, $name);
}
rsort($files_array);
foreach ($files_array as $name) {
preg_match('/brick_([0-9]*)/', $name, $matches);
$date = strtotime($matches[1]);
$formatted = date('jS F Y', $date);
echo "<a href=\"$name\" class=\"list-group-item\">$formatted</a>";
}
?>
</div>
<?php require "footer.php"?>