Integrate twat episodes

Add twat shows to the full episodes index, the host pages.
Add individule twat episodes.
This commit is contained in:
2022-09-17 17:28:39 -04:00
parent 4fdb32934b
commit dbd9f8e973
7 changed files with 181 additions and 18 deletions

View File

@@ -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>