MS-Tropical/public/projects/index.php

39 lines
1.1 KiB
PHP
Raw Permalink Normal View History

<?php
2024-06-29 11:42:36 -05:00
require '../app/bootstrap.php';
echo render('header');
$CommentForm = GetTemplate('comments/episodeform');
2024-06-29 11:42:36 -05:00
$showid = !empty($_GET['show']) ? $_GET['show'] : 1;
$epnum = !empty($_GET['episode']) ? $_GET['episode'] : 1;
$episode = new Show($showid);
$epdata = $episode->EpisodeArray[$epnum - 1];
2024-06-29 11:42:36 -05:00
$oneOrMore = $epdata['comments'] == 1 ? $epdata['comments'] . " Comment" : $epdata['comments'] . " Comments";
if ($epdata['comments'] == 0) {
$epComments = '<p style="padding: 4px 8px;">No comments? Be the first to comment on this video!</p>';
} else {
$epComments = $episode->GetEpisodeComments($_GET['episode']);
}
2024-06-29 11:42:36 -05:00
if(!empty($_COOKIE['MadSplashUser'])) {
$form = render('comments/episodeform', ['epid' => $_GET['episode'], 'id' => $_GET['show']]);
} else {
$form = '';
}
echo render('projects/show', [
't' => $epdata['title'],
'l' => $epdata['embed'],
'd' => $epdata['description'],
'thumb' => $episode->Thumbnail,
'comments' => $epComments,
'ccount' => $oneOrMore,
'form' => $form
2024-06-29 11:42:36 -05:00
]);
echo render('footer');