-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
164 lines (149 loc) · 5.09 KB
/
index.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
include('header.php');
?>
<body>
<div id="content-wrapper">
<h1>School Journal Listening Post</h1>
<p class="version"> - version <?php echo $version; ?></p>
<ul class="categories">
<li>
<h3>Ready to Read</h3>
<p>Tracks for Ready to Read books from Magenta through to Gold (2000-2008)</p>
<img src="/sjlp/images/colourwheel.jpg" alt="Ready to Read" />
<ul class="child-categories">
<?php
$dir="SchoolJournal-ReadytoRead/";
$files = array_diff(scandir("audio/".$dir, 0), array('..', '.'));
foreach($files as $file) {
$title = preg_replace('/(?<!\ )[A-Z]/', ' $0', $file);
echo "<li>";
echo "<a href=\"directory.php?dir=" . $dir . $file . "/&cat=Ready to Read\">" . $title . "</a>";
echo "</li>";
}
?>
</ul>
</li>
<li>
<h3>Junior Journal</h3>
<p>Tracks for Junior Journals (Curriculum Level 2) 26-41 / 44-49</p>
<?php
//Get Random Cover Image from relevent folder.
// Get files from the directory
$imagesDir = "images/JuniorJournal/";
$images = glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];
?>
<img src="/sjlp/<?php echo $randomImage; ?>" width="150" height="200" alt="Junior Journals" />
<ul class="child-categories">
<?php
$dir="SchoolJournal-JuniorJournal/";
$files = array_diff(scandir("audio/".$dir, 0), array('..', '.'));
foreach($files as $file) {
$title = preg_replace('/(?<!\ )[A-Z]/', ' $0', $file);
echo "<li>";
echo "<a href=\"directory.php?dir=" . $dir . $file . "/&cat=Junior Journal\">" . $title . "</a>";
echo "</li>";
}
?>
</ul>
</li>
<li>
<h3>School Journal - Parts 1 & 2</h3>
<p>Tracks for Parts 1 and 2 (Curriculum Level 2) 2001-2009</p>
<?php
//Get Random Cover Image from relevent folder.
// Get files from the directory
$imagesDir = "images/SchoolJournal-Parts/";
$images = glob($imagesDir . '*Part1*.{jpg,jpeg,png,gif}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];
?>
<img src="/sjlp/<?php echo $randomImage; ?>" width="150" height="200" alt="School Journal Part 1 and 2" />
<ul class="child-categories">
<?php
$dir="SchoolJournal-Parts1-2/";
$files = array_diff(scandir("audio/".$dir, 0), array('..', '.'));
foreach($files as $file) {
$title = preg_replace('/(?<!\ )[A-Z]/', ' $0', $file);
echo "<li>";
echo "<a href=\"directory.php?dir=" . $dir . $file . "/&cat=School Journal\">" . $title . "</a>";
echo "</li>";
}
?>
</ul>
</li>
<li>
<h3>School Journal - Level 2</h3>
<p>Tracks for Level 2 Journals (Curriculum Level 2) from 2011 onwards</p>
<?php
//Get Random Cover Image from relevent folder.
// Get files from the directory
$imagesDir = "images/SchoolJournal-Level2/";
$images = glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];
?>
<img src="/sjlp/<?php echo $randomImage; ?>" width="150" height="200" alt="School Journal Level 2" />
<ul class="child-categories">
<?php
$dir="SchoolJournal-Level2/";
$files = array_diff(scandir("audio/".$dir, 0), array('..', '.'));
foreach($files as $file) {
$title = preg_replace('/(?<!\ )[A-Z]/', ' $0', $file);
echo "<li>";
echo "<a href=\"directory.php?dir=" . $dir . $file . "/&cat=School Journal Level 2\">" . $title . "</a>";
echo "</li>";
}
?>
</ul>
</li>
<li>
<h3>School Journal - Parts 3 & 4</h3>
<p>Tracks for Parts 3 and 4 (Curriculum Level 3) 2001-2009</p>
<?php
//Get Random Cover Image from relevent folder.
// Get files from the directory
$imagesDir = "images/SchoolJournal-Parts/";
$images = glob($imagesDir . '*Part3*.{jpg,jpeg,png,gif}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];
?>
<img src="/sjlp/<?php echo $randomImage; ?>" width="150" height="200" alt="School Journal Part 3 and 4" />
<ul class="child-categories">
<?php
$dir="SchoolJournal-Parts3-4/";
$files = array_diff(scandir("audio/".$dir, 0), array('..', '.'));
foreach($files as $file) {
$title = preg_replace('/(?<!\ )[A-Z]/', ' $0', $file);
echo "<li>";
echo "<a href=\"directory.php?dir=" . $dir . $file . "/&cat=School Journal\">" . $title . "</a>";
echo "</li>";
}
?>
</ul>
</li>
<li>
<h3>Story Library</h3>
<p>Stories suitable for upper primary</p>
<?php
//Get Random Cover Image from relevent folder.
// Get files from the directory
$imagesDir = "images/SchoolJournal-Story-Library/";
$images = glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];
?>
<img src="/sjlp/<?php echo $randomImage; ?>" width="150" height="200" alt="School Journal Story Library" />
<ul class="child-categories">
<?php
$dir="SchoolJournal-StoryLibrary/";
$files = array_diff(scandir("audio/".$dir, 0), array('..', '.'));
foreach($files as $file) {
$title = preg_replace('/(?<!\ )[A-Z]/', ' $0', $file);
echo "<li>";
echo "<a href=\"directory.php?dir=" . $dir . $file . "&cat=Story Library\">" . $title . "</a>";
echo "</li>";
}
?>
</ul>
</li>
</ul>
<?php
include('footer.php');
?>