summaryrefslogtreecommitdiff
path: root/banners.php
diff options
context:
space:
mode:
authorMichael Walker <mike@barrucadu.co.uk>2016-08-20 01:15:27 +0100
committerGitHub <noreply@github.com>2016-08-20 01:15:27 +0100
commit0678b74b7afed7eade5415d2b2cd4cd619c4bc89 (patch)
treec2a831e1fb0a132581d12a5a00477e29e6a4e5d2 /banners.php
parent42988fe8efd89071608e2239ad1868dfe12362a2 (diff)
parent5cf54dbce03632fd7fe76d39247edf4542e18475 (diff)
Merge pull request #58 from lainchan/57-priority-banners
Priority Banners (issue #57)
Diffstat (limited to 'banners.php')
-rw-r--r--banners.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/banners.php b/banners.php
index 262bdc57..48e312f2 100644
--- a/banners.php
+++ b/banners.php
@@ -4,14 +4,19 @@
</head>
<body>
<?php
-if ($handle = opendir('banners')) {
- while (false !== ($entry = readdir($handle))) {
- if ($entry != "." && $entry != "..") {
- echo "<a href=\"banners/$entry\"><img src=\"banners/$entry\" alt=\"$entry\" style=\"width:348px;height:128px\"></a> ";
+function listBannersInDir($dir) {
+ if ($handle = opendir($dir)) {
+ while (false !== ($entry = readdir($handle))) {
+ if ($entry != "." && $entry != "..") {
+ echo "<a href=\"$dir/$entry\"><img src=\"$dir/$entry\" alt=\"$entry\" style=\"width:348px;height:128px\"></a> ";
+ }
}
+ closedir($handle);
}
- closedir($handle);
}
+
+listBannersInDir("banners_priority");
+listBannersInDir("banners");
?>
</body>
</html>