-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
74 lines (57 loc) · 1.76 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to JacksDamnServer.site</title>
</head>
<style>
/* Added styles for the latest blog post */
.blog-post {
border: 1px solid #ced4da;
padding: 15px;
margin-bottom: 20px;
border-radius: 4px;
background-color: #6c757d;
word-wrap: break-word; /* Added to handle long words in the post */
}
/* Adjusted margin for better spacing */
.mt-4 {
margin-top: 20px;
}
</style>
<body>
<?php
// Include the navbar
define('Navbar', TRUE);
include('navbar.php');
?>
<h1>WELCOME TO JACKSDAMNSERVER.SITE</h1>
<h2>FILLED WITH UNBLOCKED GAMES AND MORE</h2>
<div class="d-flex justify-content-center">
<p>Total Visitors: <?php echo $visitorCount; ?> <3</p>
</div>
<div class="d-flex justify-content-center">
<a href="games.php" class="btn btn-primary">Enter!</a>
</div>
<div class="container mt-4">
<h2 class="mb-3">Latest Update Post</h2>
<?php
// Function to get and display the latest blog post
function displayLatestBlogPost() {
// Read the content of the 'blog_posts.txt' file
$posts = file('blog_posts.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
// Get the last item in the array (latest post)
$latestPost = end($posts);
if (!empty($latestPost)) {
// Decode HTML entities in the latest post body
$latestPost = html_entity_decode($latestPost);
echo "<div class='blog-post'>$latestPost</div><br>";
}
}
// Display the latest blog post
displayLatestBlogPost();
?>
</div>
</body>
</html>