Add get_avatar macro

Print hpr logo or host avatar filename.
This commit is contained in:
2022-07-31 22:25:15 -04:00
parent 858bf058ff
commit f6318cd34f
4 changed files with 13 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
<!--% PROCESS 'shared-avatar.tpl.html' %-->
<hr>
<article>
<header>
@@ -29,8 +30,8 @@
eps.date, eps.license, eps.duration,
eps.title, eps.summary, eps.tags,
eps.series, eps.notes,
CASE hosts.local_image WHEN 1 THEN hosts.hostid ELSE \'hpr_logo\' END AS avatar,
substr(\'0000\' || hosts.hostid, -4, 4) AS [host_id],
hosts.local_image,
hosts.hostid,
hosts.host, hosts.email
FROM eps INNER JOIN hosts ON eps.hostid = hosts.hostid
WHERE eps.date BETWEEN date(\'now\', \'-7 days\') AND date(\'now\')
@@ -41,7 +42,7 @@ ORDER BY date DESC ')
<header>
<h1><a href="episodes/hpr<!--% latest_episodes.id %-->.html">hpr<!--% latest_episodes.id %--> :: <!--% latest_episodes.title %--></a></h1>
<h3><!--% latest_episodes.summary%--></h3>
<p class="meta"$><img src="./images/hosts/<!--% latest_episodes.avatar %-->.png" height="80" width="80" alt="" /></a><br>Hosted by <a href="correspondents/host<!--% latest_episodes.host_id %-->.html"><!--% latest_episodes.host %--></a> on <!--% latest_episodes.date %--> is flagged as <!--% latest_episodes.explicit %--> and released under a <!--% latest_episodes.license %--> license. <br>
<p class="meta"$><img src="./images/<!--% get_avatar(latest_episodes.local_image, latest_episodes.hostid) %-->" height="80" width="80" alt="" /></a><br>Hosted by <a href="correspondents/host<!--% latest_episodes.host_id %-->.html"><!--% latest_episodes.host %--></a> on <!--% latest_episodes.date %--> is flagged as <!--% 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) %-->
<a href="eps.php?id=3628#comments">comments (0)</a></small>