Newer
Older
<?php
if(!defined('OSTCLIENTINC') || !$category || !$category->isPublic()) die('Access Denied');
?>
<h1><strong><?php echo $category->getName() ?></strong></h1>
<p>
<?php echo Format::safe_html($category->getDescription()); ?>
</p>
<hr>
<?php
$sql='SELECT faq.faq_id, question, count(attach.file_id) as attachments '
.' LEFT JOIN '.ATTACHMENT_TABLE.' attach
ON(attach.object_id=faq.faq_id AND attach.type=\'F\' AND attach.inline = 0) '
.' WHERE faq.ispublished=1 AND faq.category_id='.db_input($category->getId())
if(($res=db_query($sql)) && db_num_rows($res)) {
echo '
<h2>Frequently Asked Questions</h2>
<div id="faq">
$attachments=$row['attachments']?'<span class="Icon file"></span>':'';
<li><a href="faq.php?id=%d" >%s %s</a></li>',
$row['faq_id'],Format::htmlchars($row['question']), $attachments);
</div>
<p><a class="back" href="index.php">« Go Back</a></p>';
}else {
echo '<strong>Category does not have any FAQs. <a href="index.php">Back To Index</a></strong>';
}
?>