-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck-tiles.php
More file actions
32 lines (26 loc) · 783 Bytes
/
Copy pathcheck-tiles.php
File metadata and controls
32 lines (26 loc) · 783 Bytes
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
<?php
require_once __DIR__ . '/app/bootstrap.php';
$db = getDatabase();
echo "<h2>All Tiles:</h2>";
$stmt = $db->query("SELECT id, slug, title, visible, publish_at, created_at FROM tiles ORDER BY order_index");
$tiles = $stmt->fetchAll();
echo "<pre>";
print_r($tiles);
echo "</pre>";
echo "<h2>Visible Tiles (what public sees):</h2>";
$stmt = $db->query("
SELECT id, slug, title, visible, publish_at, created_at
FROM tiles
WHERE visible = 1
AND (publish_at IS NULL OR publish_at <= datetime('now'))
ORDER BY order_index
");
$visibleTiles = $stmt->fetchAll();
echo "<pre>";
print_r($visibleTiles);
echo "</pre>";
echo "<h2>Current datetime:</h2>";
$stmt = $db->query("SELECT datetime('now') as now");
echo "<pre>";
print_r($stmt->fetch());
echo "</pre>";