Initial Commit
This commit is contained in:
commit
1d85bf6663
7 changed files with 377 additions and 0 deletions
72
funnies-frame.php
Normal file
72
funnies-frame.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
$db = new SQLite3(__DIR__ . '/mentalnet_funnies.db');
|
||||
$res = $db->query('SELECT * FROM comics ORDER BY date_added DESC LIMIT 3'); // show latest 3 for compactness
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>MentalNet Funnies Frame</title>
|
||||
<style>
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #111;
|
||||
color: #eee;
|
||||
font-family: monospace;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
h1 {
|
||||
display: none; /* hide header for iframe context */
|
||||
}
|
||||
.comic {
|
||||
margin-bottom: 1rem;
|
||||
padding: 0.25rem 0.5rem;
|
||||
}
|
||||
h2 {
|
||||
font-size: 0.9rem;
|
||||
margin: 0.4rem 0;
|
||||
color: #0ff;
|
||||
text-align: center;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
img {
|
||||
width: 250px;
|
||||
border-radius: 4px;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 6px #000;
|
||||
}
|
||||
p {
|
||||
font-size: 0.8rem;
|
||||
margin: 0.25rem auto;
|
||||
text-align: center;
|
||||
color: #bbb;
|
||||
width: 95%;
|
||||
line-height: 1.3;
|
||||
}
|
||||
small {
|
||||
color: #666;
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
@media (max-width: 360px) {
|
||||
img { width: 98%; }
|
||||
h2 { font-size: 0.85rem; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<?php while($row=$res->fetchArray()): ?>
|
||||
<div class="comic">
|
||||
<h2><?= htmlspecialchars($row['title']) ?></h2>
|
||||
<img src="uploads/<?= htmlspecialchars($row['filename']) ?>" alt="<?= htmlspecialchars($row['title']) ?>">
|
||||
<?php if($row['description']): ?>
|
||||
<p><?= nl2br(htmlspecialchars($row['description'])) ?></p>
|
||||
<?php endif; ?>
|
||||
<p><small><?= htmlspecialchars(date('M j, Y', strtotime($row['date_added']))) ?></small></p>
|
||||
</div>
|
||||
<?php endwhile; ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue