- Live homepage:
Added default Live settings in [includes/db.php](/Users/tyemeclifford/Documents/GH/mediaplayer/includes/db.php) using https://stream.place/embed/tyclifford.com. Added Admin → Settings → Live Section controls in [admin/settings.php](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/settings.php): enable/disable, live title, and embed URL/iframe input. Added a homepage Videos / Live toggle in [index.php](/Users/tyemeclifford/Documents/GH/mediaplayer/index.php). Videos remains the default view, so the homepage behaves normally until Live is selected. Imgur: Added Imgur URL normalization, embed support, oEmbed/thumbnail hooks, and external view count scraping support in [includes/db.php](/Users/tyemeclifford/Documents/GH/mediaplayer/includes/db.php). Supports imgur.com, albums/galleries, and direct i.imgur.com photos/GIFs/videos by routing them through Imgur embeds. Imgur external views now flow into external_view_count, so per-item and overall site totals include readable Imgur provider counts. Updated the add-video hint and README docs.
This commit is contained in:
@@ -17,6 +17,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$show_video_views = isset($_POST['public_show_video_views']) ? '1' : '0';
|
||||
$show_total_views = isset($_POST['public_show_total_views']) ? '1' : '0';
|
||||
$show_page_stats = isset($_POST['public_show_page_stats']) ? '1' : '0';
|
||||
$live_enabled = isset($_POST['live_enabled']) ? '1' : '0';
|
||||
$live_title = trim($_POST['live_title'] ?? 'Ty Clifford live stream');
|
||||
$live_embed = trim($_POST['live_embed'] ?? '');
|
||||
|
||||
set_setting('catalogue_per_page', (string)$per_page);
|
||||
set_setting('site_title', $site_title);
|
||||
@@ -25,6 +28,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
set_setting('public_show_video_views', $show_video_views);
|
||||
set_setting('public_show_total_views', $show_total_views);
|
||||
set_setting('public_show_page_stats', $show_page_stats);
|
||||
set_setting('live_enabled', $live_enabled);
|
||||
set_setting('live_title', $live_title);
|
||||
set_setting('live_embed', $live_embed);
|
||||
$msg = 'Settings saved.';
|
||||
}
|
||||
|
||||
@@ -53,6 +59,9 @@ $url_rewrite_mode = url_rewrite_mode();
|
||||
$public_show_video_views = setting_bool('public_show_video_views', true);
|
||||
$public_show_total_views = setting_bool('public_show_total_views', true);
|
||||
$public_show_page_stats = setting_bool('public_show_page_stats', true);
|
||||
$live_setting_enabled = setting_bool('live_enabled', true);
|
||||
$live_title = setting('live_title', 'Ty Clifford live stream');
|
||||
$live_embed = setting('live_embed', 'https://stream.place/embed/tyclifford.com');
|
||||
|
||||
// DB stats
|
||||
$db = get_db();
|
||||
@@ -220,6 +229,27 @@ render_head('Settings — Admin', '
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<p class="form-label" style="margin-bottom:.55rem;">Live Section</p>
|
||||
<div class="option-list" style="grid-template-columns:1fr;margin-bottom:1rem;">
|
||||
<label class="check-option">
|
||||
<input type="checkbox" name="live_enabled" value="1" <?= $live_setting_enabled ? 'checked' : '' ?>>
|
||||
<span>
|
||||
<strong>Show Live option</strong>
|
||||
Adds a Live button on the homepage that switches from the normal video player to the configured live embed.
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-grid" style="margin-bottom:1rem;">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="live_title">Live Title</label>
|
||||
<input class="form-input" type="text" id="live_title" name="live_title" value="<?= h($live_title) ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="live_embed">Live Embed URL or iframe</label>
|
||||
<textarea class="form-textarea" id="live_embed" name="live_embed" rows="4"><?= h($live_embed) ?></textarea>
|
||||
<span class="hint">Paste an iframe embed code or a direct embeddable URL. Default: https://stream.place/embed/tyclifford.com</span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-primary btn-sm" type="submit">
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"/><polyline points="17,21 17,13 7,13 7,21"/><polyline points="7,3 7,8 15,8"/></svg>
|
||||
Save Settings
|
||||
|
||||
Reference in New Issue
Block a user