- Done. The media platform now tracks sources as either local uploads or remote URLs.

Changed:
[includes/db.php (line 
43)](/Users/tyemeclifford/Documents/GH/mediaplayer/includes/db.php:43) 
adds source_type and source_url, with an automatic migration for 
existing SQLite databases.
[admin/add.php (line 
260)](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/add.php:260) 
and [admin/edit.php (line 
383)](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/edit.php:383) 
now let each source be an upload or an external URL.
[index.php (line 
226)](/Users/tyemeclifford/Documents/GH/mediaplayer/index.php:226) and 
[embed.php (line 
193)](/Users/tyemeclifford/Documents/GH/mediaplayer/embed.php:193) 
resolve playback URLs based on where the source lives.
[catalogue.php (line 
79)](/Users/tyemeclifford/Documents/GH/mediaplayer/catalogue.php:79) now 
has public search for published videos only.
[README.md (line 
63)](/Users/tyemeclifford/Documents/GH/mediaplayer/README.md:63) 
documents local vs remote sources and public search.
This commit is contained in:
Ty Clifford
2026-06-24 11:58:29 -04:00
parent 7c33de810f
commit b24f0dc416
9 changed files with 392 additions and 98 deletions
+20 -4
View File
@@ -4,7 +4,8 @@ require_once __DIR__ . '/includes/layout.php';
$per_page = (int)setting('catalogue_per_page', '10');
$page = max(1, (int)($_GET['page'] ?? 1));
$paged = get_videos_paginated($page, $per_page);
$search = trim($_GET['q'] ?? '');
$paged = get_videos_paginated($page, $per_page, true, $search);
render_head('Videos — TyClifford.com', '
.cat-grid {
@@ -49,6 +50,9 @@ render_head('Videos — TyClifford.com', '
.page-header { display:flex; flex-direction:column; gap:.5rem; }
.page-header-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.public-search { display:flex; gap:.5rem; width:100%; max-width:460px; }
.public-search input { flex:1; min-width:0; }
@media(max-width:560px) { .public-search { max-width:none; } }
.cat-footer { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin-top:.5rem; }
.cat-count { font-family:"Share Tech Mono",monospace; font-size:.65rem; color:var(--text-3); letter-spacing:.06em; }
@@ -68,15 +72,27 @@ render_head('Videos — TyClifford.com', '
<p class="eyebrow eyebrow-purple" style="margin-bottom:.3rem">Library</p>
<h1 style="font-size:1.1rem;font-weight:700;color:var(--text);">Video Catalogue</h1>
</div>
<span class="cat-count"><?= $paged['total'] ?> video<?= $paged['total'] != 1 ? 's' : '' ?></span>
<span class="cat-count">
<?= $paged['total'] ?> <?= $search ? 'result' : 'video' ?><?= $paged['total'] != 1 ? 's' : '' ?>
</span>
</div>
<form class="public-search" method="get" action="catalogue.php" role="search">
<input class="form-input" type="search" name="q" value="<?= h($search) ?>" placeholder="Search public videos…">
<button class="btn btn-secondary btn-sm" type="submit">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
Search
</button>
<?php if ($search): ?>
<a href="catalogue.php" class="btn btn-secondary btn-sm">Clear</a>
<?php endif; ?>
</form>
</div>
<?php if (empty($paged['videos'])): ?>
<div class="card">
<div class="empty-state">
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>
<p>no videos in the catalogue yet</p>
<p><?= $search ? 'no public videos matched your search' : 'no videos in the catalogue yet' ?></p>
</div>
</div>
<?php else: ?>
@@ -117,7 +133,7 @@ render_head('Videos — TyClifford.com', '
<?php if ($paged['total_pages'] > 1): ?>
<div class="cat-footer">
<span class="cat-count">page <?= $paged['page'] ?> of <?= $paged['total_pages'] ?></span>
<?php render_pagination($page, $paged['total_pages'], 'catalogue.php?page=%d'); ?>
<?php render_pagination($paged['page'], $paged['total_pages'], 'catalogue.php?' . ($search ? 'q=' . urlencode($search) . '&' : '') . 'page=%d'); ?>
</div>
<?php endif; ?>
<?php endif; ?>