Compare commits
21 Commits
I30-Series
...
3054d6519e
Author | SHA1 | Date | |
---|---|---|---|
3054d6519e
|
|||
c6e7a3c239
|
|||
dbf011395c
|
|||
c817e3a17a
|
|||
0edf9cc5a2
|
|||
|
4d34f762d0 | ||
dbd9f8e973
|
|||
|
4fdb32934b | ||
|
5bd96f69e0 | ||
38d2e7c363
|
|||
|
7691209360 | ||
f7216132a4
|
|||
67a8a2bfa4
|
|||
cfd463d2b0
|
|||
91cbc81a12
|
|||
|
c1a83f8baf | ||
3b72fe6d28
|
|||
76b976732b
|
|||
|
bf60d35ed1 | ||
e2cf52af6e
|
|||
414bae101a
|
@@ -125,6 +125,8 @@ sub main {
|
||||
# from the generated list of pages.
|
||||
@page_args= grep { $_ ne 'DBI' } @page_args;
|
||||
@page_args= grep { $_ ne 'root_template' } @page_args;
|
||||
@page_args= grep { $_ ne 'media_hostname' } @page_args;
|
||||
|
||||
};
|
||||
foreach my $page_arg (@page_args) {
|
||||
my %parsed_arg = parse_page_arg($page_arg);
|
||||
@@ -142,6 +144,10 @@ sub main {
|
||||
$page_config->{'baseurl'} = $config{root_template}{baseurl};
|
||||
}
|
||||
|
||||
if (exists $config{root_template}{media_hostname}) {
|
||||
$page_config->{'media_hostname'} = $config{root_template}{media_hostname};
|
||||
}
|
||||
|
||||
if ($page_config->{'multipage'} && $page_config->{'multipage'} eq 'true') {
|
||||
if (scalar @{$parsed_arg{'ids'}} == 1) {
|
||||
@{$parsed_arg{'ids'}} = get_ids_from_db($tt, \$page_config);
|
||||
|
6
site.cfg
6
site.cfg
@@ -132,6 +132,12 @@ content: content-promote.tpl.html
|
||||
navigation: navigation-about.tpl.html
|
||||
content: content-sitemap.tpl.html
|
||||
|
||||
[twat_episode]
|
||||
navigation: navigation-get-shows.tpl.html
|
||||
content: content-twat_episode.tpl.html
|
||||
multipage: true
|
||||
filename: eps/twat[id]/index.html
|
||||
|
||||
[hpr_ogg]
|
||||
root_template: rss.tpl.xml
|
||||
content: rss-hpr.tpl.xml
|
||||
|
@@ -2,12 +2,12 @@
|
||||
<!--% PROCESS 'shared-avatar.tpl.html' %-->
|
||||
<!--% PROCESS 'shared-utils.tpl.html' %-->
|
||||
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
|
||||
<!--% query_show_count = DBI.prepare('
|
||||
<!--% query_hpr_show_count = DBI.prepare('
|
||||
SELECT id
|
||||
FROM eps
|
||||
WHERE eps.hostid = ? ')
|
||||
%-->
|
||||
<!--% query_shows = DBI.prepare('
|
||||
<!--% query_hpr_shows = DBI.prepare('
|
||||
SELECT
|
||||
eps.id,
|
||||
CASE eps.explicit WHEN 1 THEN \'Explicit\' ELSE \'Clean\' END AS explicit ,
|
||||
@@ -24,12 +24,43 @@
|
||||
WHERE hosts.hostid = ? AND eps.date < date(\'now\', \'+1 days\')
|
||||
ORDER BY date DESC ')
|
||||
%-->
|
||||
<!--% shows_to_count = query_show_count.execute(id); %-->
|
||||
<!--% shows = query_shows.execute(id); %-->
|
||||
<!--% show_count = 0 %-->
|
||||
<!--% FOREACH show IN shows_to_count %-->
|
||||
<!--% show_count = show_count +1; %-->
|
||||
<!--% hpr_shows_to_count = query_hpr_show_count.execute(id); %-->
|
||||
<!--% hpr_shows = query_hpr_shows.execute(id); %-->
|
||||
<!--% hpr_show_count = 0 %-->
|
||||
<!--% FOREACH show IN hpr_shows_to_count %-->
|
||||
<!--% hpr_show_count = hpr_show_count +1; %-->
|
||||
<!--% END %-->
|
||||
|
||||
<!--% query_twat_show_count = DBI.prepare('
|
||||
SELECT id
|
||||
FROM twat_eps AS \'eps\'
|
||||
WHERE eps.hostid = ? ')
|
||||
%-->
|
||||
<!--% query_twat_shows = DBI.prepare('
|
||||
SELECT
|
||||
eps.id,
|
||||
CASE eps.explicit WHEN 1 THEN \'Explicit\' ELSE \'Clean\' END AS explicit ,
|
||||
eps.date, eps.license, eps.duration,
|
||||
eps.title, eps.summary, eps.tags,
|
||||
eps.notes,
|
||||
hosts.local_image,
|
||||
hosts.hostid,
|
||||
hosts.host, hosts.email,
|
||||
miniseries.name AS series, miniseries.id AS seriesid
|
||||
FROM twat_eps AS eps
|
||||
INNER JOIN hosts ON eps.hostid = hosts.hostid
|
||||
INNER JOIN miniseries ON eps.series = miniseries.id
|
||||
WHERE hosts.hostid = ?
|
||||
ORDER BY date DESC
|
||||
')
|
||||
%-->
|
||||
<!--% twat_shows_to_count = query_twat_show_count.execute(id); %-->
|
||||
<!--% twat_shows = query_twat_shows.execute(id); %-->
|
||||
<!--% twat_show_count = 0 %-->
|
||||
<!--% FOREACH show IN twat_shows_to_count %-->
|
||||
<!--% twat_show_count = twat_show_count +1; %-->
|
||||
<!--% END %-->
|
||||
|
||||
<!--% hosts = DBI.tie('hosts', 'hostid') %-->
|
||||
|
||||
<article>
|
||||
@@ -40,11 +71,15 @@
|
||||
height="80" alt="Host Image" /><br>
|
||||
<label>Host ID</label>: <!--% this_host.hostid %--><br><br>
|
||||
<label>email:</label> <u><!--% this_host.email %--></u><br>
|
||||
<label>episodes:</label> <strong><!--% show_count %--></strong>
|
||||
<label>episodes:</label> <strong><!--% hpr_show_count + twat_show_count %--></strong>
|
||||
</p>
|
||||
<!--% FOREACH show IN shows; %-->
|
||||
<!--% FOREACH hpr_show IN hpr_shows; %-->
|
||||
|
||||
<!--% show_summary(show, 'hide_host') %-->
|
||||
<!--% show_summary(hpr_show, 'hide_host') %-->
|
||||
<!--% END %-->
|
||||
<!--% FOREACH twat_show IN twat_shows; %-->
|
||||
|
||||
<!--% twat_show_summary(twat_show, 'hide_host') %-->
|
||||
<!--% END %-->
|
||||
</article>
|
||||
<p><a href="contribute.html">Become a Correspondent</a></p>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<!--% PROCESS 'shared-episode-summary.tpl.html' %-->
|
||||
<!--% PROCESS 'shared-avatar.tpl.html' %-->
|
||||
<!--% PROCESS 'shared-utils.tpl.html' %-->
|
||||
<!--% PROCESS 'shared-listen-now.tpl.html' %-->
|
||||
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
|
||||
<!--% query_episodes = DBI.prepare('
|
||||
WITH episode_maxmin AS (
|
||||
@@ -26,6 +27,13 @@
|
||||
INNER JOIN episode_date
|
||||
ON eps.date > episode_date.date
|
||||
WHERE eps.date < date (\'now\')
|
||||
),
|
||||
comment_tallies AS (
|
||||
SELECT
|
||||
eps_id,
|
||||
COUNT(eps_id) AS eps_tally
|
||||
FROM comments
|
||||
GROUP BY eps_id
|
||||
)
|
||||
SELECT eps.id, eps.date, eps.title, eps.duration,
|
||||
eps.summary, eps.notes, eps.explicit, eps.license,
|
||||
@@ -33,28 +41,106 @@
|
||||
episode_maxmin.latest, episode_maxmin.earliest,
|
||||
episode_previous.previous, episode_next.next,
|
||||
hosts.hostid, hosts.host,
|
||||
miniseries.name AS \'series\', miniseries.id AS \'seriesid\'
|
||||
miniseries.name AS \'series\', miniseries.id AS \'seriesid\',
|
||||
miniseries.description AS \'series_description\',
|
||||
COALESCE (comment_tallies.eps_tally, 0) AS eps_tally
|
||||
FROM eps
|
||||
INNER JOIN hosts ON eps.hostid = hosts.hostid
|
||||
INNER JOIN miniseries ON eps.series = miniseries.id
|
||||
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
|
||||
LEFT JOIN comment_tallies ON eps.id = comment_tallies.eps_id
|
||||
WHERE eps.id = ?
|
||||
')
|
||||
%-->
|
||||
<!--% episode_result = query_episodes.execute(id, id, id, id, id) %-->
|
||||
<!--% FOREACH episode IN episode_result %-->
|
||||
<!--% episode_navigation = step_navigation(baseurl,episode) %-->
|
||||
<article>
|
||||
<header>
|
||||
<h1>hpr<!--% episode.id %--> :: <!--% episode.title %--></h1>
|
||||
<h3><!--% episode.summary %--></h3>
|
||||
<p class="meta"><!--% step_navigation(baseurl,episode) %-->
|
||||
<p class="meta"><!--% episode_navigation %-->
|
||||
</p>
|
||||
<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 %-->
|
||||
Hosted by <a href="<!--% absolute_path(baseurl) %-->correspondents/<!--% zero_pad_left(episode.hostid) %-->.html"><!--% episode.host %--></a>. <!--% show_meta(episode) %--></p>
|
||||
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>
|
||||
<!--% display_listen_in(episode.id) %--> |
|
||||
<!--% 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>
|
||||
</header>
|
||||
<div><!--% episode.notes %--></div>
|
||||
</article>
|
||||
<footer>
|
||||
<!--% listen_now(episode, "hpr", baseurl, media_hostname) %-->
|
||||
<p>
|
||||
<!--% episode_navigation %-->
|
||||
</p>
|
||||
</footer></article>
|
||||
<!--% END %-->
|
||||
<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
|
||||
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 %-->
|
||||
<h5 id="1">Comment #<!--% comment_index %--> posted on <!--% comment.comment_timestamp %--> by <!--% comment.comment_author_name %--></h5>
|
||||
<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>
|
||||
|
@@ -25,4 +25,28 @@
|
||||
%-->
|
||||
<!--% show_summary(episodes) %-->
|
||||
<!--% END %-->
|
||||
<h2 id="twat_episodes">Today With a Techie Archived Shows</h2>
|
||||
<p>
|
||||
<!-- Creative Commons License -->
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png" width="88" height="31" /></a><br>The following work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/">Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License</a>.</p>
|
||||
<p>T.W.A.T. Radio was brought to you by <a href="https://en.wikipedia.org/wiki/Infonomicon">The Infonomicon Computer Club</a></p>
|
||||
<!--% FOREACH twat_episode IN DBI.query('
|
||||
SELECT
|
||||
eps.id,
|
||||
eps.explicit,
|
||||
eps.date, eps.license, eps.title, eps.summary,
|
||||
eps.duration, eps.notes, eps.tags,
|
||||
hosts.hostid,
|
||||
hosts.host, hosts.email, hosts.local_image,
|
||||
miniseries.name AS series, miniseries.id AS seriesid
|
||||
FROM twat_eps as eps
|
||||
INNER JOIN hosts ON eps.hostid = hosts.hostid
|
||||
INNER JOIN miniseries ON eps.series = miniseries.id
|
||||
ORDER BY date DESC
|
||||
')
|
||||
%-->
|
||||
<!--% twat_show_summary(twat_episode) %-->
|
||||
<!--% END %-->
|
||||
|
||||
</article>
|
||||
|
||||
|
@@ -1,13 +1,35 @@
|
||||
<!--% PROCESS 'shared-avatar.tpl.html' %-->
|
||||
<!--% PROCESS 'shared-utils.tpl.html' %-->
|
||||
<!--% PROCESS 'shared-listen-now.tpl.html' %-->
|
||||
<hr>
|
||||
<article>
|
||||
<header>
|
||||
<h3>Welcome to HPR the Community Podcast</h3>
|
||||
</header>
|
||||
<!--% days_till_next_episode = 0 %-->
|
||||
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
|
||||
<!--% FOREACH next_available_episode_result IN DBI.query('
|
||||
WITH next_id AS (SELECT id, id + 1 AS \'id_next\', date as \'last_date\'
|
||||
FROM eps
|
||||
WHERE eps.date > date(\'now\')
|
||||
)
|
||||
SELECT
|
||||
MIN (next_id.id_next) AS \'next_id\',
|
||||
strftime(\'%Y\', MIN (last_date)) AS \'last_year\',
|
||||
strftime(\'%d\', MIN (last_date)) AS \'last_day\',
|
||||
strftime(\'%m\', MIN (last_date)) AS \'last_month\'
|
||||
FROM next_id
|
||||
LEFT JOIN eps ON next_id.id_next = eps.id
|
||||
WHERE eps.id IS NULL
|
||||
')
|
||||
%-->
|
||||
<!--% USE date %-->
|
||||
<!--% calc = date.calc %-->
|
||||
<!--% days_till_next_episode = calc.Delta_Days(date.format(date.now, '%Y'),date.format(date.now, '%m'),date.format(date.now, '%d'),next_available_episode_result.last_year,next_available_episode_result.last_month,next_available_episode_result.last_day + 1) %-->
|
||||
<!--% END %-->
|
||||
<!--% USE date %-->
|
||||
<!--% delta = date.calc.N_Delta_YMD(2005,9,19, date.format(date.now, '%Y'),date.format(date.now, '%m'),date.format(date.now, '%d')) %-->
|
||||
<p>We started producing shows as <a href="https://www.hackerpublicradio.org/twat.php"><em>Today with a Techie</em></a> on 2005-09-19, <!--% delta.0 %--> years, <!--% delta.1 %--> months, <!--% delta.2 %--> days ago. our shows are produced by <a href="<!--% absolute_path(baseurl) %-->correspondents/index.html">listeners</a> like you and can be on any <a href="<!--% absolute_path(baseurl) %-->eps/index.html">topic</a> that <strong>"are of interest to <a href="https://en.wikipedia.org/wiki/hacker_(hobbyist)">hackers</a>"</strong>. if you listen to HPR then please consider contributing one show a year. if you <a href="<!--% absolute_path(baseurl) %-->contribute.html">record</a> your show now it could be <a href="https://www.hackerpublicradio.org/calendar.php">released</a> in <strong>13</strong> days.</p>
|
||||
<p>We started producing shows as <a href="<!--% absolute_path(baseurl) %-->eps/index.html#twat_episodes"><em>Today with a Techie</em></a> on 2005-09-19, <!--% delta.0 %--> years, <!--% delta.1 %--> months, <!--% delta.2 %--> days ago. our shows are produced by <a href="<!--% absolute_path(baseurl) %-->correspondents/index.html">listeners</a> like you and can be on any <a href="<!--% absolute_path(baseurl) %-->eps/index.html">topic</a> that <strong>"are of interest to <a href="https://en.wikipedia.org/wiki/hacker_(hobbyist)">hackers</a>"</strong>. if you listen to HPR then please consider contributing one show a year. if you <a href="<!--% absolute_path(baseurl) %-->contribute.html">record</a> your show now it could be <a href="https://www.hackerpublicradio.org/calendar.php">released</a> in <strong><!--% days_till_next_episode %--></strong> days.</p>
|
||||
<h4>Meet the team</h4>
|
||||
<p>
|
||||
<audio controls preload="none">";
|
||||
@@ -19,21 +41,29 @@
|
||||
<hr>
|
||||
<!--% PROCESS 'shared-episode-summary.tpl.html' %-->
|
||||
<h1>Latest Shows</h1>
|
||||
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
|
||||
<!--% FOREACH latest_episodes IN DBI.query('
|
||||
WITH comment_tallies AS (
|
||||
SELECT
|
||||
eps_id,
|
||||
COUNT(eps_id) AS eps_tally
|
||||
FROM comments
|
||||
GROUP BY eps_id
|
||||
)
|
||||
SELECT
|
||||
eps.id,
|
||||
eps.explicit,
|
||||
eps.date, eps.license, eps.duration,
|
||||
eps.title, eps.summary, eps.tags,
|
||||
eps.notes,
|
||||
hosts.local_image,
|
||||
hosts.hostid,
|
||||
hosts.host, hosts.email,
|
||||
miniseries.name AS series, miniseries.id AS seriesid
|
||||
eps.id,
|
||||
eps.explicit,
|
||||
eps.date, eps.license, eps.duration,
|
||||
eps.title, eps.summary, eps.tags,
|
||||
eps.notes,
|
||||
hosts.local_image,
|
||||
hosts.hostid,
|
||||
hosts.host, hosts.email,
|
||||
miniseries.name AS series, miniseries.id AS seriesid,
|
||||
COALESCE (comment_tallies.eps_tally, 0) AS eps_tally
|
||||
FROM eps
|
||||
INNER JOIN hosts ON eps.hostid = hosts.hostid
|
||||
INNER JOIN miniseries ON eps.series = miniseries.id
|
||||
INNER JOIN miniseries ON eps.series = miniseries.id
|
||||
LEFT JOIN comment_tallies ON eps.id = comment_tallies.eps_id
|
||||
WHERE eps.date < date(\'now\', \'+1 days\')
|
||||
ORDER BY date DESC
|
||||
LIMIT 10
|
||||
@@ -47,24 +77,14 @@
|
||||
<p class="meta"$><!--% IF get_avatar(latest_episodes.hostid) != 'hpr_logo.png' %-->
|
||||
<img src="<!--% absolute_path(baseurl) %-->images/<!--% get_avatar(latest_episodes.hostid) %-->" height="80" width="80" alt="" /></a><!--% END %-->
|
||||
<br>Hosted by <a href="<!--% absolute_path(baseurl) %-->correspondents/<!--% zero_pad_left(latest_episodes.hostid) %-->.html"><!--% latest_episodes.host %--></a> on <!--% latest_episodes.date %--> is flagged as <!--% display_explicit(latest_episodes.explicit) %--> and released under a <!--% latest_episodes.license %--> license. <br>
|
||||
<strong>Tags:</strong> <!--% latest_episodes.tags %--><em></em>.<br>
|
||||
<small>listen in <a href="local/hpr<!--% latest_episodes.id %-->.ogg">ogg</a>, <a href="local/hpr<!--% latest_episodes.id %-->.spx">spx</a>, or <a href="local/hpr<!--% latest_episodes.id %-->.mp3">mp3</a> format. <!--% show_series(latest_episodes.series, latest_episodes.seriesid) %-->
|
||||
<a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(latest_episodes.id) %-->/index.html#comments">View comments.</a></small>
|
||||
<!--% display_tags(latest_episodes.tags) %--><br>
|
||||
<small><!--% display_listen_in(latest_episodes.id) %--> <!--% show_series(latest_episodes.series, latest_episodes.seriesid) %--> |
|
||||
<!--% display_comments_tally(latest_episodes.id, latest_episodes.eps_tally) %--></small>
|
||||
</p>
|
||||
</header>
|
||||
<!--% latest_episodes.notes %-->
|
||||
<footer>
|
||||
<h2>listen now</h2>
|
||||
<p>Duration: <!--% latest_episodes.duration %--></p>
|
||||
<audio controls preload="none">
|
||||
<source src="local/hpr<!--% latest_episodes.id %-->.ogg" type="audio/ogg" >
|
||||
<source src="local/hpr<!--% latest_episodes.id %-->.mp3" type="audio/mpeg" >
|
||||
</audio>
|
||||
<ul>
|
||||
<li>ogg: <a href="local/hpr<!--% latest_episodes.id %-->.ogg">/local/hpr<!--% latest_episodes.id %-->.ogg</a></li>
|
||||
<li>spx: <a href="local/hpr<!--% latest_episodes.id %-->.spx">/local/hpr<!--% latest_episodes.id %-->.spx</a></li>
|
||||
<li>mp3: <a href="local/hpr<!--% latest_episodes.id %-->.mp3">/local/hpr<!--% latest_episodes.id %-->.mp3</a></li>
|
||||
</ul>
|
||||
<!--% listen_now(latest_episodes, "hpr", baseurl, media_hostname) %-->
|
||||
</footer>
|
||||
</article>
|
||||
<!--% END %-->
|
||||
|
74
templates/content-twat_episode.tpl.html
Normal file
74
templates/content-twat_episode.tpl.html
Normal file
@@ -0,0 +1,74 @@
|
||||
<!--% PROCESS 'shared-episode-summary.tpl.html' %-->
|
||||
<!--% PROCESS 'shared-avatar.tpl.html' %-->
|
||||
<!--% PROCESS 'shared-utils.tpl.html' %-->
|
||||
<!--% PROCESS 'shared-listen-now.tpl.html' %-->
|
||||
<!--% 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 twat_eps AS eps
|
||||
WHERE eps.date < date (\'now\', \'+1 days\')
|
||||
),
|
||||
episode_date AS (
|
||||
SELECT eps.date
|
||||
FROM twat_eps AS eps
|
||||
WHERE eps.id = ?
|
||||
),
|
||||
episode_previous AS (
|
||||
SELECT MAX(id) AS \'previous\', ? AS \'id\'
|
||||
FROM twat_eps AS 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 twat_eps AS eps
|
||||
INNER JOIN episode_date
|
||||
ON eps.date > episode_date.date
|
||||
WHERE eps.date < date (\'now\')
|
||||
)
|
||||
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,
|
||||
episode_previous.previous, episode_next.next,
|
||||
hosts.hostid, hosts.host,
|
||||
miniseries.name AS \'series\', miniseries.id AS \'seriesid\',
|
||||
miniseries.description AS \'series_description\'
|
||||
FROM twat_eps AS eps
|
||||
INNER JOIN hosts ON eps.hostid = hosts.hostid
|
||||
INNER JOIN miniseries ON eps.series = miniseries.id
|
||||
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
|
||||
WHERE eps.id = ?
|
||||
')
|
||||
%-->
|
||||
<!--% episode_result = query_episodes.execute(id, id, id, id, id) %-->
|
||||
<!--% FOREACH episode IN episode_result %-->
|
||||
<!--% episode_navigation = step_navigation(baseurl,episode,"twat") %-->
|
||||
<article>
|
||||
<header>
|
||||
<h1><!--% episode.id %--> :: <!--% episode.title %--></h1>
|
||||
<h3><!--% episode.summary %--></h3>
|
||||
<p class="meta"><!--% episode_navigation %-->
|
||||
</p>
|
||||
<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 %-->
|
||||
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>
|
||||
<!--% display_listen_in(episode.id) %-->
|
||||
</p>
|
||||
<h3><!--% show_series(episode.series, episode.seriesid, "Part of the series") %--></h3>
|
||||
<p><em><!--% episode.series_description %--></em></p>
|
||||
</header>
|
||||
<div><!--% episode.notes %--></div>
|
||||
<footer>
|
||||
<!--% listen_now(episode, "twat", baseurl, media_hostname) %-->
|
||||
<p>
|
||||
<!--% episode_navigation %-->
|
||||
</p>
|
||||
</footer></article>
|
||||
<!--% END %-->
|
||||
|
8
templates/ids-twat_episode.tpl.html
Normal file
8
templates/ids-twat_episode.tpl.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
|
||||
<!--% FOREACH episode IN DBI.query(
|
||||
'select eps.id from twat_eps AS \'eps\'
|
||||
where eps.date < date (\'now\', \'+1 days\') '
|
||||
) %-->
|
||||
,<!--% episode.id %-->
|
||||
<!--% END %-->
|
||||
|
@@ -10,6 +10,7 @@
|
||||
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
|
||||
<meta name="keywords" content="Technology, Tech News, Education, Training" />
|
||||
<meta name="description" content="Hacker Public Radio is an podcast that releases shows every weekday Monday through Friday. Our shows are produced by the community (you) and can be on any topic that are of interest to hackers and hobbyists." />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- Internal CSS -->
|
||||
<style type="text/css">
|
||||
article, aside, dialog, figure, footer, header, hgroup, menu, nav, section {
|
||||
|
@@ -1,12 +1,27 @@
|
||||
<!--% PROCESS 'shared-utils.tpl.html' %-->
|
||||
|
||||
<!--% MACRO show_series(series, series_id) IF series != "" %-->
|
||||
<label>Series:</label> <a href="<!--% absolute_path(baseurl) %-->series/<!--% zero_pad_left(series_id) %-->.html"><!--% series %--></a>.
|
||||
<!--% MACRO show_series(series, series_id, label) IF series != "" %-->
|
||||
<!--% IF label == "" %-->
|
||||
<!--% label = "Series" %-->
|
||||
<!--% END %-->
|
||||
<label><!--% label %-->:</label> <a href="<!--% absolute_path(baseurl) %-->series/<!--% zero_pad_left(series_id) %-->.html"><!--% series %--></a>.
|
||||
<!--% END %-->
|
||||
|
||||
<!--% MACRO show_meta(show) BLOCK %-->
|
||||
<span><label>Released:</label> <!--% show.date %-->.</span> <span><label>Duration:</label> <!--% show.duration %-->.</span> <span><label>Flag:</label> <!--% display_explicit(show.explicit) %-->.</span> <span><!--% show_series(show.series, show.seriesid) %--></span> <br>
|
||||
<span><label>Tags:</label> <em><!--% show.tags %--></em>.</span>
|
||||
<!--% MACRO display_tags(tags) BLOCK %-->
|
||||
<span><label>Tags:</label> <em><!--% tags %--></em>.</span>
|
||||
<!--% END %-->
|
||||
|
||||
<!--% MACRO display_listen_in(eps_id) BLOCK %-->
|
||||
Listen in <a href="<!--% media_baseurl(baseurl, media_hostname) %-->local/hpr<!--% eps_id %-->.ogg">ogg</a>, <a href="<!--% media_baseurl(baseurl, media_hostname) %-->local/hpr<!--% eps_id %-->.spx">spx</a>, or <a href="<!--% media_baseurl(baseurl, media_hostname) %-->local/hpr<!--% eps_id %-->.mp3">mp3</a> format.
|
||||
<!--% END %-->
|
||||
|
||||
<!--% MACRO display_comments_tally(eps_id, tally) BLOCK %-->
|
||||
<a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(eps_id) %-->/index.html#comments">Comments (<!--% tally %-->)</a>.
|
||||
<!--% END %-->
|
||||
|
||||
<!--% MACRO show_meta(show, hide_tags) BLOCK %-->
|
||||
<span><label>Released:</label> <!--% show.date %-->.</span> <span><label>Duration:</label> <!--% display_episode_duration(show.duration) %-->.</span> <span><label>Flag:</label> <!--% display_explicit(show.explicit) %-->.</span> <span><!--% show_series(show.series, show.seriesid) %--></span> <br>
|
||||
<!--% IF hide_tags == "" %--><!--% display_tags(tags) %--><!--% END %-->
|
||||
<!--% END %-->
|
||||
|
||||
<!--% MACRO show_summary(show, hide_host) BLOCK %-->
|
||||
@@ -19,3 +34,15 @@
|
||||
<!--% show.summary %-->
|
||||
</p>
|
||||
<!--% END %-->
|
||||
|
||||
<!--% MACRO twat_show_summary(show, hide_host) BLOCK %-->
|
||||
|
||||
<h3 class="title"><a href="<!--% absolute_path(baseurl) %-->eps/twat<!--% zero_pad_left(show.id) %-->/index.html">twat<!--% show.id %--> :: <!--% show.title %--></a> <!--% IF hide_host == "" %-->
|
||||
hosted by <a href="<!--% absolute_path(baseurl) %-->correspondents/<!--% zero_pad_left(show.hostid) %-->.html"><!--% show.host %--></a>
|
||||
<!--% END %-->
|
||||
</h3>
|
||||
<p class="meta"><!--% show_meta(show) %--><br>
|
||||
<!--% show.summary %-->
|
||||
</p>
|
||||
<!--% END %-->
|
||||
|
||||
|
19
templates/shared-listen-now.tpl.html
Normal file
19
templates/shared-listen-now.tpl.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!--% MACRO listen_now(episode, episode_type, baseurl, media_hostname) BLOCK %-->
|
||||
<!--% IF episode_type == "twat" %-->
|
||||
<!--% media_folder = "eps" %--><!--% ELSE %--><!--% media_folder = "local" %-->
|
||||
<!--% END %-->
|
||||
<h2>Listen Now</h2>
|
||||
<p>Duration: <!--% display_episode_duration(episode.duration) %--></p>
|
||||
<audio controls preload="none">
|
||||
<source src="<!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.ogg" type="audio/ogg" >
|
||||
<source src="<!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.mp3" type="audio/mpeg" >
|
||||
</audio>
|
||||
<ul>
|
||||
<!--% IF episode_type != "twat" %-->
|
||||
<li>ogg: <a href="<!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.ogg"><!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.ogg</a></li>
|
||||
<li>spx: <a href="<!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.spx"><!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.spx</a></li>
|
||||
<!--% END %-->
|
||||
<li>mp3: <a href="<!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.mp3"><!--% media_baseurl(baseurl, media_hostname) %--><!--% media_folder %-->/<!--% episode_type %--><!--% episode.id %-->.mp3</a></li>
|
||||
</ul>
|
||||
<!--% END %-->
|
||||
|
@@ -8,6 +8,20 @@
|
||||
<!--% ELSE %--><!--% display_when_false %--><!--% END %-->
|
||||
<!--% END %-->
|
||||
|
||||
<!--% MACRO display_episode_duration(duration_sec) BLOCK %-->
|
||||
<!--% seconds = duration_sec % 60 %-->
|
||||
<!--% USE format %-->
|
||||
<!--% minutes_only = format("%d") %-->
|
||||
<!--% minutes = minutes_only(duration_sec / 60) %-->
|
||||
<!--% hours_only = format("%d") %-->
|
||||
<!--% hours = hours_only(minutes / 60) %-->
|
||||
<!--% IF hours >= 1 %-->
|
||||
<!--% minutes = minutes - hours * 60 %-->
|
||||
<!--% END %-->
|
||||
<!--% display_hours = format("%02d:%02d:%02d") %-->
|
||||
<!--% display_hours(hours,minutes,seconds) %-->
|
||||
<!--% END %-->
|
||||
|
||||
<!--% MACRO display_explicit(is_explicit) BLOCK %-->
|
||||
<!--% display_choice(is_explicit, 'Explicit', 'Clean') %-->
|
||||
<!--% END %-->
|
||||
@@ -25,17 +39,26 @@
|
||||
<!--% IF baseurl %-->./<!--% ELSE %-->/<!--% END %-->
|
||||
<!--% END %-->
|
||||
|
||||
<!--% MACRO step_navigation(baseurl, links) BLOCK %-->
|
||||
<small><a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(links.earliest) %-->/index.html" rel="first"><< First</a>,
|
||||
<!--% MACRO media_baseurl(baseurl, media_hostname) BLOCK %-->
|
||||
<!--% IF media_hostname %-->
|
||||
https://<!--% media_hostname %-->/<!--% ELSE %-->
|
||||
<!--% baseurl %--><!--% END %-->
|
||||
<!--% END %-->
|
||||
|
||||
<!--% MACRO step_navigation(baseurl, links, folder) BLOCK %-->
|
||||
<!--% IF folder == "" %-->
|
||||
<!--% folder = hpr %-->
|
||||
<!--% END %-->
|
||||
<small><a href="<!--% absolute_path(baseurl) %-->eps/<!--% folder %--><!--% zero_pad_left(links.earliest) %-->/index.html" rel="first"><< First</a>,
|
||||
<!--% IF links.previous %-->
|
||||
<a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(links.previous) %-->/index.html" rel="previous">< Previous</a>,
|
||||
<a href="<!--% absolute_path(baseurl) %-->eps/<!--% folder %--><!--% zero_pad_left(links.previous) %-->/index.html" rel="previous">< Previous</a>,
|
||||
<!--% ELSE %-->
|
||||
<span><</span> Previous,
|
||||
<!--% END %-->
|
||||
<!--% IF links.next %-->
|
||||
<a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(links.next) %-->/index.html" rel="next">Next ></a>,
|
||||
<a href="<!--% absolute_path(baseurl) %-->eps/<!--% folder %--><!--% zero_pad_left(links.next) %-->/index.html" rel="next">Next ></a>,
|
||||
<!--% ELSE %-->
|
||||
Next <span>></span>
|
||||
<!--% END %-->
|
||||
<a href="<!--% absolute_path(baseurl) %-->eps/hpr<!--% zero_pad_left(links.latest) %-->/index.html" rel="last">Latest >></a></small>
|
||||
<a href="<!--% absolute_path(baseurl) %-->eps/<!--% folder %--><!--% zero_pad_left(links.latest) %-->/index.html" rel="last">Latest >></a></small>
|
||||
<!--% END %-->
|
||||
|
Reference in New Issue
Block a user