-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathfooter.php
50 lines (42 loc) · 1.5 KB
/
footer.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
<?php
function array_key_relative ($array, $current_key, $offset = 1) {
$keys = array_keys($array);
$current_key_index = array_search($current_key, $keys);
if (isset($keys[$current_key_index + $offset])) {
return $keys[$current_key_index + $offset];
}
return false;
}
?>
<footer>
<section>
<?php
reset($pageNames); // move array pointer to beginning
if (basename($_SERVER["SCRIPT_NAME"]) != key($pageNames)) { ?>
<a href="<?php echo array_key_relative($pageNames, basename($_SERVER["SCRIPT_NAME"]), -1); ?>" id="previous">Previous</a>
<?php } ?>
Jump to:
<select id="jumper">
<?php
for ($index=0; $index < $slideCount; $index++) {
if (substr("$slidesArray[$index]", 0, 1) != "." && substr("$slidesArray[$index]", 0, 1) != "*") {
echo "<option value='$slidesArray[$index]'";
if ($slidesArray[$index] == $currentFile) {
echo ' selected="selected"';
}
echo '>' . $pageNames[$slidesArray[$index]] . '</option>';
}
}
?>
</select>
<?php
end($pageNames); // move array pointer to last
if (basename($_SERVER["SCRIPT_NAME"]) != key($pageNames)) { ?>
<a href="<?php echo array_key_relative($pageNames, basename($_SERVER["SCRIPT_NAME"]), 1); ?>" id="next">Next</a>
<?php } ?>
</section>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script src="../scripts/slide.js"></script>
</body>
</html>