-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
93 lines (82 loc) · 2.24 KB
/
Copy pathindex.php
File metadata and controls
93 lines (82 loc) · 2.24 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AstralChan</title>
<style>
body { font-family: sans-serif; line-height: 1.6; padding: 20px; }
.board-list a { display: block; padding: 5px 0; }
</style>
</head>
<body>
<h1>Content Index</h1>
<p>Welcome to the index page. Below are the available boards:</p>
<div class="content-box">
<h2>Boards</h2>
<ul class="board-list">
<?php
$boardsDir = 'boards';
// Get all directories inside the 'boards' folder
$folders = glob($boardsDir . '/*' , GLOB_ONLYDIR);
foreach ($folders as $folder) {
$folderName = basename($folder);
$titleFile = $folder . '/title.txt';
$title = $folderName; // Default title
// Fetch title from title.txt if it exists
if (file_exists($titleFile)) {
$title = file_get_contents($titleFile);
}
echo "<li><a href='{$folder}/'>{$title}</a></li>";
}
?>
</ul>
</div>
<style>
body { font-family: sans-serif; line-height: 1.6; padding: 20px; }
.board-list {
width: 80%;
margin: 0 auto;
border: 1px solid #AAA;
background-color: #F0E0D6;
padding: 10px;
}
body {
background-color: #FFFFEE;
color: #800000;
font-family: arial,helvetica,sans-serif;
font-size: 10pt;
margin: 0;
padding: 0;
}
/* Content Element */
.content-box {
max-width: 800px;
margin: 0 auto;
background: #FFF;
border: 1px solid #CCC;
padding: 10px;
}
/* Board List - Top to Bottom */
.board-list {
list-style-type: none; /* Remove bullets [7] */
padding: 0;
margin: 0;
display: flex;
flex-direction: column; /* Stack vertically [2] */
}
.board-list li {
padding: 5px;
border-bottom: 1px solid #EEE;
}
.board-list a {
text-decoration: none;
color: #0000EE;
}
/* Hover Effect [7] */
.board-list a:hover {
color: #AF0A0F;
background-color: #EEEEEE;
}
</style>
</body>
</html>