<!--% PROCESS 'shared-episode-summary.tpl.html' %-->
<!--% PROCESS 'shared-avatar.tpl.html' %-->
<!--% PROCESS 'shared-utils.tpl.html' %-->
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
<!--% query_show_count = DBI.prepare('
		SELECT id
		FROM eps
		WHERE eps.hostid = ? ')
%-->
<!--% query_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 eps 
	INNER JOIN hosts ON eps.hostid = hosts.hostid 
	INNER JOIN miniseries ON eps.series = miniseries.id
	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; %-->
<!--% END %-->
<!--% hosts = DBI.tie('hosts', 'hostid') %-->

	<article>
		<!--% this_host = hosts.$id %-->
		<h2 class="title">Correspondent</h2>
		<h2><!--% this_host.host %--></h2>
		<p><img src="<!--% absolute_path(baseurl) %-->images/<!--% get_avatar(this_host.hostid) %-->" 
				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>
		</p>
	<!--% FOREACH show IN shows; %-->

		<!--% show_summary(show, 'hide_host') %-->
    <!--% END %-->
	</article>
	<p><a href="contribute.html">Become a Correspondent</a></p>
