Archived
4
2
This repository has been archived on 2024-09-28. You can view files and clone it, but cannot push or open issues or pull requests.
hpr_generator/templates/content-episode.tpl.html

148 lines
5.9 KiB
HTML
Raw Normal View History

2022-08-07 18:09:44 +00:00
<!--% PROCESS 'shared-episode-summary.tpl.html' %-->
<!--% PROCESS 'shared-avatar.tpl.html' %-->
<!--% PROCESS 'shared-utils.tpl.html' %-->
<!--% PROCESS 'shared-listen-now.tpl.html' %-->
2022-08-07 18:09:44 +00:00
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
<!--% query_episodes = DBI.prepare('
WITH episode_maxmin AS (
SELECT MAX(id) AS \'latest\', MIN(id) AS \'earliest\', ? AS \'id\'
FROM eps
WHERE eps.date < date (\'now\', \'+1 days\')
),
episode_date AS (
SELECT eps.date
FROM eps
WHERE eps.id = ?
),
episode_previous AS (
SELECT MAX(id) AS \'previous\', ? AS \'id\'
FROM eps
INNER JOIN episode_date
ON eps.date < episode_date.date
WHERE eps.id > 1
),
episode_next AS (
SELECT MIN(id) AS \'next\', ? AS \'id\'
FROM eps
INNER JOIN episode_date
ON eps.date > episode_date.date
WHERE eps.date < date (\'now\')
2022-09-02 03:05:59 +00:00
),
comment_tallies AS (
SELECT
eps_id,
COUNT(eps_id) AS eps_tally
FROM comments
GROUP BY eps_id
2022-08-07 18:09:44 +00:00
)
SELECT eps.id, eps.date, eps.title, eps.duration,
eps.summary, eps.notes, eps.explicit, eps.license,
eps.tags, eps.version, eps.downloads, eps.valid,
episode_maxmin.latest, episode_maxmin.earliest,
2022-08-07 22:41:58 +00:00
episode_previous.previous, episode_next.next,
hosts.hostid, hosts.host,
miniseries.name AS \'series\', miniseries.id AS \'seriesid\',
miniseries.description AS \'series_description\',
2022-09-02 03:05:59 +00:00
COALESCE (comment_tallies.eps_tally, 0) AS eps_tally
2022-08-07 18:09:44 +00:00
FROM eps
2022-08-07 22:41:58 +00:00
INNER JOIN hosts ON eps.hostid = hosts.hostid
INNER JOIN miniseries ON eps.series = miniseries.id
2022-08-07 18:09:44 +00:00
INNER JOIN episode_maxmin ON eps.id = episode_maxmin.id
INNER JOIN episode_previous ON eps.id = episode_previous.id
INNER JOIN episode_next ON eps.id = episode_next.id
2022-09-02 03:05:59 +00:00
LEFT JOIN comment_tallies ON eps.id = comment_tallies.eps_id
2022-08-07 18:09:44 +00:00
WHERE eps.id = ?
')
%-->
<!--% episode_result = query_episodes.execute(id, id, id, id, id) %-->
<!--% FOREACH episode IN episode_result %-->
2022-09-01 00:44:31 +00:00
<!--% episode_navigation = step_navigation(baseurl,episode) %-->
2022-08-07 18:09:44 +00:00
<article>
<header>
<h1>hpr<!--% episode.id %--> :: <!--% episode.title %--></h1>
<h3><!--% episode.summary %--></h3>
2022-09-01 00:44:31 +00:00
<p class="meta"><!--% episode_navigation %-->
2022-08-07 18:26:05 +00:00
</p>
2022-08-07 22:41:58 +00:00
<p><!--% IF get_avatar(episode.hostid) != 'hpr_logo.png' %-->
<img src="<!--% absolute_path(baseurl) %-->images/<!--% get_avatar(episode.hostid) %-->" height="80" width="80" alt="" /></a><br><!--% END %-->
2022-09-02 02:58:24 +00:00
Hosted by <a href="<!--% absolute_path(baseurl) %-->correspondents/<!--% zero_pad_left(episode.hostid) %-->.html"><!--% episode.host %--></a> on <span><!--% episode.date %--></span> is flagged as <span><!--% display_explicit(episode.explicit) %--></span> and is released under a <span><!--% episode.license %--> license</span>. <br>
<!--% display_tags(episode.tags) %--> <br>
2022-09-02 22:21:15 +00:00
<!--% display_listen_in(episode.id) %--> |
2022-09-02 03:05:59 +00:00
<!--% display_comments_tally(episode.id, episode.eps_tally) %-->
</p>
<h3><!--% show_series(episode.series, episode.seriesid, "Part of the series") %--></h3>
<p><em><!--% episode.series_description %--></em></p>
2022-08-07 18:09:44 +00:00
</header>
<div><!--% episode.notes %--></div>
<footer>
<!--% listen_now(episode, "hpr", baseurl, media_baseurl) %-->
<p>
<!--% episode_navigation %-->
</p>
</footer></article>
2022-08-07 18:09:44 +00:00
<!--% END %-->
2022-09-01 00:44:31 +00:00
<hr />
<h1>Comments</h1>
<p id="comments">
Subscribe to the comments <a href="https://www.hackerpublicradio.org/comments_rss.php">RSS</a> feed.
</p>
<!--% query_comments = DBI.prepare('
SELECT
2022-10-08 12:52:47 +00:00
id,
2022-09-01 00:44:31 +00:00
comment_timestamp,
comment_author_name,
comment_title,
comment_text
FROM comments
WHERE eps_id = ?
')
%-->
<!--% comment_index = 1 %-->
<!--% comments_result = query_comments.execute(id) %-->
<!--% FOREACH comment IN comments_result %-->
2022-10-08 12:52:47 +00:00
<h5 id="comment_<!--% comment.id %-->">Comment #<!--% comment_index %--> posted on <!--% comment.comment_timestamp %--> by <!--% comment.comment_author_name %--></h5>
2022-09-01 00:44:31 +00:00
<h4><!--% comment.comment_title %--></h4>
<!--% comment.comment_text %-->
<!--% comment_index = comment_index + 1 %-->
<!--% END %-->
<h2>Leave Comment</h2>
<p>
<strong>Note to Verbose Commenters</strong><br />
If you can't fit everything you want to say in the comment below then you really should <a href="/contribute.php">record</a> a response show instead.
</p>
<p>
<strong>Note to Spammers</strong><br />
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to <a href="/contribute.php">record</a> a show about yourself, or your industry, or any other topic we may find interesting. <em>We also check shows for spam :)</em>.
</p>
<form method="POST" action="comment_confirm.php">
<fieldset>
<legend>Provide feedback</legend>
<table>
<tr>
<td>Your Name/Handle:</td>
<td><input required type="text" name="comment_author_name" size="40" maxlength="40" placeholder="Enter your name" ></td>
</tr>
<tr>
<td>Title:</td>
<td><input required type="text" name="comment_title" size="50" maxlength="100" placeholder="What is your comment about ?"></td>
</tr>
<tr>
<td>Comment:</td>
<td><textarea required name="comment_text" maxlength="2000" rows="10" cols="50" placeholder="Place the comment here."></textarea></td>
</tr>
<tr>
<td>Anti Spam Question:</td>
<td>
What does the <strong>P</strong> in <em>HPR</em> stand for ? <br />
<input required type="text" name="anti_spam_question" size="50" maxlength="100" placeholder="Type out what the P in HPR stands for."></td>
</tr>
<input type="hidden" name="spammer" value="No">
<input type="hidden" name="hostid" value="406">
<input type="hidden" name="justification" value="No justification is asked for or required.">
<input type="hidden" name="eps_id" value="3665 ">
</table>
<input type="submit" value="Next">
</fieldset>
</form>