<?php
// Version: 1.0 RC1; FAQ
// This contains the html for the cat bar of the FAQ.
function template_Faq_above()
{
global $context, $settings, $txt, $scripturl;
// This is the main table - we need it so we can keep the content to the right of it.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="padding-top: 1ex;"><tr>
<td width="180" valign="top" style="width: 26ex; padding-right: 10px; padding-bottom: 10px;">
<table width="100%" cellpadding="4" cellspacing="1" border="0" class="bordercolor">
<tr>
<td class="catbg">', $txt['faq01'], '</td>
</tr>
<tr class="windowbg2">
<td class="smalltext" style="line-height: 1.3; padding-bottom: 3ex;"><ul>';
if(isset($context['cat']) && $context['cat']!='')
{
foreach ($context['cat'] AS $cat)
echo '<li><a href="', $scripturl, '?module=Faq;sa=ShowFaq;id_cat=', $cat['id_cat'], '">', (($cat['id_cat'] == $context['id_cat']) ? '<b>' . $cat['categories'] . '</b>' : $cat['categories']), '</a> (', $cat['count'], ')';
}
echo'</ul>';
echo '
</td>
</tr>
</table>
</td>
<td valign="top">';
}
// close the table started in Faq_above.
function template_Faq_below()
{
global $context, $settings, $options;
echo '
</td>
</tr>
</table>';
}
// here to keep the peace with obExit!
function template_Show_new ()
{
global $context, $txt;
echo '';
}
function template_Show_Faq ()
{
global $context, $txt, $scripturl;
echo '
<a name="top"></a>
<a href="', $scripturl, '?module=Faq">', $txt['faq23'], '</a> -> ', $context['cat'][$context['id_cat']]['categories'], '<br />
<table align="center" width="80%" cellpadding="4" cellspacing="0" border="1">
<caption><b>',$txt['faq24'],'</b></caption>
<tr>
<td>
<ul>';
foreach ($context['questions'] AS $asw)
echo '
<li><a href="#', $asw['id'], '">', $asw['question'], '</a></li>';
reset ($context['questions']);
unset ($asw);
echo '</ul></td>
</tr>
</table>
<br /><br />
<table width="80%" align="center" cellpadding="4" cellspacing="0" border="1">
<caption><b>',$txt['faq22'],'</b></caption>
<tr>
<td>
<ul>';
foreach ($context['questions'] AS $asw)
echo '<a name="#', $asw['id'], '"><li><b>', $asw['question'], '</b></a>
<p>', $asw['answer'], '</p>
<div align="center"><a href="#top">', $txt['faq20'], '</a><br /><br /></div></li>
';
echo '</ul></td>
</tr>
</table><br /><br />
<div align="center"><b>[ <a href="', $scripturl, '?module=Faq">', $txt['faq19'], '</a> ]</b></div>';
}
?>